SceneController.d.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import { WebGLRenderer, Scene, Object3D, Camera, Clock } from 'three';
  2. import Lifecycle from './Lifecycle';
  3. import type Component from '../Model/Component';
  4. export default abstract class SceneController extends Lifecycle {
  5. renderFunc: () => void;
  6. private _clock;
  7. private _onPlayCallbacks;
  8. private _onStopCallbacks;
  9. private _throttledAdjustCameraAndRenderer;
  10. protected _scene: THREE.Scene;
  11. protected _containerId: string;
  12. protected _rogueDOMContainer: HTMLElement;
  13. protected _camera: Camera;
  14. protected _renderer: WebGLRenderer;
  15. protected _isRunning: boolean;
  16. protected _isPaused: boolean;
  17. protected _width: number;
  18. protected _height: number;
  19. protected _isOffscreen: boolean;
  20. protected _request: number;
  21. protected _stop: () => void;
  22. private _deltaTime;
  23. private _pageVisibilityHandler;
  24. constructor();
  25. get defaultRenderFunc(): () => void;
  26. get deltaTime(): number;
  27. get height(): number;
  28. get width(): number;
  29. get containerId(): string;
  30. get camera(): Camera;
  31. set camera(value: Camera);
  32. get scene(): Scene;
  33. get renderer(): WebGLRenderer;
  34. get isRunning(): boolean;
  35. get isPaused(): boolean;
  36. get rogueDOMContainer(): HTMLElement;
  37. get clock(): Clock;
  38. onPlay(callback: () => any): {
  39. stop: () => void;
  40. };
  41. onStop(callback: () => any): {
  42. stop: () => void;
  43. };
  44. private loadMaterials;
  45. play(scene: Scene, renderer?: WebGLRenderer, componentsToLoad?: any): void;
  46. stop(): void;
  47. private updateEventsHandler;
  48. pause(): void;
  49. resume(): void;
  50. togglePause(): void;
  51. protected traverseObject3d(object: Object3D, callback: (object3d: Object3D) => void): void;
  52. protected abstract traverseSceneComponents(callback: (component: Component) => void): void;
  53. protected awake(): void;
  54. protected start(): void;
  55. protected beforeUpdate(): void;
  56. protected update(): void;
  57. protected afterUpdate(): void;
  58. startRenderer(renderer?: WebGLRenderer): void;
  59. protected doOnResize: (entries: any) => void;
  60. onResize: () => void;
  61. resizeObserver: ResizeObserver;
  62. setSceneDimensions(width: number, height: number): void;
  63. private setCameraDimensions;
  64. protected adjustCameraAndRenderer(force?: boolean): void;
  65. protected beginUpdateCycle(): void;
  66. }