From 6fb88e1f09f822abe029167fc9fb9cea09fd8f02 Mon Sep 17 00:00:00 2001 From: Edward Moyse Date: Thu, 14 Nov 2024 11:04:39 +0100 Subject: [PATCH] Minor updates for new threejs version --- .../phoenix-event-display/src/loaders/objects/tracks.ts | 5 ++++- .../src/managers/three-manager/controls-manager.ts | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/phoenix-event-display/src/loaders/objects/tracks.ts b/packages/phoenix-event-display/src/loaders/objects/tracks.ts index 166533d3..0b523af8 100644 --- a/packages/phoenix-event-display/src/loaders/objects/tracks.ts +++ b/packages/phoenix-event-display/src/loaders/objects/tracks.ts @@ -230,6 +230,10 @@ export class TracksMaterial extends ShaderMaterial { /** If the material is of track. */ isTracksMaterial: boolean; + static get type() { + return 'TracksMaterial'; + } + /** * Create the tracks material. * @param params Params for creating the tracks material. @@ -248,7 +252,6 @@ export class TracksMaterial extends ShaderMaterial { fragmentShader: tracks_vert, }); this.isTracksMaterial = true; - this.type = 'TracksMaterial'; Object.defineProperties(this, { lineWidth: { diff --git a/packages/phoenix-event-display/src/managers/three-manager/controls-manager.ts b/packages/phoenix-event-display/src/managers/three-manager/controls-manager.ts index e4e6370d..15e3d0f2 100644 --- a/packages/phoenix-event-display/src/managers/three-manager/controls-manager.ts +++ b/packages/phoenix-event-display/src/managers/three-manager/controls-manager.ts @@ -162,21 +162,21 @@ export class ControlsManager { * @returns Currently active camera. */ getActiveCamera(): Camera { - return this.activeControls.object; + return this.activeControls.object as Camera; } /** * Get the main camera. * @returns Main camera. */ getMainCamera(): Camera { - return this.mainControls.object; + return this.mainControls.object as Camera; } /** * Get the camera for overlay. * @returns The camera for overlay. */ getOverlayCamera(): Camera { - return this.overlayControls.object; + return this.overlayControls.object as Camera; } /** * Get the main and overlay cameras.