import { Inject , Singleton } from 'typescript-ioc' ; import { CameraComponent } from './camera.component' ; import { CoreControllerComponent } from '../controller/core-controller.component' ; import { CoreCameraControllerComponent } from '../controller/core-camera-controller.component' ; import { MovementComponent } from '../controller/movement-component' ; import { TimerComponent } from '../timer/timer.component' ; @ Singleton export class CameraManager { constructor ( @ Inject private readonly component , @ Inject private readonly controller , @ Inject private readonly cameraController , @ Inject private readonly timer , @ Inject private readonly movement ) { controller . resize$ . subscribe ( ( size ) => component . setAspectRatio ( size . x / size . y ) ) ; cameraController . quaternion$ . subscribe ( ( quaternion ) => component . setQuaternion ( quaternion ) ) ; movement . position$ . subscribe ( ( position ) => component . setPosition ( position ) ) ; } }