Skip to content

Conversation

@davgenaec
Copy link
Contributor

Description

This PR adds complete TypeScript definitions for the CameraTransitionManager class to expose all public API that was previously missing from the type definitions.

Changes

  • Event typing: Added CameraTransitionManagerEventMap interface defining all event types:

    • camera-change: Fired when the active camera changes
    • transition-start: Fired when a transition animation begins
    • transition-end: Fired when a transition animation ends
    • toggle: Fired when cameras are toggled
    • change: Fired during transition with alpha progress
  • Missing properties: Added all public properties from the JavaScript implementation:

    • fixedPoint: Vector3 - The point in space that remains stable during transitions
    • duration: number - Transition duration in milliseconds
    • autoSync: boolean - Whether to automatically sync cameras
    • orthographicPositionalZoom: boolean - Zoom behavior setting
    • orthographicOffset: number - Offset for orthographic camera positioning
    • easeFunction: (x: number) => number - Custom easing function
    • perspectiveCamera: PerspectiveCamera - The perspective camera instance
    • orthographicCamera: OrthographicCamera - The orthographic camera instance
    • transitionCamera: PerspectiveCamera - The intermediate camera used during transitions
  • Missing getter: Added alpha getter property that returns transition progress

  • Method signature: Updated update() to include optional deltaTime parameter

  • Export: Added CameraTransitionManagerEventMap to index exports

Pattern

This PR follows the same pattern used by EnvironmentControls in the repository, using EventDispatcher<EventMap> for type-safe event handling.

Testing

Type definitions have been verified against the JavaScript implementation in src/three/renderer/controls/CameraTransitionManager.js.

Related

This resolves type definition gaps that required users to create extended type definitions in their projects (e.g., see usage in aec-craft/nb-generative).

- Add CameraTransitionManagerEventMap interface with all event types
- Add missing 'alpha' getter property
- Add all public properties: fixedPoint, duration, autoSync, orthographicPositionalZoom, orthographicOffset, easeFunction
- Add camera properties: perspectiveCamera, orthographicCamera, transitionCamera
- Update update() method signature to include optional deltaTime parameter
- Export CameraTransitionManagerEventMap from index
- Follow EnvironmentControls pattern for EventDispatcher typing

This change exposes all public API from the JavaScript implementation that was previously missing from the type definitions.
@gkjohnson
Copy link
Contributor

Great, thank you!

@gkjohnson gkjohnson merged commit 2b51b2d into NASA-AMMOS:master Oct 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants