Fix perspective camera toggle in debug pane to update immediately (#2969)

This commit is contained in:
Jonathan Tran
2024-07-10 17:50:25 -04:00
committed by GitHub
parent 263a4f324d
commit 6c2fa95a32
2 changed files with 3 additions and 3 deletions

View File

@ -518,9 +518,9 @@ export class CameraControls {
direction.normalize() direction.normalize()
this.camera.position.copy(this.target).addScaledVector(direction, distance) this.camera.position.copy(this.target).addScaledVector(direction, distance)
} }
usePerspectiveCamera = async () => { usePerspectiveCamera = async (forceSend = false) => {
this._usePerspectiveCamera() this._usePerspectiveCamera()
if (this.syncDirection === 'clientToEngine') { if (forceSend || this.syncDirection === 'clientToEngine') {
await this.engineCommandManager.sendSceneCommand({ await this.engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req', type: 'modeling_cmd_req',
cmd_id: uuidv4(), cmd_id: uuidv4(),

View File

@ -717,7 +717,7 @@ export const CamDebugSettings = () => {
if (camSettings.type === 'perspective') { if (camSettings.type === 'perspective') {
sceneInfra.camControls.useOrthographicCamera() sceneInfra.camControls.useOrthographicCamera()
} else { } else {
sceneInfra.camControls.usePerspectiveCamera() sceneInfra.camControls.usePerspectiveCamera(true)
} }
}} }}
/> />