From adbeb76a0d63b029d8b6aa9ed71e809a768c4ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Guimmara?= Date: Tue, 7 Jan 2025 16:22:43 +0100 Subject: [PATCH] fix(controls): export controls declaration files (GlobeControls, EnvironmentControls, CameraTransitionManager) --- src/index.d.ts | 3 ++ .../controls/CameraTransitionManager.d.ts | 18 +++++++++ src/three/controls/EnvironmentControls.d.ts | 38 +++++++++++++++++++ src/three/controls/GlobeControls.d.ts | 15 ++++++++ 4 files changed, 74 insertions(+) create mode 100644 src/three/controls/CameraTransitionManager.d.ts create mode 100644 src/three/controls/EnvironmentControls.d.ts create mode 100644 src/three/controls/GlobeControls.d.ts diff --git a/src/index.d.ts b/src/index.d.ts index bc6c35baa..d7de010ae 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,6 +1,9 @@ // three.js export { TilesRenderer } from './three/TilesRenderer'; export { TilesGroup } from './three/TilesGroup'; +export { EnvironmentControls } from './three/controls/EnvironmentControls'; +export { GlobeControls } from './three/controls/GlobeControls'; +export { CameraTransitionManager } from './three/controls/CameraTransitionManager'; export { B3DMLoader, B3DMScene } from './three/loaders/B3DMLoader'; export { I3DMLoader, I3DMScene } from './three/loaders/I3DMLoader'; export { PNTSLoader, PNTSScene } from './three/loaders/PNTSLoader'; diff --git a/src/three/controls/CameraTransitionManager.d.ts b/src/three/controls/CameraTransitionManager.d.ts new file mode 100644 index 000000000..e7646225a --- /dev/null +++ b/src/three/controls/CameraTransitionManager.d.ts @@ -0,0 +1,18 @@ +import { OrthographicCamera, PerspectiveCamera } from 'three'; + +export class CameraTransitionManager extends EventDispatcher { + + get animating(): boolean; + get camera(): PerspectiveCamera | OrthographicCamera; + + get mode(): 'perspective' | 'orthographic'; + set mode( v: 'perspective' | 'orthographic' ); + + constructor( perspectiveCamera?: PerspectiveCamera, orthographicCamera?: OrthographicCamera ); + + toggle(): void; + update(): void; + + syncCameras(): void; + +} diff --git a/src/three/controls/EnvironmentControls.d.ts b/src/three/controls/EnvironmentControls.d.ts new file mode 100644 index 000000000..dd18ef68a --- /dev/null +++ b/src/three/controls/EnvironmentControls.d.ts @@ -0,0 +1,38 @@ +import { Camera, EventDispatcher, Object3D, Vector3 } from 'three'; +import { TilesRenderer } from '../TilesRenderer'; + +export class EnvironmentControls extends EventDispatcher { + + readonly isEnvironmentControls: true; + + get enabled(): boolean; + set enabled( v: boolean ); + + constructor( + scene: Object3D = null, + camera: Camera = null, + domElement: HTMLElement = null, + tilesRenderer: TilesRenderer = null + ); + + setScene ( scene: Object3D ): void; + setCamera ( camera: Camera ): void; + setTilesRenderer( tilesRenderer: TilesRenderer ): void; + + attach( domElement: HTMLElement ): void; + detach(): void; + + setState( state?: number, fireEvent?: boolean ): void; + resetState(): void; + + update( deltaTime?: number ): void; + + adjustCamera( camera: Camera ): void; + + getUpDirection( point: Vector3, target: Vector3 ): void; + getCameraUpDirection( target: Vector3 ): void; + getPivotPoint ( target: Vector3 ): void; + + dispose(): void; + +} diff --git a/src/three/controls/GlobeControls.d.ts b/src/three/controls/GlobeControls.d.ts new file mode 100644 index 000000000..3863b1ba5 --- /dev/null +++ b/src/three/controls/GlobeControls.d.ts @@ -0,0 +1,15 @@ +import { Group, Vector3 } from 'three'; +import { Ellipsoid } from '../math/Ellipsoid'; +import { EnvironmentControls } from './EnvironmentControls'; + +export class GlobeControls extends EnvironmentControls { + + readonly isGlobeControls: true; + + get ellipsoid(): Ellipsoid; + get tilesGroup(): Group; + + getVectorToCenter( target: Vector3 ): Vector3; + getDistanceToCenter(): number; + +}