import { Inject } from "typescript-ioc" ; import { CoreCameraControllerComponent } from "../core-camera-controller.component" ; import { PointerControllerComponent } from "./pointer-controller.component" ; import { MovementComponent } from "../movement-component" ; import { combineLatest } from "rxjs" ; import { WorldComponent } from "../../world/world.component" ; export class PointerControllerManager { constructor ( @ Inject private readonly controller , @ Inject private readonly movementController , @ Inject private readonly cameraController , @ Inject private readonly worlds ) { combineLatest ( [ movementController . position$ , cameraController . quaternion$ , ] ) . subscribe ( ( [ position , quaternion ] ) => controller . update ( position , quaternion , worlds . getCurrentWorld ( ) . getRawObjects ( ) ) ) ; } }