From 002e78046af8da5ca68e36c8abd7cad178ac943a Mon Sep 17 00:00:00 2001 From: Kosuke-KIDO-datalabs <103032063+Kosuke-KIDO-datalabs@users.noreply.github.com> Date: Mon, 5 Aug 2024 22:36:54 +0900 Subject: [PATCH] feat: refactor control classes to use readonly for target property (#370) --- src/controls/ArcballControls.ts | 2 +- src/controls/FirstPersonControls.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controls/ArcballControls.ts b/src/controls/ArcballControls.ts index c64a77a3..8a65882d 100644 --- a/src/controls/ArcballControls.ts +++ b/src/controls/ArcballControls.ts @@ -190,7 +190,7 @@ class ArcballControls extends EventDispatcher { public minZoom: number public maxZoom: number - private target: Vector3 + readonly target: Vector3 private _currentTarget: Vector3 private _tbRadius: number diff --git a/src/controls/FirstPersonControls.ts b/src/controls/FirstPersonControls.ts index 79fdd5de..e6bbd251 100644 --- a/src/controls/FirstPersonControls.ts +++ b/src/controls/FirstPersonControls.ts @@ -49,7 +49,7 @@ export class FirstPersonControls extends EventDispatcher { private lookDirection = new Vector3() private spherical = new Spherical() - private target = new Vector3() + readonly target = new Vector3() constructor(object: Camera, domElement?: HTMLElement | null) { super()