@babylonjs/core 9.12.1 → 9.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/runtimeAnimation.js +11 -0
- package/Animations/runtimeAnimation.js.map +1 -1
- package/AudioV2/abstractAudio/abstractSound.d.ts +2 -1
- package/AudioV2/abstractAudio/abstractSound.js +3 -2
- package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
- package/AudioV2/abstractAudio/abstractSoundInstance.d.ts +1 -1
- package/AudioV2/abstractAudio/abstractSoundInstance.js.map +1 -1
- package/AudioV2/abstractAudio/staticSound.d.ts +6 -0
- package/AudioV2/abstractAudio/staticSound.js +9 -1
- package/AudioV2/abstractAudio/staticSound.js.map +1 -1
- package/AudioV2/abstractAudio/streamingSound.d.ts +6 -0
- package/AudioV2/abstractAudio/streamingSound.js +9 -1
- package/AudioV2/abstractAudio/streamingSound.js.map +1 -1
- package/AudioV2/webAudio/webAudioStaticSound.d.ts +1 -1
- package/AudioV2/webAudio/webAudioStaticSound.js +6 -3
- package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
- package/AudioV2/webAudio/webAudioStreamingSound.d.ts +1 -1
- package/AudioV2/webAudio/webAudioStreamingSound.js +7 -4
- package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
- package/Cameras/arcRotateCamera.pure.js +9 -3
- package/Cameras/arcRotateCamera.pure.js.map +1 -1
- package/Cameras/targetCamera.pure.js +18 -18
- package/Cameras/targetCamera.pure.js.map +1 -1
- package/Collisions/gpuPicker.d.ts +111 -4
- package/Collisions/gpuPicker.js +696 -119
- package/Collisions/gpuPicker.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +4 -2
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.d.ts +3 -0
- package/Engines/Native/nativeRenderTargetWrapper.js +24 -1
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.videoTexture.pure.js +16 -3
- package/Engines/WebGPU/Extensions/engine.videoTexture.pure.js.map +1 -1
- package/Engines/abstractEngine.pure.d.ts +8 -1
- package/Engines/abstractEngine.pure.js +4 -3
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.d.ts +113 -0
- package/Engines/nullEngine.pure.js +5 -1
- package/Engines/nullEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +5 -0
- package/Engines/thinNativeEngine.pure.js +158 -13
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/FlowGraph/flowGraph.js +9 -0
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.pure.d.ts +14 -0
- package/FlowGraph/flowGraphDataConnection.pure.js +38 -1
- package/FlowGraph/flowGraphDataConnection.pure.js.map +1 -1
- package/FlowGraph/serialization.d.ts +11 -0
- package/FlowGraph/serialization.js +11 -1
- package/FlowGraph/serialization.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.d.ts +2 -2
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js +43 -51
- package/FrameGraph/Tasks/Rendering/iblShadows/iblShadowsAccumulationTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.d.ts +0 -1
- package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js +63 -35
- package/FrameGraph/Tasks/Rendering/iblShadowsRendererTask.pure.js.map +1 -1
- package/Lights/Clustered/clusteredLightContainer.pure.d.ts +1 -1
- package/Lights/Clustered/clusteredLightContainer.pure.js +2 -2
- package/Lights/Clustered/clusteredLightContainer.pure.js.map +1 -1
- package/Lights/areaLight.pure.js +5 -0
- package/Lights/areaLight.pure.js.map +1 -1
- package/Lights/light.d.ts +4 -2
- package/Lights/light.js +10 -4
- package/Lights/light.js.map +1 -1
- package/Lights/rectAreaLight.pure.d.ts +17 -0
- package/Lights/rectAreaLight.pure.js +67 -0
- package/Lights/rectAreaLight.pure.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.pure.js +1 -1
- package/Loading/Plugins/babylonFileLoader.pure.js.map +1 -1
- package/Loading/sceneLoader.d.ts +5 -1
- package/Loading/sceneLoader.js +298 -401
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.d.ts +15 -0
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +34 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +9 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +26 -2
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +3 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
- package/Materials/Textures/HTML/htmlInCanvasPolyfill.d.ts +43 -0
- package/Materials/Textures/HTML/htmlInCanvasPolyfill.js +64 -0
- package/Materials/Textures/HTML/htmlInCanvasPolyfill.js.map +1 -0
- package/Materials/Textures/HTML/htmlInteractionManager.d.ts +69 -0
- package/Materials/Textures/HTML/htmlInteractionManager.js +130 -0
- package/Materials/Textures/HTML/htmlInteractionManager.js.map +1 -0
- package/Materials/Textures/HTML/htmlRaycastInteractionManager.d.ts +84 -0
- package/Materials/Textures/HTML/htmlRaycastInteractionManager.js +246 -0
- package/Materials/Textures/HTML/htmlRaycastInteractionManager.js.map +1 -0
- package/Materials/Textures/HTML/htmlTexture.d.ts +148 -0
- package/Materials/Textures/HTML/htmlTexture.js +455 -0
- package/Materials/Textures/HTML/htmlTexture.js.map +1 -0
- package/Materials/Textures/HTML/index.d.ts +4 -0
- package/Materials/Textures/HTML/index.js +5 -0
- package/Materials/Textures/HTML/index.js.map +1 -0
- package/Materials/Textures/HTML/pure.d.ts +5 -0
- package/Materials/Textures/HTML/pure.js +6 -0
- package/Materials/Textures/HTML/pure.js.map +1 -0
- package/Materials/Textures/index.d.ts +1 -0
- package/Materials/Textures/index.js +1 -1
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/Textures/pure.d.ts +1 -0
- package/Materials/Textures/pure.js +1 -0
- package/Materials/Textures/pure.js.map +1 -1
- package/Materials/Textures/videoTexture.pure.d.ts +3 -0
- package/Materials/Textures/videoTexture.pure.js +30 -0
- package/Materials/Textures/videoTexture.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +36 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +56 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.d.ts +3 -1
- package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js +210 -48
- package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +1 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +34 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js +1 -0
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/gaussianSplatting.fragment.js +17 -1
- package/Shaders/gaussianSplatting.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +1 -1
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/gaussianSplattingDepth.vertex.js +1 -1
- package/Shaders/gaussianSplattingDepth.vertex.js.map +1 -1
- package/Shaders/picking.fragment.js +39 -3
- package/Shaders/picking.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +3 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js +4 -3
- package/ShadersWGSL/ShadersInclude/openpbrIblFunctions.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.fragment.js +14 -1
- package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +2 -2
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -2
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
- package/ShadersWGSL/picking.fragment.js +22 -1
- package/ShadersWGSL/picking.fragment.js.map +1 -1
- package/package.json +1 -1
|
@@ -308,27 +308,25 @@ export class TargetCamera extends Camera {
|
|
|
308
308
|
// movement system's velocity, not in these fields), so external code polling them *after*
|
|
309
309
|
// `_checkInputs()` reads 0 rather than the legacy residual glide value.
|
|
310
310
|
const movement = this.movement;
|
|
311
|
-
// Capture whether there is raw input on
|
|
312
|
-
// movement system. This gates the legacy
|
|
311
|
+
// Capture whether there is raw input on the pan channel THIS frame, before it is folded into the
|
|
312
|
+
// movement system. This gates the legacy panning cutoff below so it only ends a decaying inertial
|
|
313
313
|
// tail and never discards a small but legitimate active-input delta.
|
|
314
314
|
const hasPanInput = this.cameraDirection.x !== 0 || this.cameraDirection.y !== 0 || this.cameraDirection.z !== 0;
|
|
315
|
-
const hasRotationInput = this.cameraRotation.x !== 0 || this.cameraRotation.y !== 0;
|
|
316
315
|
movement.panAccumulatedPixels.addInPlace(this.cameraDirection);
|
|
317
316
|
movement.rotationAccumulatedPixels.x += this.cameraRotation.x;
|
|
318
317
|
movement.rotationAccumulatedPixels.y += this.cameraRotation.y;
|
|
319
318
|
movement.computeCurrentFrameDeltas();
|
|
320
319
|
this.cameraDirection.copyFrom(movement.panDeltaCurrentFrame);
|
|
321
320
|
this.cameraRotation.set(movement.rotationDeltaCurrentFrame.x, movement.rotationDeltaCurrentFrame.y);
|
|
322
|
-
// Backward-compat glide cutoff: honor the legacy `_panningEpsilon`
|
|
323
|
-
// Legacy `_checkInputs` snapped `cameraDirection
|
|
324
|
-
//
|
|
325
|
-
//
|
|
326
|
-
//
|
|
327
|
-
//
|
|
328
|
-
//
|
|
329
|
-
//
|
|
330
|
-
//
|
|
331
|
-
// discarded and the camera would feel unresponsive.
|
|
321
|
+
// Backward-compat glide cutoff: honor the legacy `_panningEpsilon` knob for translation.
|
|
322
|
+
// Legacy `_checkInputs` snapped `cameraDirection` to 0 once the glide fell below the threshold,
|
|
323
|
+
// ending the inertial glide at that point. The framerate-independent port moved glide into the
|
|
324
|
+
// movement system's velocity, so we mirror that cutoff here and reset the velocity so the glide
|
|
325
|
+
// terminates at the same point (and the public knob stays meaningful). This is gated on
|
|
326
|
+
// `!hasPanInput` so it only fires on the decaying tail: on an active-input frame the emitted
|
|
327
|
+
// delta is always applied, even when it is below the limit. Translation magnitude scales with
|
|
328
|
+
// `this.speed` (inputs use `_computeLocalCameraSpeed`), so the panning cutoff is scaled by
|
|
329
|
+
// `speed` too, keeping the glide *duration* independent of speed.
|
|
332
330
|
const inertialPanningLimit = this.speed * this._panningEpsilon;
|
|
333
331
|
if (!hasPanInput &&
|
|
334
332
|
Math.abs(this.cameraDirection.x) < inertialPanningLimit &&
|
|
@@ -337,11 +335,13 @@ export class TargetCamera extends Camera {
|
|
|
337
335
|
this.cameraDirection.setAll(0);
|
|
338
336
|
movement.resetPanVelocity();
|
|
339
337
|
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
338
|
+
// Rotation has no legacy per-frame-delta cutoff: the movement system already terminates the
|
|
339
|
+
// glide via its own framerate-independent velocity epsilon, so `cameraRotation` is naturally 0
|
|
340
|
+
// once the rotation velocity decays. Applying a coarse `_rotationEpsilon` snap on top truncated
|
|
341
|
+
// the inertia tail and reintroduced framerate dependence (the snap tests a per-frame delta, which
|
|
342
|
+
// shrinks at high refresh rates), producing a visible "cut" in the glide that was worst at high
|
|
343
|
+
// speeds and high frame rates (forum 61001). Deferring entirely to the velocity epsilon gives the
|
|
344
|
+
// same smooth ease-out at every `speed` and refresh rate.
|
|
345
345
|
const directionMultiplier = this.invertRotation ? -this.inverseRotationSpeed : 1.0;
|
|
346
346
|
const needToMove = this._decideIfNeedsToMove();
|
|
347
347
|
const needToRotate = !!(this.cameraRotation.x || this.cameraRotation.y);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"targetCamera.pure.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/targetCamera.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAE7D,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,kDAAkD;AAClD,MAAM,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AAC9C,MAAM,aAAa,GAAG,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;AAE1D;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM;IAwBpC;;;;;;;;;;;;;OAaG;IACH,IAAoB,OAAO;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAoB,OAAO,CAAC,KAAa;QAC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AEnH,YAAY,CAAC,sBAAsB,CAAC,aAAa,CAAC,YAAY,CAAC,sBAAsB,EAAE,YAAY,CAAC,sBAAsB,CAAC,CAAC;QAE5H,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,sBAAsB,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;QAC1G,SAAS,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,cAAc,CAAC;IAC1B,CAAC;;AAloBc,mCAAsB,GAAiB,IAAI,MAAM,EAAE,AAA7B,CAA8B;AACpD,mCAAsB,GAAiB,IAAI,MAAM,EAAE,AAA7B,CAA8B;AACpD,8BAAiB,GAAiB,IAAI,OAAO,EAAE,AAA9B,CAA+B;AAqDxD;IADN,SAAS,EAAE;gEAC8B;AAMnC;IADN,kBAAkB,EAAE;8CACI;AAWlB;IADN,SAAS,EAAE;2CACO;AAqCZ;IADN,wBAAwB,CAAC,gBAAgB,CAAC;kDACX;AAwhBpC,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAChC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACpD,OAAO,GAAG,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { serialize, serializeAsVector3, serializeAsMeshReference } from \"../Misc/decorators\";\r\nimport { type Nullable } from \"../types\";\r\nimport { Camera } from \"./camera.pure\";\r\nimport { type Scene } from \"../scene.pure\";\r\nimport { Quaternion, Matrix, Vector3, Vector2, TmpVectors } from \"../Maths/math.vector.pure\";\r\nimport { Epsilon } from \"../Maths/math.constants\";\r\nimport { Axis } from \"../Maths/math.axis\";\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh.pure\";\r\nimport { Node } from \"../node\";\r\nimport { type CameraMovement } from \"./cameraMovement\";\r\nimport { TargetCameraMovement } from \"./targetCameraMovement\";\r\n\r\n// Temporary cache variables to avoid allocations.\r\nconst TmpMatrix = /*#__PURE__*/ Matrix.Zero();\r\nconst TmpQuaternion = /*#__PURE__*/ Quaternion.Identity();\r\n\r\n/**\r\n * A target camera takes a mesh or position as a target and continues to look at it while it moves.\r\n * This is the base of the follow, arc rotate cameras and Free camera\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\r\n */\r\nexport class TargetCamera extends Camera {\r\n private static _RigCamTransformMatrix = /*#__PURE__*/ new Matrix();\r\n private static _TargetTransformMatrix = /*#__PURE__*/ new Matrix();\r\n private static _TargetFocalPoint = /*#__PURE__*/ new Vector3();\r\n\r\n /**\r\n * Define the current direction the camera is moving to\r\n */\r\n public cameraDirection = new Vector3(0, 0, 0);\r\n /**\r\n * Define the current rotation the camera is rotating to\r\n */\r\n public cameraRotation = new Vector2(0, 0);\r\n\r\n /**\r\n * Framerate-independent movement controller shared by the TargetCamera family\r\n * (FreeCamera/FlyCamera/FollowCamera). Provides inertial physics and the configurable\r\n * input map. Subclasses may replace it with a specialized {@link CameraMovement}\r\n * (for example ArcRotateCamera uses ArcRotateCameraMovement).\r\n */\r\n public movement: CameraMovement;\r\n\r\n private _targetInertia = 0.9;\r\n\r\n /**\r\n * Defines the inertia (decay coefficient applied per reference frame at 60fps) of the camera.\r\n * This helps giving a smooth feeling to the camera movement.\r\n *\r\n * Override of {@link Camera.inertia} that writes through to the {@link movement} system so the\r\n * framerate-independent pan/rotation glide stays in sync. Setting this updates the movement\r\n * system immediately (matching the accessor convergence used by {@link ArcRotateCamera}).\r\n *\r\n * Backed by a local field rather than `super.inertia`: the shipped UMD bundle is compiled with\r\n * TypeScript at `target: ES5`, and ES5 downleveling of `super` access inside a decorated accessor\r\n * (the base {@link Camera.inertia} carries `@serialize()`) mis-compiles to `undefined`. That would\r\n * feed `NaN` into the movement decay and freeze the camera. It only breaks in the ES5 UMD bundle;\r\n * native-ESM dev keeps real `super`. See the `babylonjs/no-super-in-accessor` lint rule.\r\n */\r\n public override get inertia(): number {\r\n return this._targetInertia;\r\n }\r\n\r\n public override set inertia(value: number) {\r\n this._targetInertia = value;\r\n // `movement` is constructed in this class' constructor; guard for the base-constructor\r\n // assignment that runs before it exists.\r\n if (this.movement) {\r\n this.movement.panInertia = value;\r\n this.movement.rotationInertia = value;\r\n }\r\n }\r\n\r\n /**\r\n * When set, the up vector of the camera will be updated by the rotation of the camera\r\n */\r\n @serialize()\r\n public updateUpVectorFromRotation = false;\r\n\r\n /**\r\n * Define the current rotation of the camera\r\n */\r\n @serializeAsVector3()\r\n public rotation: Vector3;\r\n\r\n /**\r\n * Define the current rotation of the camera as a quaternion to prevent Gimbal lock\r\n */\r\n public rotationQuaternion: Nullable<Quaternion>;\r\n\r\n /**\r\n * Define the current speed of the camera\r\n */\r\n @serialize()\r\n public speed = 2.0;\r\n\r\n /**\r\n * Add constraint to the camera to prevent it to move freely in all directions and\r\n * around all axis.\r\n */\r\n public noRotationConstraint = false;\r\n\r\n /**\r\n * Reverses mouselook direction to 'natural' panning as opposed to traditional direct\r\n * panning\r\n */\r\n public invertRotation = false;\r\n\r\n /**\r\n * Speed multiplier for inverse camera panning\r\n */\r\n public inverseRotationSpeed = 0.2;\r\n\r\n /**\r\n * @internal\r\n * @experimental\r\n * Can be used to change clamping behavior for inertia. Hook into onBeforeRenderObservable to change the value per-frame\r\n */\r\n public _panningEpsilon = Epsilon;\r\n /**\r\n * @internal\r\n * @experimental\r\n * Can be used to change clamping behavior for inertia. Hook into onBeforeRenderObservable to change the value per-frame\r\n */\r\n public _rotationEpsilon = Epsilon;\r\n\r\n /**\r\n * Define the current target of the camera as an object or a position.\r\n * Please note that locking a target will disable panning.\r\n */\r\n @serializeAsMeshReference(\"lockedTargetId\")\r\n public lockedTarget: any = null;\r\n\r\n protected readonly _currentTarget = Vector3.Zero();\r\n protected _initialFocalDistance = 1;\r\n protected readonly _viewMatrix = Matrix.Zero();\r\n\r\n /** @internal */\r\n public readonly _cameraTransformMatrix = Matrix.Zero();\r\n /** @internal */\r\n public readonly _cameraRotationMatrix = Matrix.Zero();\r\n\r\n protected readonly _referencePoint: Vector3;\r\n protected readonly _transformedReferencePoint = Vector3.Zero();\r\n\r\n protected readonly _deferredPositionUpdate = new Vector3();\r\n protected readonly _deferredRotationQuaternionUpdate = new Quaternion();\r\n protected readonly _deferredRotationUpdate = new Vector3();\r\n protected _deferredUpdated = false;\r\n protected _deferOnly: boolean = false;\r\n\r\n /** @internal */\r\n public _reset: () => void;\r\n\r\n /**\r\n * Instantiates a target camera that takes a mesh or position as a target and continues to look at it while it moves.\r\n * This is the base of the follow, arc rotate cameras and Free camera\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\r\n * @param name Defines the name of the camera in the scene\r\n * @param position Defines the start position of the camera in the scene\r\n * @param scene Defines the scene the camera belongs to\r\n * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined\r\n */\r\n constructor(name: string, position: Vector3, scene?: Scene, setActiveOnSceneIfNoneActive = true) {\r\n super(name, position, scene, setActiveOnSceneIfNoneActive);\r\n\r\n this._referencePoint = Vector3.Forward(this.getScene().useRightHandedSystem);\r\n\r\n // Set the y component of the rotation to Math.PI in right-handed system for backwards compatibility.\r\n this.rotation = new Vector3(0, this.getScene().useRightHandedSystem ? Math.PI : 0, 0);\r\n\r\n this.movement = new TargetCameraMovement(this.getScene(), this.position);\r\n // Seed movement-system inertia from the value set during base/subclass construction.\r\n // After this point, the `inertia` setter on this class pushes directly to movement.\r\n this.movement.panInertia = this.inertia;\r\n this.movement.rotationInertia = this.inertia;\r\n }\r\n\r\n /**\r\n * Gets the position in front of the camera at a given distance.\r\n * @param distance The distance from the camera we want the position to be\r\n * @returns the position\r\n */\r\n public getFrontPosition(distance: number): Vector3 {\r\n this.getWorldMatrix();\r\n const worldForward = TmpVectors.Vector3[0];\r\n const localForward = TmpVectors.Vector3[1];\r\n localForward.set(0, 0, this._scene.useRightHandedSystem ? -1.0 : 1.0);\r\n this.getDirectionToRef(localForward, worldForward);\r\n worldForward.scaleInPlace(distance);\r\n return this.globalPosition.add(worldForward);\r\n }\r\n\r\n /** @internal */\r\n public _getLockedTargetPosition(): Nullable<Vector3> {\r\n if (!this.lockedTarget) {\r\n return null;\r\n }\r\n\r\n if (this.lockedTarget.absolutePosition) {\r\n const lockedTarget = this.lockedTarget as AbstractMesh;\r\n const m = lockedTarget.computeWorldMatrix();\r\n // in some cases the absolute position resets externally, but doesn't update since the matrix is cached.\r\n m.getTranslationToRef(lockedTarget.absolutePosition);\r\n }\r\n\r\n return this.lockedTarget.absolutePosition || this.lockedTarget;\r\n }\r\n\r\n private _storedPosition: Vector3;\r\n private _storedRotation: Vector3;\r\n private _storedRotationQuaternion: Nullable<Quaternion>;\r\n\r\n /**\r\n * Store current camera state of the camera (fov, position, rotation, etc..)\r\n * @returns the camera\r\n */\r\n public override storeState(): Camera {\r\n this._storedPosition = this.position.clone();\r\n this._storedRotation = this.rotation.clone();\r\n if (this.rotationQuaternion) {\r\n this._storedRotationQuaternion = this.rotationQuaternion.clone();\r\n }\r\n\r\n return super.storeState();\r\n }\r\n\r\n /**\r\n * Restored camera state. You must call storeState() first\r\n * @returns whether it was successful or not\r\n * @internal\r\n */\r\n public override _restoreStateValues(): boolean {\r\n if (!super._restoreStateValues()) {\r\n return false;\r\n }\r\n\r\n this.position = this._storedPosition.clone();\r\n this.rotation = this._storedRotation.clone();\r\n\r\n if (this.rotationQuaternion && this._storedRotationQuaternion) {\r\n this.rotationQuaternion = this._storedRotationQuaternion.clone();\r\n }\r\n\r\n this.cameraDirection.copyFromFloats(0, 0, 0);\r\n this.cameraRotation.copyFromFloats(0, 0);\r\n\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n public override _initCache() {\r\n super._initCache();\r\n this._cache.lockedTarget = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n this._cache.rotation = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n this._cache.rotationQuaternion = new Quaternion(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _updateCache(ignoreParentClass?: boolean): void {\r\n if (!ignoreParentClass) {\r\n super._updateCache();\r\n }\r\n\r\n const lockedTargetPosition = this._getLockedTargetPosition();\r\n if (!lockedTargetPosition) {\r\n this._cache.lockedTarget = null;\r\n } else {\r\n if (!this._cache.lockedTarget) {\r\n this._cache.lockedTarget = lockedTargetPosition.clone();\r\n } else {\r\n this._cache.lockedTarget.copyFrom(lockedTargetPosition);\r\n }\r\n }\r\n\r\n this._cache.rotation.copyFrom(this.rotation);\r\n if (this.rotationQuaternion) {\r\n this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion);\r\n }\r\n }\r\n\r\n // Synchronized\r\n /** @internal */\r\n public override _isSynchronizedViewMatrix(): boolean {\r\n if (!super._isSynchronizedViewMatrix()) {\r\n return false;\r\n }\r\n\r\n const lockedTargetPosition = this._getLockedTargetPosition();\r\n\r\n return (\r\n (this._cache.lockedTarget ? this._cache.lockedTarget.equals(lockedTargetPosition) : !lockedTargetPosition) &&\r\n (this.rotationQuaternion ? this.rotationQuaternion.equals(this._cache.rotationQuaternion) : this._cache.rotation.equals(this.rotation))\r\n );\r\n }\r\n\r\n // Methods\r\n /** @internal */\r\n public _computeLocalCameraSpeed(): number {\r\n const engine = this.getEngine();\r\n return this.speed * Math.sqrt(engine.getDeltaTime() / (engine.getFps() * 100.0));\r\n }\r\n\r\n // Target\r\n\r\n /**\r\n * Defines the target the camera should look at.\r\n * @param target Defines the new target as a Vector\r\n */\r\n public setTarget(target: Vector3): void {\r\n this.upVector.normalize();\r\n\r\n this._initialFocalDistance = target.subtract(this.position).length();\r\n\r\n if (this.position.z === target.z) {\r\n this.position.z += Epsilon;\r\n }\r\n\r\n this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance);\r\n\r\n if (this.getScene().useRightHandedSystem) {\r\n Matrix.LookAtRHToRef(this.position, target, Vector3.UpReadOnly, TmpMatrix);\r\n } else {\r\n Matrix.LookAtLHToRef(this.position, target, Vector3.UpReadOnly, TmpMatrix);\r\n }\r\n TmpMatrix.invert();\r\n\r\n const rotationQuaternion = this.rotationQuaternion || TmpQuaternion;\r\n Quaternion.FromRotationMatrixToRef(TmpMatrix, rotationQuaternion);\r\n\r\n rotationQuaternion.toEulerAnglesToRef(this.rotation);\r\n\r\n // Explicitly set z to 0 to match previous behavior.\r\n this.rotation.z = 0;\r\n }\r\n\r\n /**\r\n * Defines the target point of the camera.\r\n * The camera looks towards it form the radius distance.\r\n */\r\n public get target(): Vector3 {\r\n return this.getTarget();\r\n }\r\n public set target(value: Vector3) {\r\n this.setTarget(value);\r\n }\r\n\r\n /**\r\n * Return the current target position of the camera. This value is expressed in local space.\r\n * @returns the target position\r\n */\r\n public getTarget(): Vector3 {\r\n return this._currentTarget;\r\n }\r\n\r\n /** @internal */\r\n public _decideIfNeedsToMove(): boolean {\r\n return Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;\r\n }\r\n\r\n /** @internal */\r\n public _updatePosition(): void {\r\n if (this.parent) {\r\n this.parent.getWorldMatrix().invertToRef(TmpVectors.Matrix[0]);\r\n Vector3.TransformNormalToRef(this.cameraDirection, TmpVectors.Matrix[0], TmpVectors.Vector3[0]);\r\n this._deferredPositionUpdate.addInPlace(TmpVectors.Vector3[0]);\r\n if (!this._deferOnly) {\r\n this.position.copyFrom(this._deferredPositionUpdate);\r\n } else {\r\n this._deferredUpdated = true;\r\n }\r\n return;\r\n }\r\n this._deferredPositionUpdate.addInPlace(this.cameraDirection);\r\n if (!this._deferOnly) {\r\n this.position.copyFrom(this._deferredPositionUpdate);\r\n } else {\r\n this._deferredUpdated = true;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public override _checkInputs(): void {\r\n // Fold this frame's raw input — written to `cameraDirection`/`cameraRotation` by the input\r\n // classes (and honored from direct external writes) — into the movement system, then let it\r\n // produce framerate-independent per-frame deltas (input plus inertial glide). The applied\r\n // delta is written back into `cameraDirection`/`cameraRotation` purely as a within-frame\r\n // hand-off so the collision, gravity, and rotation-constraint logic below reads it unchanged.\r\n // Both fields are reset to 0 at the end of this method (the inertial glide now lives in the\r\n // movement system's velocity, not in these fields), so external code polling them *after*\r\n // `_checkInputs()` reads 0 rather than the legacy residual glide value.\r\n const movement = this.movement;\r\n // Capture whether there is raw input on each channel THIS frame, before it is folded into the\r\n // movement system. This gates the legacy glide cutoff below so it only ends a decaying inertial\r\n // tail and never discards a small but legitimate active-input delta.\r\n const hasPanInput = this.cameraDirection.x !== 0 || this.cameraDirection.y !== 0 || this.cameraDirection.z !== 0;\r\n const hasRotationInput = this.cameraRotation.x !== 0 || this.cameraRotation.y !== 0;\r\n movement.panAccumulatedPixels.addInPlace(this.cameraDirection);\r\n movement.rotationAccumulatedPixels.x += this.cameraRotation.x;\r\n movement.rotationAccumulatedPixels.y += this.cameraRotation.y;\r\n movement.computeCurrentFrameDeltas();\r\n this.cameraDirection.copyFrom(movement.panDeltaCurrentFrame);\r\n this.cameraRotation.set(movement.rotationDeltaCurrentFrame.x, movement.rotationDeltaCurrentFrame.y);\r\n\r\n // Backward-compat glide cutoff: honor the legacy `_panningEpsilon` / `_rotationEpsilon` knobs.\r\n // Legacy `_checkInputs` snapped `cameraDirection`/`cameraRotation` to 0 once a glide component\r\n // fell below `speed * _panningEpsilon` / `speed * _rotationEpsilon`, ending the inertial glide\r\n // at that threshold. The framerate-independent port moved glide into the movement system's\r\n // velocity, so we mirror that cutoff here and reset the velocity so the glide terminates at the\r\n // same point (and the public knobs stay meaningful). This is gated on `!hasPanInput` /\r\n // `!hasRotationInput` so it only fires on the decaying tail: on an active-input frame the\r\n // emitted delta is always applied, even when it is below the limit. Without that gate, ordinary\r\n // mouse-look (whose per-frame rotation is typically below `speed * _rotationEpsilon`) would be\r\n // discarded and the camera would feel unresponsive.\r\n const inertialPanningLimit = this.speed * this._panningEpsilon;\r\n if (\r\n !hasPanInput &&\r\n Math.abs(this.cameraDirection.x) < inertialPanningLimit &&\r\n Math.abs(this.cameraDirection.y) < inertialPanningLimit &&\r\n Math.abs(this.cameraDirection.z) < inertialPanningLimit\r\n ) {\r\n this.cameraDirection.setAll(0);\r\n movement.resetPanVelocity();\r\n }\r\n const inertialRotationLimit = this.speed * this._rotationEpsilon;\r\n if (!hasRotationInput && Math.abs(this.cameraRotation.x) < inertialRotationLimit && Math.abs(this.cameraRotation.y) < inertialRotationLimit) {\r\n this.cameraRotation.set(0, 0);\r\n movement.resetRotationVelocity();\r\n }\r\n\r\n const directionMultiplier = this.invertRotation ? -this.inverseRotationSpeed : 1.0;\r\n const needToMove = this._decideIfNeedsToMove();\r\n const needToRotate = !!(this.cameraRotation.x || this.cameraRotation.y);\r\n\r\n this._deferredUpdated = false;\r\n this._deferredRotationUpdate.copyFrom(this.rotation);\r\n this._deferredPositionUpdate.copyFrom(this.position);\r\n if (this.rotationQuaternion) {\r\n this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion);\r\n }\r\n\r\n // Move\r\n if (needToMove) {\r\n this._updatePosition();\r\n }\r\n\r\n // Rotate\r\n if (needToRotate) {\r\n //rotate, if quaternion is set and rotation was used\r\n if (this.rotationQuaternion) {\r\n this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate);\r\n }\r\n\r\n this._deferredRotationUpdate.x += this.cameraRotation.x * directionMultiplier;\r\n this._deferredRotationUpdate.y += this.cameraRotation.y * directionMultiplier;\r\n\r\n // Apply constraints\r\n if (!this.noRotationConstraint) {\r\n const limit = 1.570796;\r\n\r\n if (this._deferredRotationUpdate.x > limit) {\r\n this._deferredRotationUpdate.x = limit;\r\n }\r\n if (this._deferredRotationUpdate.x < -limit) {\r\n this._deferredRotationUpdate.x = -limit;\r\n }\r\n }\r\n\r\n if (!this._deferOnly) {\r\n this.rotation.copyFrom(this._deferredRotationUpdate);\r\n } else {\r\n this._deferredUpdated = true;\r\n }\r\n\r\n //rotate, if quaternion is set and rotation was used\r\n if (this.rotationQuaternion) {\r\n const len = this._deferredRotationUpdate.lengthSquared();\r\n if (len) {\r\n Quaternion.RotationYawPitchRollToRef(\r\n this._deferredRotationUpdate.y,\r\n this._deferredRotationUpdate.x,\r\n this._deferredRotationUpdate.z,\r\n this._deferredRotationQuaternionUpdate\r\n );\r\n if (!this._deferOnly) {\r\n this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate);\r\n } else {\r\n this._deferredUpdated = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // The movement system now owns inertial decay (framerate-independent), so reset the\r\n // per-frame delta surfaces. Glide persists inside the movement velocity and is re-emitted\r\n // next frame via `computeCurrentFrameDeltas`; zeroing here prevents the just-applied delta\r\n // from being re-folded into the accumulators on the next frame.\r\n this.cameraDirection.setAll(0);\r\n this.cameraRotation.set(0, 0);\r\n\r\n super._checkInputs();\r\n }\r\n\r\n protected _updateCameraRotationMatrix() {\r\n if (this.rotationQuaternion) {\r\n this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix);\r\n } else {\r\n Matrix.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this._cameraRotationMatrix);\r\n }\r\n }\r\n\r\n /**\r\n * Update the up vector to apply the rotation of the camera (So if you changed the camera rotation.z this will let you update the up vector as well)\r\n * @returns the current camera\r\n */\r\n private _rotateUpVectorWithCameraRotationMatrix(): TargetCamera {\r\n Vector3.TransformNormalToRef(Vector3.UpReadOnly, this._cameraRotationMatrix, this.upVector);\r\n return this;\r\n }\r\n\r\n private _cachedRotationZ = 0;\r\n private _cachedQuaternionRotationZ = 0;\r\n /** @internal */\r\n public override _getViewMatrix(): Matrix {\r\n if (this.lockedTarget) {\r\n this.setTarget(this._getLockedTargetPosition()!);\r\n }\r\n\r\n // Compute\r\n this._updateCameraRotationMatrix();\r\n\r\n // Apply the changed rotation to the upVector\r\n if (this.rotationQuaternion && this._cachedQuaternionRotationZ != this.rotationQuaternion.z) {\r\n this._rotateUpVectorWithCameraRotationMatrix();\r\n this._cachedQuaternionRotationZ = this.rotationQuaternion.z;\r\n } else if (this._cachedRotationZ !== this.rotation.z) {\r\n this._rotateUpVectorWithCameraRotationMatrix();\r\n this._cachedRotationZ = this.rotation.z;\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint);\r\n\r\n // Computing target and final matrix\r\n this.position.addToRef(this._transformedReferencePoint, this._currentTarget);\r\n if (this.updateUpVectorFromRotation) {\r\n if (this.rotationQuaternion) {\r\n Axis.Y.rotateByQuaternionToRef(this.rotationQuaternion, this.upVector);\r\n } else {\r\n Quaternion.FromEulerVectorToRef(this.rotation, TmpQuaternion);\r\n Axis.Y.rotateByQuaternionToRef(TmpQuaternion, this.upVector);\r\n }\r\n }\r\n this._computeViewMatrix(this.position, this._currentTarget, this.upVector);\r\n return this._viewMatrix;\r\n }\r\n\r\n protected _computeViewMatrix(position: Vector3, target: Vector3, up: Vector3): void {\r\n if (this.getScene().useRightHandedSystem) {\r\n Matrix.LookAtRHToRef(position, target, up, this._viewMatrix);\r\n } else {\r\n Matrix.LookAtLHToRef(position, target, up, this._viewMatrix);\r\n }\r\n\r\n if (this.parent) {\r\n const parentWorldMatrix = this.parent.getWorldMatrix();\r\n this._viewMatrix.invert();\r\n this._viewMatrix.multiplyToRef(parentWorldMatrix, this._viewMatrix);\r\n this._viewMatrix.invert();\r\n\r\n this._markSyncedWithParent();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public override createRigCamera(name: string, cameraIndex: number): Nullable<Camera> {\r\n if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\r\n const rigCamera = new TargetCamera(name, this.position.clone(), this.getScene());\r\n rigCamera.isRigCamera = true;\r\n rigCamera.rigParent = this;\r\n if (this.cameraRigMode === Camera.RIG_MODE_VR) {\r\n if (!this.rotationQuaternion) {\r\n this.rotationQuaternion = new Quaternion();\r\n }\r\n rigCamera._cameraRigParams = {};\r\n rigCamera.rotationQuaternion = new Quaternion();\r\n }\r\n\r\n rigCamera.mode = this.mode;\r\n rigCamera.orthoLeft = this.orthoLeft;\r\n rigCamera.orthoRight = this.orthoRight;\r\n rigCamera.orthoTop = this.orthoTop;\r\n rigCamera.orthoBottom = this.orthoBottom;\r\n\r\n return rigCamera;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _updateRigCameras() {\r\n const camLeft = <TargetCamera>this._rigCameras[0];\r\n const camRight = <TargetCamera>this._rigCameras[1];\r\n\r\n this.computeWorldMatrix();\r\n\r\n switch (this.cameraRigMode) {\r\n case Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:\r\n case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:\r\n case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:\r\n case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:\r\n case Camera.RIG_MODE_STEREOSCOPIC_INTERLACED: {\r\n //provisionnaly using _cameraRigParams.stereoHalfAngle instead of calculations based on _cameraRigParams.interaxialDistance:\r\n const leftSign = this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? 1 : -1;\r\n const rightSign = this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? -1 : 1;\r\n this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * leftSign, camLeft);\r\n this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * rightSign, camRight);\r\n break;\r\n }\r\n case Camera.RIG_MODE_VR:\r\n if (camLeft.rotationQuaternion && camRight.rotationQuaternion && this.rotationQuaternion) {\r\n camLeft.rotationQuaternion.copyFrom(this.rotationQuaternion);\r\n camRight.rotationQuaternion.copyFrom(this.rotationQuaternion);\r\n } else {\r\n camLeft.rotation.copyFrom(this.rotation);\r\n camRight.rotation.copyFrom(this.rotation);\r\n }\r\n camLeft.position.copyFrom(this.position);\r\n camRight.position.copyFrom(this.position);\r\n\r\n break;\r\n }\r\n super._updateRigCameras();\r\n }\r\n\r\n private _getRigCamPositionAndTarget(halfSpace: number, rigCamera: TargetCamera) {\r\n const target = this.getTarget();\r\n target.subtractToRef(this.position, TargetCamera._TargetFocalPoint);\r\n\r\n TargetCamera._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);\r\n const newFocalTarget = TargetCamera._TargetFocalPoint.addInPlace(this.position);\r\n\r\n Matrix.TranslationToRef(-newFocalTarget.x, -newFocalTarget.y, -newFocalTarget.z, TargetCamera._TargetTransformMatrix);\r\n TargetCamera._TargetTransformMatrix.multiplyToRef(Matrix.RotationAxis(rigCamera.upVector, halfSpace), TargetCamera._RigCamTransformMatrix);\r\n Matrix.TranslationToRef(newFocalTarget.x, newFocalTarget.y, newFocalTarget.z, TargetCamera._TargetTransformMatrix);\r\n\r\n TargetCamera._RigCamTransformMatrix.multiplyToRef(TargetCamera._TargetTransformMatrix, TargetCamera._RigCamTransformMatrix);\r\n\r\n Vector3.TransformCoordinatesToRef(this.position, TargetCamera._RigCamTransformMatrix, rigCamera.position);\r\n rigCamera.setTarget(newFocalTarget);\r\n }\r\n\r\n /**\r\n * Gets the current object class name.\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return \"TargetCamera\";\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for targetCamera.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterTargetCamera(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n Node.AddNodeConstructor(\"TargetCamera\", (name, scene) => {\r\n return () => new TargetCamera(name, Vector3.Zero(), scene);\r\n });\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"targetCamera.pure.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/targetCamera.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAE7D,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,kDAAkD;AAClD,MAAM,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AAC9C,MAAM,aAAa,GAAG,aAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;AAE1D;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM;IAwBpC;;;;;;;;;;;;;OAaG;IACH,IAAoB,OAAO;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAoB,OAAO,CAAC,KAAa;QACrC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,uFAAuF;QACvF,yCAAyC;QACzC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,IAAI,CAAC,QAAQ,CAAC,UAA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SAAS,EAAE;2CACO;AAqCZ;IADN,wBAAwB,CAAC,gBAAgB,CAAC;kDACX;AAwhBpC,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAChC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACpD,OAAO,GAAG,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { serialize, serializeAsVector3, serializeAsMeshReference } from \"../Misc/decorators\";\r\nimport { type Nullable } from \"../types\";\r\nimport { Camera } from \"./camera.pure\";\r\nimport { type Scene } from \"../scene.pure\";\r\nimport { Quaternion, Matrix, Vector3, Vector2, TmpVectors } from \"../Maths/math.vector.pure\";\r\nimport { Epsilon } from \"../Maths/math.constants\";\r\nimport { Axis } from \"../Maths/math.axis\";\r\nimport { type AbstractMesh } from \"../Meshes/abstractMesh.pure\";\r\nimport { Node } from \"../node\";\r\nimport { type CameraMovement } from \"./cameraMovement\";\r\nimport { TargetCameraMovement } from \"./targetCameraMovement\";\r\n\r\n// Temporary cache variables to avoid allocations.\r\nconst TmpMatrix = /*#__PURE__*/ Matrix.Zero();\r\nconst TmpQuaternion = /*#__PURE__*/ Quaternion.Identity();\r\n\r\n/**\r\n * A target camera takes a mesh or position as a target and continues to look at it while it moves.\r\n * This is the base of the follow, arc rotate cameras and Free camera\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\r\n */\r\nexport class TargetCamera extends Camera {\r\n private static _RigCamTransformMatrix = /*#__PURE__*/ new Matrix();\r\n private static _TargetTransformMatrix = /*#__PURE__*/ new Matrix();\r\n private static _TargetFocalPoint = /*#__PURE__*/ new Vector3();\r\n\r\n /**\r\n * Define the current direction the camera is moving to\r\n */\r\n public cameraDirection = new Vector3(0, 0, 0);\r\n /**\r\n * Define the current rotation the camera is rotating to\r\n */\r\n public cameraRotation = new Vector2(0, 0);\r\n\r\n /**\r\n * Framerate-independent movement controller shared by the TargetCamera family\r\n * (FreeCamera/FlyCamera/FollowCamera). Provides inertial physics and the configurable\r\n * input map. Subclasses may replace it with a specialized {@link CameraMovement}\r\n * (for example ArcRotateCamera uses ArcRotateCameraMovement).\r\n */\r\n public movement: CameraMovement;\r\n\r\n private _targetInertia = 0.9;\r\n\r\n /**\r\n * Defines the inertia (decay coefficient applied per reference frame at 60fps) of the camera.\r\n * This helps giving a smooth feeling to the camera movement.\r\n *\r\n * Override of {@link Camera.inertia} that writes through to the {@link movement} system so the\r\n * framerate-independent pan/rotation glide stays in sync. Setting this updates the movement\r\n * system immediately (matching the accessor convergence used by {@link ArcRotateCamera}).\r\n *\r\n * Backed by a local field rather than `super.inertia`: the shipped UMD bundle is compiled with\r\n * TypeScript at `target: ES5`, and ES5 downleveling of `super` access inside a decorated accessor\r\n * (the base {@link Camera.inertia} carries `@serialize()`) mis-compiles to `undefined`. That would\r\n * feed `NaN` into the movement decay and freeze the camera. It only breaks in the ES5 UMD bundle;\r\n * native-ESM dev keeps real `super`. See the `babylonjs/no-super-in-accessor` lint rule.\r\n */\r\n public override get inertia(): number {\r\n return this._targetInertia;\r\n }\r\n\r\n public override set inertia(value: number) {\r\n this._targetInertia = value;\r\n // `movement` is constructed in this class' constructor; guard for the base-constructor\r\n // assignment that runs before it exists.\r\n if (this.movement) {\r\n this.movement.panInertia = value;\r\n this.movement.rotationInertia = value;\r\n }\r\n }\r\n\r\n /**\r\n * When set, the up vector of the camera will be updated by the rotation of the camera\r\n */\r\n @serialize()\r\n public updateUpVectorFromRotation = false;\r\n\r\n /**\r\n * Define the current rotation of the camera\r\n */\r\n @serializeAsVector3()\r\n public rotation: Vector3;\r\n\r\n /**\r\n * Define the current rotation of the camera as a quaternion to prevent Gimbal lock\r\n */\r\n public rotationQuaternion: Nullable<Quaternion>;\r\n\r\n /**\r\n * Define the current speed of the camera\r\n */\r\n @serialize()\r\n public speed = 2.0;\r\n\r\n /**\r\n * Add constraint to the camera to prevent it to move freely in all directions and\r\n * around all axis.\r\n */\r\n public noRotationConstraint = false;\r\n\r\n /**\r\n * Reverses mouselook direction to 'natural' panning as opposed to traditional direct\r\n * panning\r\n */\r\n public invertRotation = false;\r\n\r\n /**\r\n * Speed multiplier for inverse camera panning\r\n */\r\n public inverseRotationSpeed = 0.2;\r\n\r\n /**\r\n * @internal\r\n * @experimental\r\n * Can be used to change clamping behavior for inertia. Hook into onBeforeRenderObservable to change the value per-frame\r\n */\r\n public _panningEpsilon = Epsilon;\r\n /**\r\n * @internal\r\n * @experimental\r\n * Can be used to change clamping behavior for inertia. Hook into onBeforeRenderObservable to change the value per-frame\r\n */\r\n public _rotationEpsilon = Epsilon;\r\n\r\n /**\r\n * Define the current target of the camera as an object or a position.\r\n * Please note that locking a target will disable panning.\r\n */\r\n @serializeAsMeshReference(\"lockedTargetId\")\r\n public lockedTarget: any = null;\r\n\r\n protected readonly _currentTarget = Vector3.Zero();\r\n protected _initialFocalDistance = 1;\r\n protected readonly _viewMatrix = Matrix.Zero();\r\n\r\n /** @internal */\r\n public readonly _cameraTransformMatrix = Matrix.Zero();\r\n /** @internal */\r\n public readonly _cameraRotationMatrix = Matrix.Zero();\r\n\r\n protected readonly _referencePoint: Vector3;\r\n protected readonly _transformedReferencePoint = Vector3.Zero();\r\n\r\n protected readonly _deferredPositionUpdate = new Vector3();\r\n protected readonly _deferredRotationQuaternionUpdate = new Quaternion();\r\n protected readonly _deferredRotationUpdate = new Vector3();\r\n protected _deferredUpdated = false;\r\n protected _deferOnly: boolean = false;\r\n\r\n /** @internal */\r\n public _reset: () => void;\r\n\r\n /**\r\n * Instantiates a target camera that takes a mesh or position as a target and continues to look at it while it moves.\r\n * This is the base of the follow, arc rotate cameras and Free camera\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\r\n * @param name Defines the name of the camera in the scene\r\n * @param position Defines the start position of the camera in the scene\r\n * @param scene Defines the scene the camera belongs to\r\n * @param setActiveOnSceneIfNoneActive Defines whether the camera should be marked as active if not other active cameras have been defined\r\n */\r\n constructor(name: string, position: Vector3, scene?: Scene, setActiveOnSceneIfNoneActive = true) {\r\n super(name, position, scene, setActiveOnSceneIfNoneActive);\r\n\r\n this._referencePoint = Vector3.Forward(this.getScene().useRightHandedSystem);\r\n\r\n // Set the y component of the rotation to Math.PI in right-handed system for backwards compatibility.\r\n this.rotation = new Vector3(0, this.getScene().useRightHandedSystem ? Math.PI : 0, 0);\r\n\r\n this.movement = new TargetCameraMovement(this.getScene(), this.position);\r\n // Seed movement-system inertia from the value set during base/subclass construction.\r\n // After this point, the `inertia` setter on this class pushes directly to movement.\r\n this.movement.panInertia = this.inertia;\r\n this.movement.rotationInertia = this.inertia;\r\n }\r\n\r\n /**\r\n * Gets the position in front of the camera at a given distance.\r\n * @param distance The distance from the camera we want the position to be\r\n * @returns the position\r\n */\r\n public getFrontPosition(distance: number): Vector3 {\r\n this.getWorldMatrix();\r\n const worldForward = TmpVectors.Vector3[0];\r\n const localForward = TmpVectors.Vector3[1];\r\n localForward.set(0, 0, this._scene.useRightHandedSystem ? -1.0 : 1.0);\r\n this.getDirectionToRef(localForward, worldForward);\r\n worldForward.scaleInPlace(distance);\r\n return this.globalPosition.add(worldForward);\r\n }\r\n\r\n /** @internal */\r\n public _getLockedTargetPosition(): Nullable<Vector3> {\r\n if (!this.lockedTarget) {\r\n return null;\r\n }\r\n\r\n if (this.lockedTarget.absolutePosition) {\r\n const lockedTarget = this.lockedTarget as AbstractMesh;\r\n const m = lockedTarget.computeWorldMatrix();\r\n // in some cases the absolute position resets externally, but doesn't update since the matrix is cached.\r\n m.getTranslationToRef(lockedTarget.absolutePosition);\r\n }\r\n\r\n return this.lockedTarget.absolutePosition || this.lockedTarget;\r\n }\r\n\r\n private _storedPosition: Vector3;\r\n private _storedRotation: Vector3;\r\n private _storedRotationQuaternion: Nullable<Quaternion>;\r\n\r\n /**\r\n * Store current camera state of the camera (fov, position, rotation, etc..)\r\n * @returns the camera\r\n */\r\n public override storeState(): Camera {\r\n this._storedPosition = this.position.clone();\r\n this._storedRotation = this.rotation.clone();\r\n if (this.rotationQuaternion) {\r\n this._storedRotationQuaternion = this.rotationQuaternion.clone();\r\n }\r\n\r\n return super.storeState();\r\n }\r\n\r\n /**\r\n * Restored camera state. You must call storeState() first\r\n * @returns whether it was successful or not\r\n * @internal\r\n */\r\n public override _restoreStateValues(): boolean {\r\n if (!super._restoreStateValues()) {\r\n return false;\r\n }\r\n\r\n this.position = this._storedPosition.clone();\r\n this.rotation = this._storedRotation.clone();\r\n\r\n if (this.rotationQuaternion && this._storedRotationQuaternion) {\r\n this.rotationQuaternion = this._storedRotationQuaternion.clone();\r\n }\r\n\r\n this.cameraDirection.copyFromFloats(0, 0, 0);\r\n this.cameraRotation.copyFromFloats(0, 0);\r\n\r\n return true;\r\n }\r\n\r\n /** @internal */\r\n public override _initCache() {\r\n super._initCache();\r\n this._cache.lockedTarget = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n this._cache.rotation = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n this._cache.rotationQuaternion = new Quaternion(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _updateCache(ignoreParentClass?: boolean): void {\r\n if (!ignoreParentClass) {\r\n super._updateCache();\r\n }\r\n\r\n const lockedTargetPosition = this._getLockedTargetPosition();\r\n if (!lockedTargetPosition) {\r\n this._cache.lockedTarget = null;\r\n } else {\r\n if (!this._cache.lockedTarget) {\r\n this._cache.lockedTarget = lockedTargetPosition.clone();\r\n } else {\r\n this._cache.lockedTarget.copyFrom(lockedTargetPosition);\r\n }\r\n }\r\n\r\n this._cache.rotation.copyFrom(this.rotation);\r\n if (this.rotationQuaternion) {\r\n this._cache.rotationQuaternion.copyFrom(this.rotationQuaternion);\r\n }\r\n }\r\n\r\n // Synchronized\r\n /** @internal */\r\n public override _isSynchronizedViewMatrix(): boolean {\r\n if (!super._isSynchronizedViewMatrix()) {\r\n return false;\r\n }\r\n\r\n const lockedTargetPosition = this._getLockedTargetPosition();\r\n\r\n return (\r\n (this._cache.lockedTarget ? this._cache.lockedTarget.equals(lockedTargetPosition) : !lockedTargetPosition) &&\r\n (this.rotationQuaternion ? this.rotationQuaternion.equals(this._cache.rotationQuaternion) : this._cache.rotation.equals(this.rotation))\r\n );\r\n }\r\n\r\n // Methods\r\n /** @internal */\r\n public _computeLocalCameraSpeed(): number {\r\n const engine = this.getEngine();\r\n return this.speed * Math.sqrt(engine.getDeltaTime() / (engine.getFps() * 100.0));\r\n }\r\n\r\n // Target\r\n\r\n /**\r\n * Defines the target the camera should look at.\r\n * @param target Defines the new target as a Vector\r\n */\r\n public setTarget(target: Vector3): void {\r\n this.upVector.normalize();\r\n\r\n this._initialFocalDistance = target.subtract(this.position).length();\r\n\r\n if (this.position.z === target.z) {\r\n this.position.z += Epsilon;\r\n }\r\n\r\n this._referencePoint.normalize().scaleInPlace(this._initialFocalDistance);\r\n\r\n if (this.getScene().useRightHandedSystem) {\r\n Matrix.LookAtRHToRef(this.position, target, Vector3.UpReadOnly, TmpMatrix);\r\n } else {\r\n Matrix.LookAtLHToRef(this.position, target, Vector3.UpReadOnly, TmpMatrix);\r\n }\r\n TmpMatrix.invert();\r\n\r\n const rotationQuaternion = this.rotationQuaternion || TmpQuaternion;\r\n Quaternion.FromRotationMatrixToRef(TmpMatrix, rotationQuaternion);\r\n\r\n rotationQuaternion.toEulerAnglesToRef(this.rotation);\r\n\r\n // Explicitly set z to 0 to match previous behavior.\r\n this.rotation.z = 0;\r\n }\r\n\r\n /**\r\n * Defines the target point of the camera.\r\n * The camera looks towards it form the radius distance.\r\n */\r\n public get target(): Vector3 {\r\n return this.getTarget();\r\n }\r\n public set target(value: Vector3) {\r\n this.setTarget(value);\r\n }\r\n\r\n /**\r\n * Return the current target position of the camera. This value is expressed in local space.\r\n * @returns the target position\r\n */\r\n public getTarget(): Vector3 {\r\n return this._currentTarget;\r\n }\r\n\r\n /** @internal */\r\n public _decideIfNeedsToMove(): boolean {\r\n return Math.abs(this.cameraDirection.x) > 0 || Math.abs(this.cameraDirection.y) > 0 || Math.abs(this.cameraDirection.z) > 0;\r\n }\r\n\r\n /** @internal */\r\n public _updatePosition(): void {\r\n if (this.parent) {\r\n this.parent.getWorldMatrix().invertToRef(TmpVectors.Matrix[0]);\r\n Vector3.TransformNormalToRef(this.cameraDirection, TmpVectors.Matrix[0], TmpVectors.Vector3[0]);\r\n this._deferredPositionUpdate.addInPlace(TmpVectors.Vector3[0]);\r\n if (!this._deferOnly) {\r\n this.position.copyFrom(this._deferredPositionUpdate);\r\n } else {\r\n this._deferredUpdated = true;\r\n }\r\n return;\r\n }\r\n this._deferredPositionUpdate.addInPlace(this.cameraDirection);\r\n if (!this._deferOnly) {\r\n this.position.copyFrom(this._deferredPositionUpdate);\r\n } else {\r\n this._deferredUpdated = true;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public override _checkInputs(): void {\r\n // Fold this frame's raw input — written to `cameraDirection`/`cameraRotation` by the input\r\n // classes (and honored from direct external writes) — into the movement system, then let it\r\n // produce framerate-independent per-frame deltas (input plus inertial glide). The applied\r\n // delta is written back into `cameraDirection`/`cameraRotation` purely as a within-frame\r\n // hand-off so the collision, gravity, and rotation-constraint logic below reads it unchanged.\r\n // Both fields are reset to 0 at the end of this method (the inertial glide now lives in the\r\n // movement system's velocity, not in these fields), so external code polling them *after*\r\n // `_checkInputs()` reads 0 rather than the legacy residual glide value.\r\n const movement = this.movement;\r\n // Capture whether there is raw input on the pan channel THIS frame, before it is folded into the\r\n // movement system. This gates the legacy panning cutoff below so it only ends a decaying inertial\r\n // tail and never discards a small but legitimate active-input delta.\r\n const hasPanInput = this.cameraDirection.x !== 0 || this.cameraDirection.y !== 0 || this.cameraDirection.z !== 0;\r\n movement.panAccumulatedPixels.addInPlace(this.cameraDirection);\r\n movement.rotationAccumulatedPixels.x += this.cameraRotation.x;\r\n movement.rotationAccumulatedPixels.y += this.cameraRotation.y;\r\n movement.computeCurrentFrameDeltas();\r\n this.cameraDirection.copyFrom(movement.panDeltaCurrentFrame);\r\n this.cameraRotation.set(movement.rotationDeltaCurrentFrame.x, movement.rotationDeltaCurrentFrame.y);\r\n\r\n // Backward-compat glide cutoff: honor the legacy `_panningEpsilon` knob for translation.\r\n // Legacy `_checkInputs` snapped `cameraDirection` to 0 once the glide fell below the threshold,\r\n // ending the inertial glide at that point. The framerate-independent port moved glide into the\r\n // movement system's velocity, so we mirror that cutoff here and reset the velocity so the glide\r\n // terminates at the same point (and the public knob stays meaningful). This is gated on\r\n // `!hasPanInput` so it only fires on the decaying tail: on an active-input frame the emitted\r\n // delta is always applied, even when it is below the limit. Translation magnitude scales with\r\n // `this.speed` (inputs use `_computeLocalCameraSpeed`), so the panning cutoff is scaled by\r\n // `speed` too, keeping the glide *duration* independent of speed.\r\n const inertialPanningLimit = this.speed * this._panningEpsilon;\r\n if (\r\n !hasPanInput &&\r\n Math.abs(this.cameraDirection.x) < inertialPanningLimit &&\r\n Math.abs(this.cameraDirection.y) < inertialPanningLimit &&\r\n Math.abs(this.cameraDirection.z) < inertialPanningLimit\r\n ) {\r\n this.cameraDirection.setAll(0);\r\n movement.resetPanVelocity();\r\n }\r\n // Rotation has no legacy per-frame-delta cutoff: the movement system already terminates the\r\n // glide via its own framerate-independent velocity epsilon, so `cameraRotation` is naturally 0\r\n // once the rotation velocity decays. Applying a coarse `_rotationEpsilon` snap on top truncated\r\n // the inertia tail and reintroduced framerate dependence (the snap tests a per-frame delta, which\r\n // shrinks at high refresh rates), producing a visible \"cut\" in the glide that was worst at high\r\n // speeds and high frame rates (forum 61001). Deferring entirely to the velocity epsilon gives the\r\n // same smooth ease-out at every `speed` and refresh rate.\r\n\r\n const directionMultiplier = this.invertRotation ? -this.inverseRotationSpeed : 1.0;\r\n const needToMove = this._decideIfNeedsToMove();\r\n const needToRotate = !!(this.cameraRotation.x || this.cameraRotation.y);\r\n\r\n this._deferredUpdated = false;\r\n this._deferredRotationUpdate.copyFrom(this.rotation);\r\n this._deferredPositionUpdate.copyFrom(this.position);\r\n if (this.rotationQuaternion) {\r\n this._deferredRotationQuaternionUpdate.copyFrom(this.rotationQuaternion);\r\n }\r\n\r\n // Move\r\n if (needToMove) {\r\n this._updatePosition();\r\n }\r\n\r\n // Rotate\r\n if (needToRotate) {\r\n //rotate, if quaternion is set and rotation was used\r\n if (this.rotationQuaternion) {\r\n this.rotationQuaternion.toEulerAnglesToRef(this._deferredRotationUpdate);\r\n }\r\n\r\n this._deferredRotationUpdate.x += this.cameraRotation.x * directionMultiplier;\r\n this._deferredRotationUpdate.y += this.cameraRotation.y * directionMultiplier;\r\n\r\n // Apply constraints\r\n if (!this.noRotationConstraint) {\r\n const limit = 1.570796;\r\n\r\n if (this._deferredRotationUpdate.x > limit) {\r\n this._deferredRotationUpdate.x = limit;\r\n }\r\n if (this._deferredRotationUpdate.x < -limit) {\r\n this._deferredRotationUpdate.x = -limit;\r\n }\r\n }\r\n\r\n if (!this._deferOnly) {\r\n this.rotation.copyFrom(this._deferredRotationUpdate);\r\n } else {\r\n this._deferredUpdated = true;\r\n }\r\n\r\n //rotate, if quaternion is set and rotation was used\r\n if (this.rotationQuaternion) {\r\n const len = this._deferredRotationUpdate.lengthSquared();\r\n if (len) {\r\n Quaternion.RotationYawPitchRollToRef(\r\n this._deferredRotationUpdate.y,\r\n this._deferredRotationUpdate.x,\r\n this._deferredRotationUpdate.z,\r\n this._deferredRotationQuaternionUpdate\r\n );\r\n if (!this._deferOnly) {\r\n this.rotationQuaternion.copyFrom(this._deferredRotationQuaternionUpdate);\r\n } else {\r\n this._deferredUpdated = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // The movement system now owns inertial decay (framerate-independent), so reset the\r\n // per-frame delta surfaces. Glide persists inside the movement velocity and is re-emitted\r\n // next frame via `computeCurrentFrameDeltas`; zeroing here prevents the just-applied delta\r\n // from being re-folded into the accumulators on the next frame.\r\n this.cameraDirection.setAll(0);\r\n this.cameraRotation.set(0, 0);\r\n\r\n super._checkInputs();\r\n }\r\n\r\n protected _updateCameraRotationMatrix() {\r\n if (this.rotationQuaternion) {\r\n this.rotationQuaternion.toRotationMatrix(this._cameraRotationMatrix);\r\n } else {\r\n Matrix.RotationYawPitchRollToRef(this.rotation.y, this.rotation.x, this.rotation.z, this._cameraRotationMatrix);\r\n }\r\n }\r\n\r\n /**\r\n * Update the up vector to apply the rotation of the camera (So if you changed the camera rotation.z this will let you update the up vector as well)\r\n * @returns the current camera\r\n */\r\n private _rotateUpVectorWithCameraRotationMatrix(): TargetCamera {\r\n Vector3.TransformNormalToRef(Vector3.UpReadOnly, this._cameraRotationMatrix, this.upVector);\r\n return this;\r\n }\r\n\r\n private _cachedRotationZ = 0;\r\n private _cachedQuaternionRotationZ = 0;\r\n /** @internal */\r\n public override _getViewMatrix(): Matrix {\r\n if (this.lockedTarget) {\r\n this.setTarget(this._getLockedTargetPosition()!);\r\n }\r\n\r\n // Compute\r\n this._updateCameraRotationMatrix();\r\n\r\n // Apply the changed rotation to the upVector\r\n if (this.rotationQuaternion && this._cachedQuaternionRotationZ != this.rotationQuaternion.z) {\r\n this._rotateUpVectorWithCameraRotationMatrix();\r\n this._cachedQuaternionRotationZ = this.rotationQuaternion.z;\r\n } else if (this._cachedRotationZ !== this.rotation.z) {\r\n this._rotateUpVectorWithCameraRotationMatrix();\r\n this._cachedRotationZ = this.rotation.z;\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(this._referencePoint, this._cameraRotationMatrix, this._transformedReferencePoint);\r\n\r\n // Computing target and final matrix\r\n this.position.addToRef(this._transformedReferencePoint, this._currentTarget);\r\n if (this.updateUpVectorFromRotation) {\r\n if (this.rotationQuaternion) {\r\n Axis.Y.rotateByQuaternionToRef(this.rotationQuaternion, this.upVector);\r\n } else {\r\n Quaternion.FromEulerVectorToRef(this.rotation, TmpQuaternion);\r\n Axis.Y.rotateByQuaternionToRef(TmpQuaternion, this.upVector);\r\n }\r\n }\r\n this._computeViewMatrix(this.position, this._currentTarget, this.upVector);\r\n return this._viewMatrix;\r\n }\r\n\r\n protected _computeViewMatrix(position: Vector3, target: Vector3, up: Vector3): void {\r\n if (this.getScene().useRightHandedSystem) {\r\n Matrix.LookAtRHToRef(position, target, up, this._viewMatrix);\r\n } else {\r\n Matrix.LookAtLHToRef(position, target, up, this._viewMatrix);\r\n }\r\n\r\n if (this.parent) {\r\n const parentWorldMatrix = this.parent.getWorldMatrix();\r\n this._viewMatrix.invert();\r\n this._viewMatrix.multiplyToRef(parentWorldMatrix, this._viewMatrix);\r\n this._viewMatrix.invert();\r\n\r\n this._markSyncedWithParent();\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public override createRigCamera(name: string, cameraIndex: number): Nullable<Camera> {\r\n if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\r\n const rigCamera = new TargetCamera(name, this.position.clone(), this.getScene());\r\n rigCamera.isRigCamera = true;\r\n rigCamera.rigParent = this;\r\n if (this.cameraRigMode === Camera.RIG_MODE_VR) {\r\n if (!this.rotationQuaternion) {\r\n this.rotationQuaternion = new Quaternion();\r\n }\r\n rigCamera._cameraRigParams = {};\r\n rigCamera.rotationQuaternion = new Quaternion();\r\n }\r\n\r\n rigCamera.mode = this.mode;\r\n rigCamera.orthoLeft = this.orthoLeft;\r\n rigCamera.orthoRight = this.orthoRight;\r\n rigCamera.orthoTop = this.orthoTop;\r\n rigCamera.orthoBottom = this.orthoBottom;\r\n\r\n return rigCamera;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _updateRigCameras() {\r\n const camLeft = <TargetCamera>this._rigCameras[0];\r\n const camRight = <TargetCamera>this._rigCameras[1];\r\n\r\n this.computeWorldMatrix();\r\n\r\n switch (this.cameraRigMode) {\r\n case Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH:\r\n case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL:\r\n case Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED:\r\n case Camera.RIG_MODE_STEREOSCOPIC_OVERUNDER:\r\n case Camera.RIG_MODE_STEREOSCOPIC_INTERLACED: {\r\n //provisionnaly using _cameraRigParams.stereoHalfAngle instead of calculations based on _cameraRigParams.interaxialDistance:\r\n const leftSign = this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? 1 : -1;\r\n const rightSign = this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED ? -1 : 1;\r\n this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * leftSign, camLeft);\r\n this._getRigCamPositionAndTarget(this._cameraRigParams.stereoHalfAngle * rightSign, camRight);\r\n break;\r\n }\r\n case Camera.RIG_MODE_VR:\r\n if (camLeft.rotationQuaternion && camRight.rotationQuaternion && this.rotationQuaternion) {\r\n camLeft.rotationQuaternion.copyFrom(this.rotationQuaternion);\r\n camRight.rotationQuaternion.copyFrom(this.rotationQuaternion);\r\n } else {\r\n camLeft.rotation.copyFrom(this.rotation);\r\n camRight.rotation.copyFrom(this.rotation);\r\n }\r\n camLeft.position.copyFrom(this.position);\r\n camRight.position.copyFrom(this.position);\r\n\r\n break;\r\n }\r\n super._updateRigCameras();\r\n }\r\n\r\n private _getRigCamPositionAndTarget(halfSpace: number, rigCamera: TargetCamera) {\r\n const target = this.getTarget();\r\n target.subtractToRef(this.position, TargetCamera._TargetFocalPoint);\r\n\r\n TargetCamera._TargetFocalPoint.normalize().scaleInPlace(this._initialFocalDistance);\r\n const newFocalTarget = TargetCamera._TargetFocalPoint.addInPlace(this.position);\r\n\r\n Matrix.TranslationToRef(-newFocalTarget.x, -newFocalTarget.y, -newFocalTarget.z, TargetCamera._TargetTransformMatrix);\r\n TargetCamera._TargetTransformMatrix.multiplyToRef(Matrix.RotationAxis(rigCamera.upVector, halfSpace), TargetCamera._RigCamTransformMatrix);\r\n Matrix.TranslationToRef(newFocalTarget.x, newFocalTarget.y, newFocalTarget.z, TargetCamera._TargetTransformMatrix);\r\n\r\n TargetCamera._RigCamTransformMatrix.multiplyToRef(TargetCamera._TargetTransformMatrix, TargetCamera._RigCamTransformMatrix);\r\n\r\n Vector3.TransformCoordinatesToRef(this.position, TargetCamera._RigCamTransformMatrix, rigCamera.position);\r\n rigCamera.setTarget(newFocalTarget);\r\n }\r\n\r\n /**\r\n * Gets the current object class name.\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return \"TargetCamera\";\r\n }\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for targetCamera.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterTargetCamera(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n Node.AddNodeConstructor(\"TargetCamera\", (name, scene) => {\r\n return () => new TargetCamera(name, Vector3.Zero(), scene);\r\n });\r\n}\r\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ShaderLanguage } from "../Materials/shaderLanguage.js";
|
|
2
2
|
import { ShaderMaterial } from "../Materials/shaderMaterial.pure.js";
|
|
3
3
|
import { type IVector2Like } from "../Maths/math.like.js";
|
|
4
|
+
import { Vector3 } from "../Maths/math.vector.pure.js";
|
|
4
5
|
import { type AbstractMesh } from "../Meshes/abstractMesh.js";
|
|
5
6
|
import { type Nullable } from "../types.js";
|
|
6
7
|
/**
|
|
@@ -15,9 +16,23 @@ export interface IGPUPickingInfo {
|
|
|
15
16
|
* Picked thin instance index
|
|
16
17
|
*/
|
|
17
18
|
thinInstanceIndex?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Picked point in world space.
|
|
21
|
+
*
|
|
22
|
+
* Only available when enableDepthPicking is true and a valid depth value can be read.
|
|
23
|
+
* Custom picking materials or special material plugins that do not write the depth attachment may return undefined.
|
|
24
|
+
*/
|
|
25
|
+
pickedPoint?: Vector3;
|
|
26
|
+
/**
|
|
27
|
+
* Reconstructed normal in world space.
|
|
28
|
+
*
|
|
29
|
+
* Only available when enableDepthPicking is true and enough valid depth neighbors can be read.
|
|
30
|
+
* Custom picking materials or special material plugins that do not write the depth attachment may return undefined.
|
|
31
|
+
*/
|
|
32
|
+
normal?: Vector3;
|
|
18
33
|
}
|
|
19
34
|
/**
|
|
20
|
-
* Stores the result of a multi GPU
|
|
35
|
+
* Stores the result of a multi GPU picking operation
|
|
21
36
|
*/
|
|
22
37
|
export interface IGPUMultiPickingInfo {
|
|
23
38
|
/**
|
|
@@ -28,14 +43,74 @@ export interface IGPUMultiPickingInfo {
|
|
|
28
43
|
* Picked thin instance index
|
|
29
44
|
*/
|
|
30
45
|
thinInstanceIndexes?: number[];
|
|
46
|
+
/**
|
|
47
|
+
* Picked points in world space.
|
|
48
|
+
*
|
|
49
|
+
* Only available when enableDepthPicking is true and a valid depth value can be read.
|
|
50
|
+
* Custom picking materials or special material plugins that do not write the depth attachment may return null.
|
|
51
|
+
*/
|
|
52
|
+
pickedPoints?: Nullable<Vector3>[];
|
|
53
|
+
/**
|
|
54
|
+
* Reconstructed normals in world space.
|
|
55
|
+
*
|
|
56
|
+
* Only available when enableDepthPicking is true and enough valid depth neighbors can be read.
|
|
57
|
+
* Custom picking materials or special material plugins that do not write the depth attachment may return null.
|
|
58
|
+
*/
|
|
59
|
+
normals?: Nullable<Vector3>[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Defines how multi pick texture readbacks should be performed.
|
|
63
|
+
*/
|
|
64
|
+
export declare enum GPUMultiPickReadbackStrategy {
|
|
65
|
+
/**
|
|
66
|
+
* Chooses between a single rectangle readback and small per-point readbacks using the thresholds in IGPUMultiPickOptions.
|
|
67
|
+
*/
|
|
68
|
+
Auto = 0,
|
|
69
|
+
/**
|
|
70
|
+
* Always reads the full bounding rectangle of the picked points. This minimizes readback calls and is best for dense point sets.
|
|
71
|
+
*/
|
|
72
|
+
Rectangle = 1,
|
|
73
|
+
/**
|
|
74
|
+
* Always reads each picked point independently. This minimizes transferred pixels for sparse point sets but can be slower when many points are picked.
|
|
75
|
+
*/
|
|
76
|
+
Individual = 2
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Options used to tune multi GPU picking.
|
|
80
|
+
*/
|
|
81
|
+
export interface IGPUMultiPickOptions {
|
|
82
|
+
/**
|
|
83
|
+
* Defines how multi pick texture readbacks should be performed.
|
|
84
|
+
*
|
|
85
|
+
* Defaults to GPUMultiPickReadbackStrategy.Auto.
|
|
86
|
+
*/
|
|
87
|
+
readbackStrategy?: GPUMultiPickReadbackStrategy;
|
|
88
|
+
/**
|
|
89
|
+
* Maximum number of in-bounds points allowed for the automatic individual readback path.
|
|
90
|
+
* This value is ignored when readbackStrategy is set to GPUMultiPickReadbackStrategy.Rectangle or GPUMultiPickReadbackStrategy.Individual.
|
|
91
|
+
*
|
|
92
|
+
* Defaults to 32.
|
|
93
|
+
*/
|
|
94
|
+
maxIndividualReadbackCount?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Minimum rectangle-area / individual-area ratio required before the automatic path uses individual readbacks.
|
|
97
|
+
* This value is ignored when readbackStrategy is set to GPUMultiPickReadbackStrategy.Rectangle or GPUMultiPickReadbackStrategy.Individual.
|
|
98
|
+
*
|
|
99
|
+
* Defaults to 16.
|
|
100
|
+
*/
|
|
101
|
+
individualReadbackAreaRatio?: number;
|
|
31
102
|
}
|
|
32
103
|
/**
|
|
33
104
|
* Class used to perform a picking operation using GPU
|
|
34
|
-
*
|
|
105
|
+
* GPUPicker can pick meshes, instances and thin instances
|
|
35
106
|
*/
|
|
36
107
|
export declare class GPUPicker {
|
|
37
108
|
private static readonly _AttributeName;
|
|
38
109
|
private static readonly _MaxPickingId;
|
|
110
|
+
private static readonly _DepthPixelRadius;
|
|
111
|
+
private static readonly _MaxMultiPickIndividualReadbackCount;
|
|
112
|
+
private static readonly _MultiPickIndividualReadbackAreaRatio;
|
|
113
|
+
private static readonly _DepthNeighborOffsets;
|
|
39
114
|
private _pickingTexture;
|
|
40
115
|
private readonly _idMap;
|
|
41
116
|
private readonly _thinIdMap;
|
|
@@ -47,10 +122,16 @@ export declare class GPUPicker {
|
|
|
47
122
|
private _pickableMeshes;
|
|
48
123
|
private readonly _meshMaterialMap;
|
|
49
124
|
private _readbuffer;
|
|
125
|
+
private _depthReadbuffer;
|
|
126
|
+
private _depthTextureType;
|
|
127
|
+
private _isDepthTexturePacked;
|
|
128
|
+
private _useDepthPicking;
|
|
129
|
+
private _isUsingDepthPickingRenderTarget;
|
|
50
130
|
private _meshRenderingCount;
|
|
51
131
|
private _renderWarningIssued;
|
|
52
132
|
private _renderPickingTexture;
|
|
53
133
|
private _sceneBeforeRenderObserver;
|
|
134
|
+
private _pickingTextureClearObserver;
|
|
54
135
|
private _pickingTextureAfterRenderObserver;
|
|
55
136
|
private _nextFreeId;
|
|
56
137
|
private readonly _gsPickingMaterials;
|
|
@@ -72,7 +153,22 @@ export declare class GPUPicker {
|
|
|
72
153
|
* index is Material filling mode
|
|
73
154
|
*/
|
|
74
155
|
get defaultRenderMaterials(): readonly Nullable<ShaderMaterial>[];
|
|
156
|
+
/**
|
|
157
|
+
* Gets or sets a boolean indicating if depth-based pickedPoint and normal reconstruction should be enabled.
|
|
158
|
+
*
|
|
159
|
+
* When disabled, GPUPicker uses the original single-color render target and shader path. When enabled, GPUPicker
|
|
160
|
+
* switches to a MultiRenderTarget and compiles the default picking shader with GPUPICKER_DEPTH to output both the
|
|
161
|
+
* picking id and the depth required to reconstruct the picked point and normal.
|
|
162
|
+
*
|
|
163
|
+
* Custom picking materials and special picking material plugins should also write the depth attachment. If they do
|
|
164
|
+
* not, GPUPicker will still try to reconstruct pickedPoint and normal from the depth target, but the returned values
|
|
165
|
+
* may be missing or incorrect.
|
|
166
|
+
*/
|
|
167
|
+
get enableDepthPicking(): boolean;
|
|
168
|
+
set enableDepthPicking(value: boolean);
|
|
75
169
|
private _getColorIdFromReadBuffer;
|
|
170
|
+
private _getReadBufferOffset;
|
|
171
|
+
private _createColorPickingRenderTarget;
|
|
76
172
|
private _createRenderTarget;
|
|
77
173
|
private _clearPickingMaterials;
|
|
78
174
|
private _getPickingMaterial;
|
|
@@ -111,9 +207,10 @@ export declare class GPUPicker {
|
|
|
111
207
|
* Execute a picking operation on multiple coordinates
|
|
112
208
|
* @param xy defines the X,Y coordinates where to run the pick
|
|
113
209
|
* @param disposeWhenDone defines a boolean indicating we do not want to keep resources alive (false by default)
|
|
210
|
+
* @param options defines options used to tune the multi pick readback strategy
|
|
114
211
|
* @returns A promise with the picking results. Always returns an array with the same length as the number of coordinates. The mesh or null at the index where no mesh was picked.
|
|
115
212
|
*/
|
|
116
|
-
multiPickAsync(xy: IVector2Like[], disposeWhenDone?: boolean): Promise<Nullable<IGPUMultiPickingInfo>>;
|
|
213
|
+
multiPickAsync(xy: IVector2Like[], disposeWhenDone?: boolean, options?: IGPUMultiPickOptions): Promise<Nullable<IGPUMultiPickingInfo>>;
|
|
117
214
|
/**
|
|
118
215
|
* Execute a picking operation on box defined by two screen coordinates
|
|
119
216
|
* @param x1 defines the X coordinate of the first corner of the box where to run the pick
|
|
@@ -121,12 +218,16 @@ export declare class GPUPicker {
|
|
|
121
218
|
* @param x2 defines the X coordinate of the opposite corner of the box where to run the pick
|
|
122
219
|
* @param y2 defines the Y coordinate of the opposite corner of the box where to run the pick
|
|
123
220
|
* @param disposeWhenDone defines a boolean indicating we do not want to keep resources alive (false by default)
|
|
124
|
-
* @returns A promise with the picking results.
|
|
221
|
+
* @returns A promise with the picking results. Contains one entry for each picked pixel in the box.
|
|
125
222
|
*/
|
|
126
223
|
boxPickAsync(x1: number, y1: number, x2: number, y2: number, disposeWhenDone?: boolean): Promise<Nullable<IGPUMultiPickingInfo>>;
|
|
127
224
|
private _getRenderInfo;
|
|
128
225
|
private _prepareForPicking;
|
|
226
|
+
private _getPickingRenderRegion;
|
|
227
|
+
private _shouldUseIndividualMultiPickReadback;
|
|
129
228
|
private _preparePickingBuffer;
|
|
229
|
+
private _addPickingTextureToRenderTargets;
|
|
230
|
+
private _removePickingTextureFromRenderTargets;
|
|
130
231
|
private _executePickingAsync;
|
|
131
232
|
private _executeMultiPickingAsync;
|
|
132
233
|
private _executeBoxPickingAsync;
|
|
@@ -149,6 +250,7 @@ export declare class GPUPicker {
|
|
|
149
250
|
*/
|
|
150
251
|
private _waitForPickingMaterialsReadyAsync;
|
|
151
252
|
private _getMeshFromMultiplePoints;
|
|
253
|
+
private _getMeshFromReadBuffer;
|
|
152
254
|
/**
|
|
153
255
|
* Updates the render list with the current pickable meshes.
|
|
154
256
|
*/
|
|
@@ -163,6 +265,11 @@ export declare class GPUPicker {
|
|
|
163
265
|
*/
|
|
164
266
|
private _createGaussianSplattingPickingMaterial;
|
|
165
267
|
private _readTexturePixelsAsync;
|
|
268
|
+
private _readDepthTexturePixelsAsync;
|
|
269
|
+
private _getDepthPickingInfoAsync;
|
|
270
|
+
private _getDepthPickingInfoFromBuffer;
|
|
271
|
+
private _getDepthPointFromBufferToRef;
|
|
272
|
+
private _getDepthFromBuffer;
|
|
166
273
|
/** Release the resources */
|
|
167
274
|
dispose(): void;
|
|
168
275
|
}
|