@babylonjs/core 9.12.0 → 9.12.1
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/Behaviors/Cameras/interpolatingBehavior.d.ts +17 -2
- package/Behaviors/Cameras/interpolatingBehavior.js +53 -23
- package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
- package/Cameras/Inputs/flyCameraKeyboardInput.js +9 -1
- package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
- package/Cameras/Inputs/flyCameraMouseInput.d.ts +2 -0
- package/Cameras/Inputs/flyCameraMouseInput.js +14 -2
- package/Cameras/Inputs/flyCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +25 -5
- package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.d.ts +14 -0
- package/Cameras/Inputs/freeCameraMouseInput.js +26 -4
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraTouchInput.js +16 -5
- package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
- package/Cameras/Inputs/geospatialCameraKeyboardInput.js +8 -1
- package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -1
- package/Cameras/arcRotateCamera.pure.js.map +1 -1
- package/Cameras/flyCamera.pure.d.ts +8 -0
- package/Cameras/flyCamera.pure.js.map +1 -1
- package/Cameras/freeCamera.pure.d.ts +8 -0
- package/Cameras/freeCamera.pure.js.map +1 -1
- package/Cameras/geospatialCamera.pure.d.ts +30 -7
- package/Cameras/geospatialCamera.pure.js +39 -14
- package/Cameras/geospatialCamera.pure.js.map +1 -1
- package/Cameras/geospatialCameraMovement.js +2 -2
- package/Cameras/geospatialCameraMovement.js.map +1 -1
- package/Cameras/index.d.ts +1 -0
- package/Cameras/index.js +1 -0
- package/Cameras/index.js.map +1 -1
- package/Cameras/pure.d.ts +1 -0
- package/Cameras/pure.js +1 -0
- package/Cameras/pure.js.map +1 -1
- package/Cameras/targetCamera.pure.d.ts +25 -0
- package/Cameras/targetCamera.pure.js +83 -25
- package/Cameras/targetCamera.pure.js.map +1 -1
- package/Cameras/targetCameraMovement.d.ts +56 -0
- package/Cameras/targetCameraMovement.js +63 -0
- package/Cameras/targetCameraMovement.js.map +1 -0
- package/Engines/AbstractEngine/abstractEngine.scissor.d.ts +18 -0
- package/Engines/AbstractEngine/abstractEngine.scissor.js +2 -0
- package/Engines/AbstractEngine/abstractEngine.scissor.js.map +1 -0
- package/Engines/abstractEngine.pure.js +2 -2
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.d.ts +1 -0
- package/Engines/engine.js +1 -0
- package/Engines/engine.js.map +1 -1
- package/Engines/engine.pure.d.ts +0 -12
- package/Engines/engine.pure.js +0 -20
- package/Engines/engine.pure.js.map +1 -1
- package/Engines/nullEngine.pure.d.ts +66 -0
- package/Engines/nullEngine.pure.js +93 -0
- package/Engines/nullEngine.pure.js.map +1 -1
- package/Engines/pure.d.ts +1 -0
- package/Engines/pure.js +1 -0
- package/Engines/pure.js.map +1 -1
- package/Engines/thinEngine.scissor.d.ts +6 -0
- package/Engines/thinEngine.scissor.js +9 -0
- package/Engines/thinEngine.scissor.js.map +1 -0
- package/Engines/thinEngine.scissor.pure.d.ts +6 -0
- package/Engines/thinEngine.scissor.pure.js +24 -0
- package/Engines/thinEngine.scissor.pure.js.map +1 -0
- package/Engines/thinNativeEngine.d.ts +0 -1
- package/Engines/thinNativeEngine.js +0 -1
- package/Engines/thinNativeEngine.js.map +1 -1
- package/Engines/thinNativeEngine.pure.js +7 -0
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js +10 -3
- package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +18 -8
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +50 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +199 -104
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.d.ts +37 -0
- package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js +160 -0
- package/Meshes/GaussianSplatting/gaussianSplattingSortWorker.js.map +1 -0
- package/Meshes/geometry.js +30 -15
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.pure.js +26 -14
- package/Meshes/mesh.pure.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Shaders/greasedLine.vertex.js +19 -3
- package/Shaders/greasedLine.vertex.js.map +1 -1
- package/package.json +3 -2
- package/scene.pure.d.ts +12 -0
- package/scene.pure.js +36 -0
- package/scene.pure.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geospatialCamera.pure.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/geospatialCamera.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAE7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAgB,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAInE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE5H,OAAO,EAA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,oDAAoD;IACpD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAEvC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC;IACjB,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,IAAI,WAAW,GAAG,KAAK,CAAC;AACxB;;;GAGG;AACH,MAAM,UAAU,wBAAwB;IACpC,IAAI,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC;AAChE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { GeospatialCameraInputsManager } from \"./geospatialCameraInputsManager\";\r\nimport { Vector3, Matrix, TmpVectors, type Vector2 } from \"../Maths/math.vector.pure\";\r\nimport { Epsilon } from \"../Maths/math.constants\";\r\nimport { Camera } from \"./camera.pure\";\r\nimport { serialize, serializeAsVector3 } from \"../Misc/decorators\";\r\nimport { type Scene } from \"../scene.pure\";\r\nimport { type MeshPredicate } from \"../Culling/ray.core\";\r\nimport { type DeepImmutable } from \"../types\";\r\nimport { GeospatialLimits } from \"./Limits/geospatialLimits\";\r\nimport { ClampCenterFromPolesInPlace, ComputeLocalBasisToRefs, GeospatialCameraMovement } from \"./geospatialCameraMovement\";\r\nimport { type IVector3Like } from \"../Maths/math.like\";\r\nimport { Vector3CopyToRef, Vector3Distance, Vector3Dot, Vector3SubtractToRef } from \"../Maths/math.vector.functions\";\r\nimport { Clamp, NormalizeRadians } from \"../Maths/math.scalar.functions\";\r\nimport { type AllowedAnimValue, InterpolatingBehavior } from \"../Behaviors/Cameras/interpolatingBehavior\";\r\nimport { type Collider } from \"../Collisions/collider\";\r\nimport { type EasingFunction } from \"../Animations/easing\";\r\nimport { type Animation } from \"../Animations/animation.pure\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\nexport type GeospatialCameraOptions = {\r\n /**\r\n * Radius of the planet being orbited\r\n */\r\n planetRadius: number;\r\n /**\r\n * If supplied, will be used by the movement class when picking the globe. Can later update camera.movement.pickPredicate directly\r\n */\r\n pickPredicate?: MeshPredicate;\r\n};\r\n\r\n/**\r\n * Camera equipped to orbit a spherical planet centered at world origin\r\n */\r\nexport class GeospatialCamera extends Camera {\r\n override inputs: GeospatialCameraInputsManager;\r\n\r\n /** Movement controller that provides input mapping and framerate-independent physics for geospatial interactions */\r\n public readonly movement: GeospatialCameraMovement;\r\n\r\n // Temp vars\r\n private _tempPosition: Vector3 = new Vector3();\r\n private _tempCenter: Vector3 = new Vector3();\r\n\r\n private _viewMatrix = new Matrix();\r\n private _isViewMatrixDirty: boolean;\r\n private _lookAtVector: Vector3 = new Vector3();\r\n\r\n /** Behavior used for smooth flying animations */\r\n private _flyingBehavior: InterpolatingBehavior<GeospatialCamera>;\r\n private _flyToTargets: Map<keyof GeospatialCamera, AllowedAnimValue> = new Map();\r\n\r\n // Collision properties\r\n private _collider?: Collider;\r\n private _collisionVelocity: Vector3 = new Vector3();\r\n /** Public option to customize the collision offset applied each frame - vs the one calculated using internal CollisionCoordinator */\r\n public perFrameCollisionOffset: Vector3 = new Vector3();\r\n /** Enable or disable collision checking for this camera. Default is false. */\r\n @serialize()\r\n public checkCollisions: boolean = false;\r\n\r\n constructor(name: string, scene: Scene, options: GeospatialCameraOptions) {\r\n super(name, new Vector3(), scene);\r\n\r\n this._limits = new GeospatialLimits(options.planetRadius);\r\n\r\n this._flyingBehavior = new InterpolatingBehavior();\r\n this.addBehavior(this._flyingBehavior);\r\n\r\n this.movement = new GeospatialCameraMovement(scene, this._limits, this.position, this.center, this._lookAtVector, options.pickPredicate, this._flyingBehavior);\r\n\r\n this._resetToDefault(this._limits);\r\n\r\n this.inputs = new GeospatialCameraInputsManager(this);\r\n this.inputs.addMouse().addMouseWheel().addKeyboard();\r\n }\r\n\r\n @serializeAsVector3()\r\n private _center: Vector3 = new Vector3();\r\n /** The point on the globe that we are anchoring around. If no alternate rotation point is supplied, this will represent the center of screen*/\r\n public get center(): Vector3 {\r\n return this._center;\r\n }\r\n\r\n /**\r\n * Sets the camera position to orbit around a new center point\r\n * @param center The world position (ECEF) to orbit around\r\n */\r\n public set center(center: IVector3Like) {\r\n this._center.copyFromFloats(center.x, center.y, center.z);\r\n this._setOrientation(this._yaw, this._pitch, this._radius, this._center);\r\n }\r\n\r\n @serialize()\r\n private _yaw: number = 0;\r\n /**\r\n * Gets the camera's yaw (rotation around the geocentric normal) in radians\r\n */\r\n public get yaw(): number {\r\n return this._yaw;\r\n }\r\n\r\n /**\r\n * Sets the camera's yaw (rotation around the geocentric normal). Will wrap value to [-π, π)\r\n * @param yaw The desired yaw angle in radians (0 = north, π/2 = east)\r\n */\r\n public set yaw(yaw: number) {\r\n yaw !== this._yaw && this._setOrientation(yaw, this.pitch, this.radius, this.center);\r\n }\r\n\r\n @serialize()\r\n private _pitch: number = 0;\r\n\r\n /**\r\n * Gets the camera's pitch (angle from looking straight at globe)\r\n * Pitch is measured from looking straight down at planet center:\r\n * - zero pitch = looking straight at planet center (down)\r\n * - positive pitch = tilting up away from planet\r\n * - π/2 pitch = looking at horizon (perpendicular to geocentric normal)\r\n */\r\n public get pitch(): number {\r\n return this._pitch;\r\n }\r\n\r\n /**\r\n * Sets the camera's pitch (angle from looking straight at globe). Will wrap value to [-π, π)\r\n * @param pitch The desired pitch angle in radians (0 = looking at planet center, π/2 = looking at horizon)\r\n */\r\n public set pitch(pitch: number) {\r\n pitch !== this._pitch && this._setOrientation(this.yaw, pitch, this.radius, this.center);\r\n }\r\n\r\n @serialize()\r\n private _radius: number = 0;\r\n /**\r\n * Gets the camera's distance from the current center point. This is distinct from planetRadius supplied at construction.\r\n */\r\n public get radius(): number {\r\n return this._radius;\r\n }\r\n\r\n /**\r\n * Sets the camera's distance from the current center point\r\n * @param radius The desired radius\r\n */\r\n public set radius(radius: number) {\r\n radius !== this._radius && this._setOrientation(this.yaw, this.pitch, radius, this.center);\r\n }\r\n\r\n protected _checkLimits() {\r\n const limits = this.limits;\r\n this._yaw = Clamp(this._yaw, limits.yawMin, limits.yawMax);\r\n const effectivePitchMax = limits.getEffectivePitchMax(this._radius);\r\n this._pitch = Clamp(this._pitch, limits.pitchMin, effectivePitchMax);\r\n this._radius = Clamp(this._radius, limits.radiusMin, limits.radiusMax);\r\n ClampCenterFromPolesInPlace(this._center);\r\n }\r\n\r\n private _tempVect = new Vector3();\r\n private _tempEast = new Vector3();\r\n private _tempNorth = new Vector3();\r\n private _tempUp = new Vector3();\r\n\r\n private _setOrientation(yaw: number, pitch: number, radius: number, center: DeepImmutable<IVector3Like>): void {\r\n // Wrap yaw and pitch to [-π, π)\r\n this._yaw = NormalizeRadians(yaw);\r\n this._pitch = NormalizeRadians(pitch);\r\n this._radius = radius;\r\n\r\n Vector3CopyToRef(center, this._center);\r\n\r\n // Clamp to limits\r\n this._checkLimits();\r\n\r\n // Refresh local basis at center (treat these as read-only for the whole call)\r\n ComputeLocalBasisToRefs(this._center, this._tempEast, this._tempNorth, this._tempUp, this._scene.useRightHandedSystem, this.movement.calculateUpVectorFromPointToRef);\r\n\r\n // Compute lookAt from yaw/pitch\r\n ComputeLookAtFromYawPitchToRef(this._yaw, this._pitch, this._center, this._scene.useRightHandedSystem, this._lookAtVector, this.movement.calculateUpVectorFromPointToRef);\r\n\r\n // Build an orthonormal up aligned with geocentric Up\r\n // When looking straight down (pitch ≈ 0), lookAt is parallel to Up, so use the horizontal direction as the camera's up.\r\n const right = TmpVectors.Vector3[10];\r\n Vector3.CrossToRef(this._tempUp, this._lookAtVector, right);\r\n if (right.lengthSquared() < Epsilon) {\r\n // horiz = north * cos(yaw) + east * sin(yaw)\r\n // Using tempEast directly ensures handedness is taken into account\r\n const horiz = TmpVectors.Vector3[11];\r\n const t1 = TmpVectors.Vector3[12];\r\n horiz\r\n .copyFrom(this._tempNorth)\r\n .scaleInPlace(Math.cos(this._yaw))\r\n .addInPlace(t1.copyFrom(this._tempEast).scaleInPlace(Math.sin(this._yaw)));\r\n // right = cross(horiz, lookAt)\r\n Vector3.CrossToRef(horiz, this._lookAtVector, right);\r\n }\r\n right.normalize();\r\n\r\n // up = normalize(cross(look, right))\r\n Vector3.CrossToRef(this._lookAtVector, right, this.upVector);\r\n this.upVector.normalize();\r\n\r\n // Position = center - look * radius (preserve unit look)\r\n this._tempVect.copyFrom(this._lookAtVector).scaleInPlace(-this._radius);\r\n this._tempPosition.copyFrom(this._center).addInPlace(this._tempVect);\r\n\r\n // Recalculate collisionOffset to be applied later when viewMatrix is calculated (allowing camera users to modify the value in afterCheckInputsObservable)\r\n if (this.checkCollisions) {\r\n this.perFrameCollisionOffset = this._getCollisionOffset(this._tempPosition);\r\n }\r\n\r\n this._position.copyFrom(this._tempPosition);\r\n\r\n this._isViewMatrixDirty = true;\r\n }\r\n\r\n /**\r\n * If camera is actively in flight, will update the target properties and use up the remaining duration from original flyTo call\r\n *\r\n * To start a new flyTo curve entirely, call into flyToAsync again (it will stop the inflight animation)\r\n * @param targetYaw - Target yaw in radians, or undefined to keep the current yaw.\r\n * @param targetPitch - Target pitch in radians, or undefined to keep the current pitch.\r\n * @param targetRadius - Target radius (distance from the look-at center), or undefined to keep the current radius.\r\n * @param targetCenter - Target look-at center in scene coordinates, or undefined to keep the current center.\r\n */\r\n public updateFlyToDestination(targetYaw?: number, targetPitch?: number, targetRadius?: number, targetCenter?: Vector3): void {\r\n this._flyToTargets.clear();\r\n\r\n // For yaw, use shortest path to target.\r\n const deltaYaw = targetYaw !== undefined ? NormalizeRadians(NormalizeRadians(targetYaw) - this._yaw) : 0;\r\n this._flyToTargets.set(\"yaw\", deltaYaw === 0 ? undefined : this._yaw + deltaYaw);\r\n this._flyToTargets.set(\"pitch\", targetPitch != undefined ? NormalizeRadians(targetPitch) : undefined);\r\n this._flyToTargets.set(\"radius\", targetRadius);\r\n this._flyToTargets.set(\"center\", targetCenter?.clone());\r\n\r\n this._flyingBehavior.updateProperties(this._flyToTargets);\r\n }\r\n\r\n /**\r\n * Animate camera towards passed in property values. If undefined, will use current value\r\n * @param targetYaw - Target yaw in radians, or undefined to keep the current yaw.\r\n * @param targetPitch - Target pitch in radians, or undefined to keep the current pitch.\r\n * @param targetRadius - Target radius (distance from the look-at center), or undefined to keep the current radius.\r\n * @param targetCenter - Target look-at center in scene coordinates, or undefined to keep the current center.\r\n * @param flightDurationMs - Total duration of the animation in milliseconds. Defaults to 1000ms.\r\n * @param easingFunction - Optional easing function applied to the animation curve.\r\n * @param centerHopScale If supplied, will define the parabolic hop height scale for center animation to create a \"bounce\" effect\r\n * @returns Promise that will return when the animation is complete (or interuppted by pointer input)\r\n */\r\n public async flyToAsync(\r\n targetYaw?: number,\r\n targetPitch?: number,\r\n targetRadius?: number,\r\n targetCenter?: Vector3,\r\n flightDurationMs: number = 1000,\r\n easingFunction?: EasingFunction,\r\n centerHopScale?: number\r\n ): Promise<void> {\r\n this._flyToTargets.clear();\r\n\r\n // For yaw, use shortest path to target.\r\n const deltaYaw = targetYaw !== undefined ? NormalizeRadians(NormalizeRadians(targetYaw) - this._yaw) : 0;\r\n this._flyToTargets.set(\"yaw\", deltaYaw === 0 ? undefined : this._yaw + deltaYaw);\r\n this._flyToTargets.set(\"pitch\", targetPitch !== undefined ? NormalizeRadians(targetPitch) : undefined);\r\n this._flyToTargets.set(\"radius\", targetRadius);\r\n this._flyToTargets.set(\"center\", targetCenter?.clone());\r\n\r\n let overrideAnimationFunction;\r\n if (targetCenter !== undefined && !targetCenter.equals(this.center)) {\r\n // Animate center directly with custom interpolation\r\n overrideAnimationFunction = (key: string, animation: Animation): void => {\r\n if (key === \"center\") {\r\n // Override the Vector3 interpolation to use SLERP + hop\r\n animation.vector3InterpolateFunction = (startValue, endValue, gradient) => {\r\n // gradient is the eased value (0 to 1) after easing function is applied\r\n\r\n // Slerp between start and end\r\n const newCenter = Vector3.SlerpToRef(startValue, endValue, gradient, this._tempCenter);\r\n\r\n // Apply parabolic hop if requested\r\n if (centerHopScale && centerHopScale > 0) {\r\n // Parabolic formula: peaks at t=0.5, returns to 0 at gradient=0 and gradient=1\r\n // if hopPeakT = .5 the denominator would be hopPeakT * hopPeakT - hopPeakT, which = -.25\r\n const hopPeakOffset = centerHopScale * Vector3Distance(startValue, endValue);\r\n const hopOffset = hopPeakOffset * Clamp((gradient * gradient - gradient) / -0.25);\r\n // Scale the center outward (away from origin)\r\n newCenter.scaleInPlace(1 + hopOffset / newCenter.length());\r\n }\r\n\r\n return newCenter;\r\n };\r\n }\r\n };\r\n }\r\n\r\n return await this._flyingBehavior.animatePropertiesAsync(this._flyToTargets, flightDurationMs, easingFunction, overrideAnimationFunction);\r\n }\r\n\r\n /**\r\n * Helper function to move camera towards a given point by `distanceScale` of the current camera-to-destination distance (by default 50%).\r\n * @param destination point to move towards\r\n * @param distanceScale value between 0 and 1, % of distance to move\r\n * @param durationMs duration of flight, default 1s\r\n * @param easingFn optional easing function for flight interpolation of properties\r\n * @param centerHopScale If supplied, will define the parabolic hop height scale for center animation to create a \"bounce\" effect\r\n */\r\n public async flyToPointAsync(destination: Vector3, distanceScale: number = 0.5, durationMs: number = 1000, easingFn?: EasingFunction, centerHopScale?: number) {\r\n // Move by a fraction of the camera-to-destination distance\r\n const zoomDistance = Vector3Distance(this.position, destination) * distanceScale;\r\n const newRadius = this._getCenterAndRadiusFromZoomToPoint(destination, zoomDistance, this._tempCenter);\r\n await this.flyToAsync(undefined, undefined, newRadius, this._tempCenter, durationMs, easingFn, centerHopScale);\r\n !this.isDisposed() && this._recalculateCenter(false, true /** force */);\r\n }\r\n\r\n private _limits: GeospatialLimits;\r\n /**\r\n * Gets the limits for this camera\r\n */\r\n public get limits(): GeospatialLimits {\r\n return this._limits;\r\n }\r\n\r\n private _resetToDefault(limits: GeospatialLimits): void {\r\n // Camera configuration vars\r\n const restingAltitude = limits.radiusMax !== Infinity ? limits.radiusMax : limits.planetRadius * 4;\r\n this.position.copyFromFloats(restingAltitude, 0, 0);\r\n this._center.copyFromFloats(limits.planetRadius, 0, 0);\r\n this._radius = Vector3.Distance(this.position, this.center);\r\n\r\n // Temp vars\r\n this._tempPosition = new Vector3();\r\n\r\n // View matrix calculation vars\r\n this._viewMatrix = Matrix.Identity();\r\n this._center.subtractToRef(this._position, this._lookAtVector).normalize(); // Lookat vector of the camera\r\n this.upVector = Vector3.Up(); // Up vector of the camera (does work for -X look at)\r\n this._isViewMatrixDirty = true;\r\n\r\n this._setOrientation(this._yaw, this._pitch, this._radius, this._center);\r\n }\r\n\r\n /** @internal */\r\n override _getViewMatrix() {\r\n if (!this._isViewMatrixDirty) {\r\n return this._viewMatrix;\r\n }\r\n this._isViewMatrixDirty = false;\r\n\r\n // Ensure vectors are normalized\r\n this.upVector.normalize();\r\n this._lookAtVector.normalize();\r\n\r\n // Apply the same offset to both position and center to preserve orbital relationship\r\n // This keeps yaw/pitch/radius intact - just lifts the whole \"rig\"\r\n this._position.addInPlace(this.perFrameCollisionOffset);\r\n this._center.addInPlace(this.perFrameCollisionOffset);\r\n\r\n // Calculate view matrix with camera position and center\r\n if (this.getScene().useRightHandedSystem) {\r\n Matrix.LookAtRHToRef(this.position, this._center, this.upVector, this._viewMatrix);\r\n } else {\r\n Matrix.LookAtLHToRef(this.position, this._center, this.upVector, this._viewMatrix);\r\n }\r\n\r\n return this._viewMatrix;\r\n }\r\n\r\n /** @internal */\r\n override _isSynchronizedViewMatrix(): boolean {\r\n if (!super._isSynchronizedViewMatrix() || this._isViewMatrixDirty) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n private _applyGeocentricTranslation() {\r\n // Store pending position (without any corrections applied)\r\n this.center.addToRef(this.movement.panDeltaCurrentFrame, this._tempPosition);\r\n\r\n if (!this.movement.isInterpolating) {\r\n // Calculate the position correction to keep camera at the same radius when applying translation\r\n this._tempPosition.normalize().scaleInPlace(this.center.length());\r\n }\r\n // Set center which will call _setOrientation\r\n this.center = this._tempPosition;\r\n }\r\n\r\n /**\r\n * This rotation keeps the camera oriented towards the globe as it orbits around it. This is different from cameraCentricRotation which is when the camera rotates around its own axis\r\n */\r\n private _applyGeocentricRotation(): void {\r\n const rotationDeltaCurrentFrame = this.movement.rotationDeltaCurrentFrame;\r\n if (rotationDeltaCurrentFrame.x !== 0 || rotationDeltaCurrentFrame.y !== 0) {\r\n const pitch = rotationDeltaCurrentFrame.x !== 0 ? Clamp(this._pitch + rotationDeltaCurrentFrame.x, 0, 0.5 * Math.PI - Epsilon) : this._pitch;\r\n const yaw = rotationDeltaCurrentFrame.y !== 0 ? this._yaw + rotationDeltaCurrentFrame.y : this._yaw;\r\n\r\n this._setOrientation(yaw, pitch, this._radius, this._center);\r\n }\r\n }\r\n\r\n private _getCenterAndRadiusFromZoomToPoint(targetPoint: DeepImmutable<IVector3Like>, distance: number, newCenterResult: Vector3): number {\r\n const directionToTarget = Vector3SubtractToRef(targetPoint, this._position, TmpVectors.Vector3[0]);\r\n const distanceToTarget = directionToTarget.length();\r\n\r\n // Don't zoom past the min radius limit.\r\n if (distanceToTarget < this.limits.radiusMin) {\r\n newCenterResult.copyFrom(this._center);\r\n const requestedRadius = this._radius - distance;\r\n const newRadius = Clamp(requestedRadius, this.limits.radiusMin, this.limits.radiusMax);\r\n return newRadius;\r\n }\r\n\r\n // Move the camera position towards targetPoint by distanceToTarget\r\n directionToTarget.scaleInPlace(distance / distanceToTarget);\r\n const newPosition = this._position.addToRef(directionToTarget, TmpVectors.Vector3[1]);\r\n\r\n // Project the movement onto the look vector to derive the new center/radius.\r\n const projectedDistance = Vector3Dot(directionToTarget, this._lookAtVector);\r\n const newRadius = this._radius - projectedDistance;\r\n const newRadiusClamped = Clamp(newRadius, this.limits.radiusMin, this.limits.radiusMax);\r\n newCenterResult.copyFrom(newPosition).addInPlace(this._lookAtVector.scale(newRadiusClamped));\r\n\r\n return newRadiusClamped;\r\n }\r\n\r\n /**\r\n * Apply zoom by moving the camera toward/away from a target point.\r\n */\r\n private _applyZoom() {\r\n let zoomDelta = this.movement.zoomDeltaCurrentFrame;\r\n const pickedPoint = this.movement.computedPerFrameZoomPickPoint;\r\n\r\n // Clamp zoom delta to limits before applying\r\n zoomDelta = this._clampZoomDelta(zoomDelta, pickedPoint);\r\n\r\n if (Math.abs(zoomDelta) < Epsilon) {\r\n return;\r\n }\r\n if (pickedPoint) {\r\n // Zoom toward the picked point under cursor\r\n this.zoomToPoint(pickedPoint, zoomDelta);\r\n } else {\r\n // Zoom along lookAt vector (fallback when no surface under cursor)\r\n this.zoomAlongLookAt(zoomDelta);\r\n }\r\n }\r\n\r\n private _clampZoomDelta(zoomDelta: number, pickedPoint?: Vector3): number {\r\n if (Math.abs(zoomDelta) < Epsilon) {\r\n return 0;\r\n }\r\n\r\n const distanceToTarget = pickedPoint ? Vector3Distance(this._position, pickedPoint) : undefined;\r\n return this.limits.clampZoomDistance(zoomDelta, this._radius, distanceToTarget);\r\n }\r\n\r\n /**\r\n * Zoom towards a specific point on the globe\r\n * @param targetPoint The point to zoom towards\r\n * @param distance The distance to move\r\n */\r\n public zoomToPoint(targetPoint: DeepImmutable<IVector3Like>, distance: number) {\r\n const newRadius = this._getCenterAndRadiusFromZoomToPoint(targetPoint, distance, this._tempCenter);\r\n // Apply the new orientation\r\n this._setOrientation(this._yaw, this._pitch, newRadius, this._tempCenter);\r\n }\r\n\r\n /**\r\n * Zoom along the camera's lookAt direction\r\n * @param distance The distance to zoom\r\n */\r\n public zoomAlongLookAt(distance: number) {\r\n // Clamp radius to limits\r\n const requestedRadius = this._radius - distance;\r\n const newRadius = Clamp(requestedRadius, this.limits.radiusMin, this.limits.radiusMax);\r\n\r\n // Simply change radius without moving center\r\n this._setOrientation(this._yaw, this._pitch, newRadius, this._center);\r\n }\r\n\r\n /** @internal */\r\n override _checkInputs(): void {\r\n this.inputs.checkInputs();\r\n this.perFrameCollisionOffset.setAll(0);\r\n\r\n // Let movement class handle all per-frame logic\r\n this.movement.computeCurrentFrameDeltas();\r\n\r\n let isCenterMoving = false;\r\n if (this.movement.panDeltaCurrentFrame.lengthSquared() > 0) {\r\n this._applyGeocentricTranslation();\r\n // After a drag, recalculate the center point to ensure it's still on the surface.\r\n isCenterMoving = true;\r\n }\r\n if (this.movement.rotationDeltaCurrentFrame.lengthSquared() > 0) {\r\n this._applyGeocentricRotation();\r\n }\r\n\r\n if (Math.abs(this.movement.zoomDeltaCurrentFrame) > Epsilon) {\r\n this._applyZoom();\r\n isCenterMoving = true;\r\n }\r\n\r\n // After a movement impacting center or radius, recalculate the center point to ensure it's still on the surface.\r\n this._recalculateCenter(isCenterMoving);\r\n\r\n super._checkInputs();\r\n }\r\n\r\n private _wasCenterMovingLastFrame = false;\r\n\r\n private _recalculateCenter(isCenterMoving: boolean, forceRecalculate: boolean = false): void {\r\n const shouldRecalculateCenterAfterMove = this._wasCenterMovingLastFrame && !isCenterMoving;\r\n this._wasCenterMovingLastFrame = isCenterMoving;\r\n\r\n // Wait until movement impacting center is complete to avoid wasted raycasting\r\n if (shouldRecalculateCenterAfterMove || forceRecalculate) {\r\n const newCenter = this.movement.pickAlongVector(this._lookAtVector);\r\n if (newCenter?.pickedPoint) {\r\n // Direction from new center to origin\r\n const centerToOrigin = TmpVectors.Vector3[4];\r\n centerToOrigin.copyFrom(newCenter.pickedPoint).negateInPlace().normalize();\r\n\r\n // Check if this direction aligns with camera's lookAt vector\r\n const dotProduct = Vector3Dot(this._lookAtVector, centerToOrigin);\r\n\r\n // Only update if the center is looking toward the origin (dot product > 0) to avoid a center on the opposite side of globe\r\n if (dotProduct > 0) {\r\n // Compute the new radius as distance from camera position to new center\r\n const newRadius = Vector3Distance(this._position, newCenter.pickedPoint);\r\n\r\n // Only update if the new center is in front of the camera\r\n if (newRadius > Epsilon) {\r\n // Compute yaw/pitch that correspond to current lookAt at new center\r\n const yawPitch = TmpVectors.Vector2[0];\r\n ComputeYawPitchFromLookAtToRef(\r\n this._lookAtVector,\r\n newCenter.pickedPoint,\r\n this._scene.useRightHandedSystem,\r\n this._yaw,\r\n yawPitch,\r\n this.movement.calculateUpVectorFromPointToRef\r\n );\r\n\r\n // Call _setOrientation with the computed yaw/pitch and new center\r\n this._setOrientation(yawPitch.x, yawPitch.y, newRadius, newCenter.pickedPoint);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Allows extended classes to override how collision offset is calculated\r\n * @param newPosition\r\n * @returns\r\n */\r\n protected _getCollisionOffset(newPosition: Vector3): Vector3 {\r\n const collisionOffset = TmpVectors.Vector3[6].setAll(0);\r\n if (!this.checkCollisions || !this._scene.collisionsEnabled) {\r\n return collisionOffset;\r\n }\r\n\r\n const coordinator = this.getScene().collisionCoordinator;\r\n if (!coordinator) {\r\n return collisionOffset;\r\n }\r\n\r\n if (!this._collider) {\r\n this._collider = coordinator.createCollider();\r\n }\r\n this._collider._radius.setAll(this.limits.radiusMin);\r\n\r\n // Calculate velocity from old position to new position\r\n newPosition.subtractToRef(this._position, this._collisionVelocity);\r\n\r\n // Get the collision-adjusted position\r\n const adjustedPosition = coordinator.getNewPosition(this._position, this._collisionVelocity, this._collider, 3, null, () => {}, this.uniqueId);\r\n\r\n // Calculate the collision offset (how much the position was pushed)\r\n adjustedPosition.subtractToRef(newPosition, collisionOffset);\r\n\r\n return collisionOffset;\r\n }\r\n\r\n /** @internal */\r\n override attachControl(noPreventDefault?: boolean): void {\r\n this.inputs.attachElement(noPreventDefault);\r\n }\r\n\r\n /** @internal */\r\n override detachControl(): void {\r\n this.inputs.detachElement();\r\n }\r\n\r\n /**\r\n * Gets the class name of the camera.\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return \"GeospatialCamera\";\r\n }\r\n}\r\n\r\n// Register Class Name\r\n\r\n/**\r\n * Compute the lookAt direction vector from yaw and pitch angles at a given center point.\r\n * This is the forward formula used by GeospatialCamera._setOrientation.\r\n * @param yaw - The yaw angle in radians (0 = north, π/2 = east)\r\n * @param pitch - The pitch angle in radians (0 = looking at planet center, π/2 = looking at horizon)\r\n * @param center - The center point on the globe\r\n * @param useRightHandedSystem - Whether the scene uses a right-handed coordinate system\r\n * @param result - The vector to store the result in\r\n * @param calculateUpVectorFromPointToRef - Optional function to calculate the up vector from a point, allowing for non-spherical planets. If not supplied, a perfect sphere is assumed and the up vector is just the normalized center point.\r\n * @returns The normalized lookAt direction vector (same as result)\r\n */\r\nexport function ComputeLookAtFromYawPitchToRef(\r\n yaw: number,\r\n pitch: number,\r\n center: Vector3,\r\n useRightHandedSystem: boolean,\r\n result: Vector3,\r\n calculateUpVectorFromPointToRef?: (point: Vector3, result: Vector3) => Vector3\r\n): Vector3 {\r\n const east = TmpVectors.Vector3[0];\r\n const north = TmpVectors.Vector3[1];\r\n const up = TmpVectors.Vector3[2];\r\n ComputeLocalBasisToRefs(center, east, north, up, useRightHandedSystem, calculateUpVectorFromPointToRef);\r\n const sinPitch = Math.sin(pitch);\r\n const cosPitch = Math.cos(pitch);\r\n\r\n // horiz = north * cos(yaw) + east * sin(yaw)\r\n // Handedness is taken into account when defining east vector via ComputeLocalBasisToRefs.\r\n const horiz = TmpVectors.Vector3[3];\r\n const t1 = TmpVectors.Vector3[4];\r\n horiz\r\n .copyFrom(north)\r\n .scaleInPlace(Math.cos(yaw))\r\n .addInPlace(t1.copyFrom(east).scaleInPlace(Math.sin(yaw)));\r\n\r\n // lookAt = horiz * sinPitch - up * cosPitch\r\n const t2 = TmpVectors.Vector3[5];\r\n result.copyFrom(horiz).scaleInPlace(sinPitch).addInPlace(t2.copyFrom(up).scaleInPlace(-cosPitch));\r\n return result.normalize();\r\n}\r\n\r\n/**\r\n * Given a lookAt direction and center, compute the yaw and pitch angles that would produce that lookAt.\r\n * This is the inverse of ComputeLookAtFromYawPitchToRef.\r\n * @param lookAt - The normalized lookAt direction vector\r\n * @param center - The center point on the globe\r\n * @param useRightHandedSystem - Whether the scene uses a right-handed coordinate system\r\n * @param currentYaw - The current yaw value to use as fallback when pitch is near 0 (looking straight down/up)\r\n * @param result - The Vector2 to store the result in (x = yaw, y = pitch)\r\n * @param calculateUpVectorFromPointToRef - Optional function to calculate the up vector from a point. If supplied, this function will be used instead of assuming a spherical geocentric normal, allowing support for non-spherical planets or custom up vector logic.\r\n * @returns The result Vector2\r\n */\r\nexport function ComputeYawPitchFromLookAtToRef(\r\n lookAt: Vector3,\r\n center: Vector3,\r\n useRightHandedSystem: boolean,\r\n currentYaw: number,\r\n result: Vector2,\r\n calculateUpVectorFromPointToRef?: (point: Vector3, result: Vector3) => Vector3\r\n): Vector2 {\r\n // Compute local basis at center\r\n const east = TmpVectors.Vector3[6];\r\n const north = TmpVectors.Vector3[7];\r\n const up = TmpVectors.Vector3[8];\r\n ComputeLocalBasisToRefs(center, east, north, up, useRightHandedSystem, calculateUpVectorFromPointToRef);\r\n\r\n // lookAt = horiz*sinPitch - up*cosPitch\r\n // where horiz = north*cos(yaw) + east*sin(yaw)\r\n //\r\n // The vertical component of lookAt (along up) gives us cosPitch:\r\n // lookAt · up = -cosPitch\r\n const lookDotUp = Vector3Dot(lookAt, up);\r\n const cosPitch = -lookDotUp;\r\n\r\n // Clamp cosPitch to valid range to avoid NaN from acos\r\n const clampedCosPitch = Clamp(cosPitch, -1, 1);\r\n const pitch = Math.acos(clampedCosPitch);\r\n\r\n // The horizontal component gives us yaw\r\n // lookHorizontal = lookAt + up*cosPitch = horiz*sinPitch\r\n const lookHorizontal = TmpVectors.Vector3[9];\r\n const scaledUp = TmpVectors.Vector3[10];\r\n scaledUp.copyFrom(up).scaleInPlace(cosPitch);\r\n lookHorizontal.copyFrom(lookAt).addInPlace(scaledUp);\r\n\r\n const sinPitch = Math.sin(pitch);\r\n if (Math.abs(sinPitch) < Epsilon) {\r\n // Looking straight down or up, yaw is undefined - keep current\r\n result.x = currentYaw;\r\n result.y = pitch;\r\n return result;\r\n }\r\n\r\n // horiz = lookHorizontal / sinPitch\r\n const horiz = lookHorizontal.scaleInPlace(1 / sinPitch);\r\n\r\n // From the forward formula: horiz = North*cos(yaw) + East*sin(yaw)\r\n // So: cosYaw = horiz · north, sinYaw = horiz · east\r\n const cosYaw = Vector3Dot(horiz, north);\r\n const sinYaw = Vector3Dot(horiz, east);\r\n\r\n result.x = Math.atan2(sinYaw, cosYaw);\r\n result.y = pitch;\r\n return result;\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for geospatialCamera.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterGeospatialCamera(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.GeospatialCamera\", GeospatialCamera);\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"geospatialCamera.pure.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/geospatialCamera.pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;;AAE7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAgB,MAAM,2BAA2B,CAAC;AACtF,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAInE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE5H,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACrH,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAyB,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAI1G,OA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I,WAAW,EAAE,CAAC;QACd,OAAO;IACX,CAAC;IACD,WAAW,GAAG,IAAI,CAAC;IAEnB,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC;AAChE,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { GeospatialCameraInputsManager } from \"./geospatialCameraInputsManager\";\r\nimport { Vector3, Matrix, TmpVectors, type Vector2 } from \"../Maths/math.vector.pure\";\r\nimport { Epsilon } from \"../Maths/math.constants\";\r\nimport { Camera } from \"./camera.pure\";\r\nimport { serialize, serializeAsVector3 } from \"../Misc/decorators\";\r\nimport { type Scene } from \"../scene.pure\";\r\nimport { type MeshPredicate } from \"../Culling/ray.core\";\r\nimport { type DeepImmutable } from \"../types\";\r\nimport { GeospatialLimits } from \"./Limits/geospatialLimits\";\r\nimport { ClampCenterFromPolesInPlace, ComputeLocalBasisToRefs, GeospatialCameraMovement } from \"./geospatialCameraMovement\";\r\nimport { type IVector3Like } from \"../Maths/math.like\";\r\nimport { Vector3CopyToRef, Vector3Distance, Vector3Dot, Vector3SubtractToRef } from \"../Maths/math.vector.functions\";\r\nimport { Clamp, NormalizeRadians } from \"../Maths/math.scalar.functions\";\r\nimport { type AllowedAnimValue, InterpolatingBehavior } from \"../Behaviors/Cameras/interpolatingBehavior\";\r\nimport { type Collider } from \"../Collisions/collider\";\r\nimport { type EasingFunction } from \"../Animations/easing\";\r\nimport { type Animation } from \"../Animations/animation.pure\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\nexport type GeospatialCameraOptions = {\r\n /**\r\n * Radius of the planet being orbited\r\n */\r\n planetRadius: number;\r\n /**\r\n * If supplied, will be used by the movement class when picking the globe. Can later update camera.movement.pickPredicate directly\r\n */\r\n pickPredicate?: MeshPredicate;\r\n};\r\n\r\n/**\r\n * Camera equipped to orbit a spherical planet centered at world origin\r\n */\r\nexport class GeospatialCamera extends Camera {\r\n override inputs: GeospatialCameraInputsManager;\r\n\r\n /** Movement controller that provides input mapping and framerate-independent physics for geospatial interactions */\r\n public readonly movement: GeospatialCameraMovement;\r\n\r\n // Temp vars\r\n private _tempPosition: Vector3 = new Vector3();\r\n private _tempCenter: Vector3 = new Vector3();\r\n\r\n private _viewMatrix = new Matrix();\r\n private _isViewMatrixDirty: boolean;\r\n private _lookAtVector: Vector3 = new Vector3();\r\n\r\n /** Behavior used for smooth flying animations */\r\n private _flyingBehavior: InterpolatingBehavior<GeospatialCamera>;\r\n private _flyToTargets: Map<keyof GeospatialCamera, AllowedAnimValue> = new Map();\r\n\r\n // Collision properties\r\n private _collider?: Collider;\r\n private _collisionVelocity: Vector3 = new Vector3();\r\n /** Public option to customize the collision offset applied each frame - vs the one calculated using internal CollisionCoordinator */\r\n public perFrameCollisionOffset: Vector3 = new Vector3();\r\n /** Enable or disable collision checking for this camera. Default is false. */\r\n @serialize()\r\n public checkCollisions: boolean = false;\r\n\r\n constructor(name: string, scene: Scene, options: GeospatialCameraOptions) {\r\n super(name, new Vector3(), scene);\r\n\r\n this._limits = new GeospatialLimits(options.planetRadius);\r\n\r\n this._flyingBehavior = new InterpolatingBehavior();\r\n this.addBehavior(this._flyingBehavior);\r\n\r\n this.movement = new GeospatialCameraMovement(scene, this._limits, this.position, this.center, this._lookAtVector, options.pickPredicate, this._flyingBehavior);\r\n\r\n this._resetToDefault(this._limits);\r\n\r\n this.inputs = new GeospatialCameraInputsManager(this);\r\n this.inputs.addMouse().addMouseWheel().addKeyboard();\r\n }\r\n\r\n @serializeAsVector3()\r\n private _center: Vector3 = new Vector3();\r\n /** The point on the globe that we are anchoring around. If no alternate rotation point is supplied, this will represent the center of screen*/\r\n public get center(): Vector3 {\r\n return this._center;\r\n }\r\n\r\n /**\r\n * Sets the camera position to orbit around a new center point\r\n * @param center The world position (ECEF) to orbit around\r\n */\r\n public set center(center: IVector3Like) {\r\n this._center.copyFromFloats(center.x, center.y, center.z);\r\n this._setOrientation(this._yaw, this._pitch, this._radius, this._center);\r\n }\r\n\r\n @serialize()\r\n private _yaw: number = 0;\r\n /**\r\n * Gets the camera's yaw (rotation around the geocentric normal) in radians\r\n */\r\n public get yaw(): number {\r\n return this._yaw;\r\n }\r\n\r\n /**\r\n * Sets the camera's yaw (rotation around the geocentric normal). Will wrap value to [-π, π)\r\n * @param yaw The desired yaw angle in radians (0 = north, π/2 = east)\r\n */\r\n public set yaw(yaw: number) {\r\n yaw !== this._yaw && this._setOrientation(yaw, this.pitch, this.radius, this.center);\r\n }\r\n\r\n @serialize()\r\n private _pitch: number = 0;\r\n\r\n /**\r\n * Gets the camera's pitch (angle from looking straight at globe)\r\n * Pitch is measured from looking straight down at planet center:\r\n * - zero pitch = looking straight at planet center (down)\r\n * - positive pitch = tilting up away from planet\r\n * - π/2 pitch = looking at horizon (perpendicular to geocentric normal)\r\n */\r\n public get pitch(): number {\r\n return this._pitch;\r\n }\r\n\r\n /**\r\n * Sets the camera's pitch (angle from looking straight at globe). Will wrap value to [-π, π)\r\n * @param pitch The desired pitch angle in radians (0 = looking at planet center, π/2 = looking at horizon)\r\n */\r\n public set pitch(pitch: number) {\r\n pitch !== this._pitch && this._setOrientation(this.yaw, pitch, this.radius, this.center);\r\n }\r\n\r\n @serialize()\r\n private _radius: number = 0;\r\n /**\r\n * Gets the camera's distance from the current center point. This is distinct from planetRadius supplied at construction.\r\n */\r\n public get radius(): number {\r\n return this._radius;\r\n }\r\n\r\n /**\r\n * Sets the camera's distance from the current center point\r\n * @param radius The desired radius\r\n */\r\n public set radius(radius: number) {\r\n radius !== this._radius && this._setOrientation(this.yaw, this.pitch, radius, this.center);\r\n }\r\n\r\n protected _checkLimits() {\r\n const limits = this.limits;\r\n this._yaw = Clamp(this._yaw, limits.yawMin, limits.yawMax);\r\n const effectivePitchMax = limits.getEffectivePitchMax(this._radius);\r\n this._pitch = Clamp(this._pitch, limits.pitchMin, effectivePitchMax);\r\n this._radius = Clamp(this._radius, limits.radiusMin, limits.radiusMax);\r\n ClampCenterFromPolesInPlace(this._center);\r\n }\r\n\r\n private _tempVect = new Vector3();\r\n private _tempEast = new Vector3();\r\n private _tempNorth = new Vector3();\r\n private _tempUp = new Vector3();\r\n\r\n private _setOrientation(yaw: number, pitch: number, radius: number, center: DeepImmutable<IVector3Like>): void {\r\n // Wrap yaw and pitch to [-π, π)\r\n this._yaw = NormalizeRadians(yaw);\r\n this._pitch = NormalizeRadians(pitch);\r\n this._radius = radius;\r\n\r\n Vector3CopyToRef(center, this._center);\r\n\r\n // Clamp to limits\r\n this._checkLimits();\r\n\r\n // Refresh local basis at center (treat these as read-only for the whole call)\r\n ComputeLocalBasisToRefs(this._center, this._tempEast, this._tempNorth, this._tempUp, this._scene.useRightHandedSystem, this.movement.calculateUpVectorFromPointToRef);\r\n\r\n // Compute lookAt from yaw/pitch\r\n ComputeLookAtFromYawPitchToRef(this._yaw, this._pitch, this._center, this._scene.useRightHandedSystem, this._lookAtVector, this.movement.calculateUpVectorFromPointToRef);\r\n\r\n // Build an orthonormal up aligned with geocentric Up\r\n // When looking straight down (pitch ≈ 0), lookAt is parallel to Up, so use the horizontal direction as the camera's up.\r\n const right = TmpVectors.Vector3[10];\r\n Vector3.CrossToRef(this._tempUp, this._lookAtVector, right);\r\n if (right.lengthSquared() < Epsilon) {\r\n // horiz = north * cos(yaw) + east * sin(yaw)\r\n // Using tempEast directly ensures handedness is taken into account\r\n const horiz = TmpVectors.Vector3[11];\r\n const t1 = TmpVectors.Vector3[12];\r\n horiz\r\n .copyFrom(this._tempNorth)\r\n .scaleInPlace(Math.cos(this._yaw))\r\n .addInPlace(t1.copyFrom(this._tempEast).scaleInPlace(Math.sin(this._yaw)));\r\n // right = cross(horiz, lookAt)\r\n Vector3.CrossToRef(horiz, this._lookAtVector, right);\r\n }\r\n right.normalize();\r\n\r\n // up = normalize(cross(look, right))\r\n Vector3.CrossToRef(this._lookAtVector, right, this.upVector);\r\n this.upVector.normalize();\r\n\r\n // Position = center - look * radius (preserve unit look)\r\n this._tempVect.copyFrom(this._lookAtVector).scaleInPlace(-this._radius);\r\n this._tempPosition.copyFrom(this._center).addInPlace(this._tempVect);\r\n\r\n // Recalculate collisionOffset to be applied later when viewMatrix is calculated (allowing camera users to modify the value in afterCheckInputsObservable)\r\n if (this.checkCollisions) {\r\n this.perFrameCollisionOffset = this._getCollisionOffset(this._tempPosition);\r\n }\r\n\r\n this._position.copyFrom(this._tempPosition);\r\n\r\n this._isViewMatrixDirty = true;\r\n }\r\n\r\n /**\r\n * If the camera is actively in flight, redirects it toward a new destination, using up the remaining\r\n * duration from the original flyToAsync call. The redirect starts from the camera's current pose, so it\r\n * stays smooth (no snap). If the camera is not currently in flight this is a no-op; start a new flight\r\n * with flyToAsync instead.\r\n *\r\n * Note: redirecting interrupts the in-flight animation, so the promise returned by the original\r\n * flyToAsync call resolves early. Await the promise returned here to be notified when the redirected\r\n * flight actually completes.\r\n *\r\n * Any property left undefined is frozen at its current value (matching flyToAsync), it does not continue\r\n * toward the original flight's destination for that property.\r\n * @param targetYaw - Target yaw in radians, or undefined to freeze yaw at its current value.\r\n * @param targetPitch - Target pitch in radians, or undefined to freeze pitch at its current value.\r\n * @param targetRadius - Target radius (distance from the look-at center), or undefined to freeze radius at its current value.\r\n * @param targetCenter - Target look-at center in scene coordinates, or undefined to freeze the center at its current value.\r\n * @returns Promise that resolves when the redirected flight completes (or is interrupted), or undefined if the camera was not in flight.\r\n */\r\n public updateFlyToDestination(targetYaw?: number, targetPitch?: number, targetRadius?: number, targetCenter?: Vector3): Promise<void> | undefined {\r\n if (!this._flyingBehavior.isInterpolating) {\r\n // Nothing in flight to redirect. Callers should use flyToAsync to start a new flight.\r\n return undefined;\r\n }\r\n\r\n // Redirecting is just a fresh flight that starts from the camera's current pose and uses up the\r\n // time left in the original flight. flyToAsync already eases from the current values, so this stays\r\n // smooth (no snap).\r\n return this._flyToAsync(targetYaw, targetPitch, targetRadius, targetCenter, this._flyingBehavior.remainingDurationMs);\r\n }\r\n\r\n /**\r\n * Animate camera towards passed in property values. If undefined, will use current value\r\n * @param targetYaw - Target yaw in radians, or undefined to keep the current yaw.\r\n * @param targetPitch - Target pitch in radians, or undefined to keep the current pitch.\r\n * @param targetRadius - Target radius (distance from the look-at center), or undefined to keep the current radius.\r\n * @param targetCenter - Target look-at center in scene coordinates, or undefined to keep the current center.\r\n * @param flightDurationMs - Total duration of the animation in milliseconds. Defaults to 1000ms.\r\n * @param easingFunction - Optional easing function applied to the animation curve.\r\n * @param centerHopScale If supplied, will define the parabolic hop height scale for center animation to create a \"bounce\" effect\r\n * @returns Promise that will return when the animation is complete (or interuppted by pointer input)\r\n */\r\n public async flyToAsync(\r\n targetYaw?: number,\r\n targetPitch?: number,\r\n targetRadius?: number,\r\n targetCenter?: Vector3,\r\n flightDurationMs: number = 1000,\r\n easingFunction?: EasingFunction,\r\n centerHopScale?: number\r\n ): Promise<void> {\r\n return await this._flyToAsync(targetYaw, targetPitch, targetRadius, targetCenter, flightDurationMs, easingFunction, centerHopScale);\r\n }\r\n\r\n /**\r\n * Shared flight implementation used by both flyToAsync (new flight) and updateFlyToDestination (redirect).\r\n * Builds the target property map (and the center SLERP/hop interpolation) and animates from the camera's\r\n * current pose over the given duration.\r\n * @param targetYaw - Target yaw in radians, or undefined to keep the current yaw.\r\n * @param targetPitch - Target pitch in radians, or undefined to keep the current pitch.\r\n * @param targetRadius - Target radius (distance from the look-at center), or undefined to keep the current radius.\r\n * @param targetCenter - Target look-at center in scene coordinates, or undefined to keep the current center.\r\n * @param flightDurationMs - Total duration of the animation in milliseconds. Defaults to 1000ms.\r\n * @param easingFunction - Optional easing function applied to the animation curve.\r\n * @param centerHopScale - If supplied, defines the parabolic hop height scale for the center animation to create a \"bounce\" effect.\r\n * @returns Promise that resolves when the animation is complete (or interrupted).\r\n */\r\n private async _flyToAsync(\r\n targetYaw?: number,\r\n targetPitch?: number,\r\n targetRadius?: number,\r\n targetCenter?: Vector3,\r\n flightDurationMs: number = 1000,\r\n easingFunction?: EasingFunction,\r\n centerHopScale?: number\r\n ): Promise<void> {\r\n this._flyToTargets.clear();\r\n\r\n // For yaw, use shortest path to target.\r\n const deltaYaw = targetYaw !== undefined ? NormalizeRadians(NormalizeRadians(targetYaw) - this._yaw) : 0;\r\n this._flyToTargets.set(\"yaw\", deltaYaw === 0 ? undefined : this._yaw + deltaYaw);\r\n this._flyToTargets.set(\"pitch\", targetPitch !== undefined ? NormalizeRadians(targetPitch) : undefined);\r\n this._flyToTargets.set(\"radius\", targetRadius);\r\n this._flyToTargets.set(\"center\", targetCenter?.clone());\r\n\r\n let overrideAnimationFunction;\r\n if (targetCenter !== undefined && !targetCenter.equals(this.center)) {\r\n // Animate center directly with custom interpolation\r\n overrideAnimationFunction = (key: string, animation: Animation): void => {\r\n if (key === \"center\") {\r\n // Override the Vector3 interpolation to use SLERP + hop\r\n animation.vector3InterpolateFunction = (startValue, endValue, gradient) => {\r\n // gradient is the eased value (0 to 1) after easing function is applied\r\n\r\n // Slerp between start and end\r\n const newCenter = Vector3.SlerpToRef(startValue, endValue, gradient, this._tempCenter);\r\n\r\n // Apply parabolic hop if requested\r\n if (centerHopScale && centerHopScale > 0) {\r\n // Parabolic formula: peaks at t=0.5, returns to 0 at gradient=0 and gradient=1\r\n // if hopPeakT = .5 the denominator would be hopPeakT * hopPeakT - hopPeakT, which = -.25\r\n const hopPeakOffset = centerHopScale * Vector3Distance(startValue, endValue);\r\n const hopOffset = hopPeakOffset * Clamp((gradient * gradient - gradient) / -0.25);\r\n // Scale the center outward (away from origin)\r\n newCenter.scaleInPlace(1 + hopOffset / newCenter.length());\r\n }\r\n\r\n return newCenter;\r\n };\r\n }\r\n };\r\n }\r\n\r\n return await this._flyingBehavior.animatePropertiesAsync(this._flyToTargets, flightDurationMs, easingFunction, overrideAnimationFunction);\r\n }\r\n\r\n /**\r\n * Helper function to move camera towards a given point by `distanceScale` of the current camera-to-destination distance (by default 50%).\r\n * @param destination point to move towards\r\n * @param distanceScale value between 0 and 1, % of distance to move\r\n * @param durationMs duration of flight, default 1s\r\n * @param easingFn optional easing function for flight interpolation of properties\r\n * @param centerHopScale If supplied, will define the parabolic hop height scale for center animation to create a \"bounce\" effect\r\n */\r\n public async flyToPointAsync(destination: Vector3, distanceScale: number = 0.5, durationMs: number = 1000, easingFn?: EasingFunction, centerHopScale?: number) {\r\n // Move by a fraction of the camera-to-destination distance\r\n const zoomDistance = Vector3Distance(this.position, destination) * distanceScale;\r\n const newRadius = this._getCenterAndRadiusFromZoomToPoint(destination, zoomDistance, this._tempCenter);\r\n await this.flyToAsync(undefined, undefined, newRadius, this._tempCenter, durationMs, easingFn, centerHopScale);\r\n !this.isDisposed() && this._recalculateCenter(false, true /** force */);\r\n }\r\n\r\n private _limits: GeospatialLimits;\r\n /**\r\n * Gets the limits for this camera\r\n */\r\n public get limits(): GeospatialLimits {\r\n return this._limits;\r\n }\r\n\r\n private _resetToDefault(limits: GeospatialLimits): void {\r\n // Camera configuration vars\r\n const restingAltitude = limits.radiusMax !== Infinity ? limits.radiusMax : limits.planetRadius * 4;\r\n this.position.copyFromFloats(restingAltitude, 0, 0);\r\n this._center.copyFromFloats(limits.planetRadius, 0, 0);\r\n this._radius = Vector3.Distance(this.position, this.center);\r\n\r\n // Temp vars\r\n this._tempPosition = new Vector3();\r\n\r\n // View matrix calculation vars\r\n this._viewMatrix = Matrix.Identity();\r\n this._center.subtractToRef(this._position, this._lookAtVector).normalize(); // Lookat vector of the camera\r\n this.upVector = Vector3.Up(); // Up vector of the camera (does work for -X look at)\r\n this._isViewMatrixDirty = true;\r\n\r\n this._setOrientation(this._yaw, this._pitch, this._radius, this._center);\r\n }\r\n\r\n /** @internal */\r\n override _getViewMatrix() {\r\n if (!this._isViewMatrixDirty) {\r\n return this._viewMatrix;\r\n }\r\n this._isViewMatrixDirty = false;\r\n\r\n // Ensure vectors are normalized\r\n this.upVector.normalize();\r\n this._lookAtVector.normalize();\r\n\r\n // Apply the same offset to both position and center to preserve orbital relationship\r\n // This keeps yaw/pitch/radius intact - just lifts the whole \"rig\"\r\n this._position.addInPlace(this.perFrameCollisionOffset);\r\n this._center.addInPlace(this.perFrameCollisionOffset);\r\n\r\n // Calculate view matrix with camera position and center\r\n if (this.getScene().useRightHandedSystem) {\r\n Matrix.LookAtRHToRef(this.position, this._center, this.upVector, this._viewMatrix);\r\n } else {\r\n Matrix.LookAtLHToRef(this.position, this._center, this.upVector, this._viewMatrix);\r\n }\r\n\r\n return this._viewMatrix;\r\n }\r\n\r\n /** @internal */\r\n override _isSynchronizedViewMatrix(): boolean {\r\n if (!super._isSynchronizedViewMatrix() || this._isViewMatrixDirty) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n private _applyGeocentricTranslation() {\r\n // Store pending position (without any corrections applied)\r\n this.center.addToRef(this.movement.panDeltaCurrentFrame, this._tempPosition);\r\n\r\n if (!this.movement.isInterpolating) {\r\n // Calculate the position correction to keep camera at the same radius when applying translation\r\n this._tempPosition.normalize().scaleInPlace(this.center.length());\r\n }\r\n // Set center which will call _setOrientation\r\n this.center = this._tempPosition;\r\n }\r\n\r\n /**\r\n * This rotation keeps the camera oriented towards the globe as it orbits around it. This is different from cameraCentricRotation which is when the camera rotates around its own axis\r\n */\r\n private _applyGeocentricRotation(): void {\r\n const rotationDeltaCurrentFrame = this.movement.rotationDeltaCurrentFrame;\r\n if (rotationDeltaCurrentFrame.x !== 0 || rotationDeltaCurrentFrame.y !== 0) {\r\n const pitch = rotationDeltaCurrentFrame.x !== 0 ? Clamp(this._pitch + rotationDeltaCurrentFrame.x, 0, 0.5 * Math.PI - Epsilon) : this._pitch;\r\n const yaw = rotationDeltaCurrentFrame.y !== 0 ? this._yaw + rotationDeltaCurrentFrame.y : this._yaw;\r\n\r\n this._setOrientation(yaw, pitch, this._radius, this._center);\r\n }\r\n }\r\n\r\n private _getCenterAndRadiusFromZoomToPoint(targetPoint: DeepImmutable<IVector3Like>, distance: number, newCenterResult: Vector3): number {\r\n const directionToTarget = Vector3SubtractToRef(targetPoint, this._position, TmpVectors.Vector3[0]);\r\n const distanceToTarget = directionToTarget.length();\r\n\r\n // Don't zoom past the min radius limit.\r\n if (distanceToTarget < this.limits.radiusMin) {\r\n newCenterResult.copyFrom(this._center);\r\n const requestedRadius = this._radius - distance;\r\n const newRadius = Clamp(requestedRadius, this.limits.radiusMin, this.limits.radiusMax);\r\n return newRadius;\r\n }\r\n\r\n // Move the camera position towards targetPoint by distanceToTarget\r\n directionToTarget.scaleInPlace(distance / distanceToTarget);\r\n const newPosition = this._position.addToRef(directionToTarget, TmpVectors.Vector3[1]);\r\n\r\n // Project the movement onto the look vector to derive the new center/radius.\r\n const projectedDistance = Vector3Dot(directionToTarget, this._lookAtVector);\r\n const newRadius = this._radius - projectedDistance;\r\n const newRadiusClamped = Clamp(newRadius, this.limits.radiusMin, this.limits.radiusMax);\r\n newCenterResult.copyFrom(newPosition).addInPlace(this._lookAtVector.scale(newRadiusClamped));\r\n\r\n return newRadiusClamped;\r\n }\r\n\r\n /**\r\n * Apply zoom by moving the camera toward/away from a target point.\r\n */\r\n private _applyZoom() {\r\n let zoomDelta = this.movement.zoomDeltaCurrentFrame;\r\n const pickedPoint = this.movement.computedPerFrameZoomPickPoint;\r\n\r\n // Clamp zoom delta to limits before applying\r\n zoomDelta = this._clampZoomDelta(zoomDelta, pickedPoint);\r\n\r\n if (Math.abs(zoomDelta) < Epsilon) {\r\n return;\r\n }\r\n if (pickedPoint) {\r\n // Zoom toward the picked point under cursor\r\n this.zoomToPoint(pickedPoint, zoomDelta);\r\n } else {\r\n // Zoom along lookAt vector (fallback when no surface under cursor)\r\n this.zoomAlongLookAt(zoomDelta);\r\n }\r\n }\r\n\r\n private _clampZoomDelta(zoomDelta: number, pickedPoint?: Vector3): number {\r\n if (Math.abs(zoomDelta) < Epsilon) {\r\n return 0;\r\n }\r\n\r\n const distanceToTarget = pickedPoint ? Vector3Distance(this._position, pickedPoint) : undefined;\r\n return this.limits.clampZoomDistance(zoomDelta, this._radius, distanceToTarget);\r\n }\r\n\r\n /**\r\n * Zoom towards a specific point on the globe\r\n * @param targetPoint The point to zoom towards\r\n * @param distance The distance to move\r\n */\r\n public zoomToPoint(targetPoint: DeepImmutable<IVector3Like>, distance: number) {\r\n const newRadius = this._getCenterAndRadiusFromZoomToPoint(targetPoint, distance, this._tempCenter);\r\n // Apply the new orientation\r\n this._setOrientation(this._yaw, this._pitch, newRadius, this._tempCenter);\r\n }\r\n\r\n /**\r\n * Zoom along the camera's lookAt direction\r\n * @param distance The distance to zoom\r\n */\r\n public zoomAlongLookAt(distance: number) {\r\n // Clamp radius to limits\r\n const requestedRadius = this._radius - distance;\r\n const newRadius = Clamp(requestedRadius, this.limits.radiusMin, this.limits.radiusMax);\r\n\r\n // Simply change radius without moving center\r\n this._setOrientation(this._yaw, this._pitch, newRadius, this._center);\r\n }\r\n\r\n /** @internal */\r\n override _checkInputs(): void {\r\n this.inputs.checkInputs();\r\n this.perFrameCollisionOffset.setAll(0);\r\n\r\n // Let movement class handle all per-frame logic\r\n this.movement.computeCurrentFrameDeltas();\r\n\r\n let isCenterMoving = false;\r\n if (this.movement.panDeltaCurrentFrame.lengthSquared() > 0) {\r\n this._applyGeocentricTranslation();\r\n // After a drag, recalculate the center point to ensure it's still on the surface.\r\n isCenterMoving = true;\r\n }\r\n if (this.movement.rotationDeltaCurrentFrame.lengthSquared() > 0) {\r\n this._applyGeocentricRotation();\r\n }\r\n\r\n if (Math.abs(this.movement.zoomDeltaCurrentFrame) > Epsilon) {\r\n this._applyZoom();\r\n isCenterMoving = true;\r\n }\r\n\r\n // After a movement impacting center or radius, recalculate the center point to ensure it's still on the surface.\r\n this._recalculateCenter(isCenterMoving);\r\n\r\n super._checkInputs();\r\n }\r\n\r\n private _wasCenterMovingLastFrame = false;\r\n\r\n private _recalculateCenter(isCenterMoving: boolean, forceRecalculate: boolean = false): void {\r\n const shouldRecalculateCenterAfterMove = this._wasCenterMovingLastFrame && !isCenterMoving;\r\n this._wasCenterMovingLastFrame = isCenterMoving;\r\n\r\n // Wait until movement impacting center is complete to avoid wasted raycasting\r\n if (shouldRecalculateCenterAfterMove || forceRecalculate) {\r\n const newCenter = this.movement.pickAlongVector(this._lookAtVector);\r\n if (newCenter?.pickedPoint) {\r\n // Direction from new center to origin\r\n const centerToOrigin = TmpVectors.Vector3[4];\r\n centerToOrigin.copyFrom(newCenter.pickedPoint).negateInPlace().normalize();\r\n\r\n // Check if this direction aligns with camera's lookAt vector\r\n const dotProduct = Vector3Dot(this._lookAtVector, centerToOrigin);\r\n\r\n // Only update if the center is looking toward the origin (dot product > 0) to avoid a center on the opposite side of globe\r\n if (dotProduct > 0) {\r\n // Compute the new radius as distance from camera position to new center\r\n const newRadius = Vector3Distance(this._position, newCenter.pickedPoint);\r\n\r\n // Only update if the new center is in front of the camera\r\n if (newRadius > Epsilon) {\r\n // Compute yaw/pitch that correspond to current lookAt at new center\r\n const yawPitch = TmpVectors.Vector2[0];\r\n ComputeYawPitchFromLookAtToRef(\r\n this._lookAtVector,\r\n newCenter.pickedPoint,\r\n this._scene.useRightHandedSystem,\r\n this._yaw,\r\n yawPitch,\r\n this.movement.calculateUpVectorFromPointToRef\r\n );\r\n\r\n // Call _setOrientation with the computed yaw/pitch and new center\r\n this._setOrientation(yawPitch.x, yawPitch.y, newRadius, newCenter.pickedPoint);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Allows extended classes to override how collision offset is calculated\r\n * @param newPosition\r\n * @returns\r\n */\r\n protected _getCollisionOffset(newPosition: Vector3): Vector3 {\r\n const collisionOffset = TmpVectors.Vector3[6].setAll(0);\r\n if (!this.checkCollisions || !this._scene.collisionsEnabled) {\r\n return collisionOffset;\r\n }\r\n\r\n const coordinator = this.getScene().collisionCoordinator;\r\n if (!coordinator) {\r\n return collisionOffset;\r\n }\r\n\r\n if (!this._collider) {\r\n this._collider = coordinator.createCollider();\r\n }\r\n this._collider._radius.setAll(this.limits.radiusMin);\r\n\r\n // Calculate velocity from old position to new position\r\n newPosition.subtractToRef(this._position, this._collisionVelocity);\r\n\r\n // Get the collision-adjusted position\r\n const adjustedPosition = coordinator.getNewPosition(this._position, this._collisionVelocity, this._collider, 3, null, () => {}, this.uniqueId);\r\n\r\n // Calculate the collision offset (how much the position was pushed)\r\n adjustedPosition.subtractToRef(newPosition, collisionOffset);\r\n\r\n return collisionOffset;\r\n }\r\n\r\n /** @internal */\r\n override attachControl(noPreventDefault?: boolean): void {\r\n this.inputs.attachElement(noPreventDefault);\r\n }\r\n\r\n /** @internal */\r\n override detachControl(): void {\r\n this.inputs.detachElement();\r\n }\r\n\r\n /**\r\n * Gets the class name of the camera.\r\n * @returns the class name\r\n */\r\n public override getClassName(): string {\r\n return \"GeospatialCamera\";\r\n }\r\n}\r\n\r\n// Register Class Name\r\n\r\n/**\r\n * Compute the lookAt direction vector from yaw and pitch angles at a given center point.\r\n * This is the forward formula used by GeospatialCamera._setOrientation.\r\n * @param yaw - The yaw angle in radians (0 = north, π/2 = east)\r\n * @param pitch - The pitch angle in radians (0 = looking at planet center, π/2 = looking at horizon)\r\n * @param center - The center point on the globe\r\n * @param useRightHandedSystem - Whether the scene uses a right-handed coordinate system\r\n * @param result - The vector to store the result in\r\n * @param calculateUpVectorFromPointToRef - Optional function to calculate the up vector from a point, allowing for non-spherical planets. If not supplied, a perfect sphere is assumed and the up vector is just the normalized center point.\r\n * @returns The normalized lookAt direction vector (same as result)\r\n */\r\nexport function ComputeLookAtFromYawPitchToRef(\r\n yaw: number,\r\n pitch: number,\r\n center: Vector3,\r\n useRightHandedSystem: boolean,\r\n result: Vector3,\r\n calculateUpVectorFromPointToRef?: (point: Vector3, result: Vector3) => Vector3\r\n): Vector3 {\r\n const east = TmpVectors.Vector3[0];\r\n const north = TmpVectors.Vector3[1];\r\n const up = TmpVectors.Vector3[2];\r\n ComputeLocalBasisToRefs(center, east, north, up, useRightHandedSystem, calculateUpVectorFromPointToRef);\r\n const sinPitch = Math.sin(pitch);\r\n const cosPitch = Math.cos(pitch);\r\n\r\n // horiz = north * cos(yaw) + east * sin(yaw)\r\n // Handedness is taken into account when defining east vector via ComputeLocalBasisToRefs.\r\n const horiz = TmpVectors.Vector3[3];\r\n const t1 = TmpVectors.Vector3[4];\r\n horiz\r\n .copyFrom(north)\r\n .scaleInPlace(Math.cos(yaw))\r\n .addInPlace(t1.copyFrom(east).scaleInPlace(Math.sin(yaw)));\r\n\r\n // lookAt = horiz * sinPitch - up * cosPitch\r\n const t2 = TmpVectors.Vector3[5];\r\n result.copyFrom(horiz).scaleInPlace(sinPitch).addInPlace(t2.copyFrom(up).scaleInPlace(-cosPitch));\r\n return result.normalize();\r\n}\r\n\r\n/**\r\n * Given a lookAt direction and center, compute the yaw and pitch angles that would produce that lookAt.\r\n * This is the inverse of ComputeLookAtFromYawPitchToRef.\r\n * @param lookAt - The normalized lookAt direction vector\r\n * @param center - The center point on the globe\r\n * @param useRightHandedSystem - Whether the scene uses a right-handed coordinate system\r\n * @param currentYaw - The current yaw value to use as fallback when pitch is near 0 (looking straight down/up)\r\n * @param result - The Vector2 to store the result in (x = yaw, y = pitch)\r\n * @param calculateUpVectorFromPointToRef - Optional function to calculate the up vector from a point. If supplied, this function will be used instead of assuming a spherical geocentric normal, allowing support for non-spherical planets or custom up vector logic.\r\n * @returns The result Vector2\r\n */\r\nexport function ComputeYawPitchFromLookAtToRef(\r\n lookAt: Vector3,\r\n center: Vector3,\r\n useRightHandedSystem: boolean,\r\n currentYaw: number,\r\n result: Vector2,\r\n calculateUpVectorFromPointToRef?: (point: Vector3, result: Vector3) => Vector3\r\n): Vector2 {\r\n // Compute local basis at center\r\n const east = TmpVectors.Vector3[6];\r\n const north = TmpVectors.Vector3[7];\r\n const up = TmpVectors.Vector3[8];\r\n ComputeLocalBasisToRefs(center, east, north, up, useRightHandedSystem, calculateUpVectorFromPointToRef);\r\n\r\n // lookAt = horiz*sinPitch - up*cosPitch\r\n // where horiz = north*cos(yaw) + east*sin(yaw)\r\n //\r\n // The vertical component of lookAt (along up) gives us cosPitch:\r\n // lookAt · up = -cosPitch\r\n const lookDotUp = Vector3Dot(lookAt, up);\r\n const cosPitch = -lookDotUp;\r\n\r\n // Clamp cosPitch to valid range to avoid NaN from acos\r\n const clampedCosPitch = Clamp(cosPitch, -1, 1);\r\n const pitch = Math.acos(clampedCosPitch);\r\n\r\n // The horizontal component gives us yaw\r\n // lookHorizontal = lookAt + up*cosPitch = horiz*sinPitch\r\n const lookHorizontal = TmpVectors.Vector3[9];\r\n const scaledUp = TmpVectors.Vector3[10];\r\n scaledUp.copyFrom(up).scaleInPlace(cosPitch);\r\n lookHorizontal.copyFrom(lookAt).addInPlace(scaledUp);\r\n\r\n const sinPitch = Math.sin(pitch);\r\n if (Math.abs(sinPitch) < Epsilon) {\r\n // Looking straight down or up, yaw is undefined - keep current\r\n result.x = currentYaw;\r\n result.y = pitch;\r\n return result;\r\n }\r\n\r\n // horiz = lookHorizontal / sinPitch\r\n const horiz = lookHorizontal.scaleInPlace(1 / sinPitch);\r\n\r\n // From the forward formula: horiz = North*cos(yaw) + East*sin(yaw)\r\n // So: cosYaw = horiz · north, sinYaw = horiz · east\r\n const cosYaw = Vector3Dot(horiz, north);\r\n const sinYaw = Vector3Dot(horiz, east);\r\n\r\n result.x = Math.atan2(sinYaw, cosYaw);\r\n result.y = pitch;\r\n return result;\r\n}\r\n\r\nlet _Registered = false;\r\n/**\r\n * Register side effects for geospatialCamera.\r\n * Safe to call multiple times; only the first call has an effect.\r\n */\r\nexport function RegisterGeospatialCamera(): void {\r\n if (_Registered) {\r\n return;\r\n }\r\n _Registered = true;\r\n\r\n RegisterClass(\"BABYLON.GeospatialCamera\", GeospatialCamera);\r\n}\r\n"]}
|
|
@@ -190,9 +190,9 @@ export class GeospatialCameraMovement extends CameraMovement {
|
|
|
190
190
|
else {
|
|
191
191
|
this._panSpeedMultiplier = 1;
|
|
192
192
|
}
|
|
193
|
-
// If a pan drag
|
|
193
|
+
// If a pan drag is occurring, stop zooming. Rotation and zoom are allowed simultaneously.
|
|
194
194
|
let zoomTargetDistance;
|
|
195
|
-
if (this.isDragging
|
|
195
|
+
if (this.isDragging) {
|
|
196
196
|
this._zoomSpeedMultiplier = 0;
|
|
197
197
|
this._zoomVelocity = 0;
|
|
198
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geospatialCameraMovement.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/geospatialCameraMovement.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAsB,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAKvD,OAAO,EAAsB,WAAW,EAAE,MAAM,eAAe,CAAC;AAmChE;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IA6BxD,YACI,KAAY;IACZ,mGAAmG;IAC5F,MAAwB,EAC/B,cAAuB,EACf,aAAsB,EACtB,aAAsB,EAC9B,aAA6B,EAC7B,QAAkD;QAElD,KAAK,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;QAPhC,WAAM,GAAN,MAAM,CAAkB;QAEvB,kBAAa,GAAb,aAAa,CAAS;QACtB,kBAAa,GAAb,aAAa,CAAS;QAxBlC;;;WAGG;QACI,iBAAY,GAAY,IAAI,CAAC;QAO5B,oBAAe,GAAY,SAAS,CAAC;QACrC,eAAU,GAAU,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1C,qBAAgB,G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EAAE,CAAC;IAEpB,wEAAwE;IACxE,IAAI,oBAAoB,EAAE,CAAC;QACvB,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;IACD,QAAQ,CAAC,SAAS,EAAE,CAAC;AACzB,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { CameraMovement } from \"./cameraMovement\";\r\nimport { Epsilon } from \"../Maths/math.constants\";\r\nimport { type GeospatialLimits } from \"./Limits/geospatialLimits\";\r\nimport { Matrix, TmpVectors, Vector3 } from \"../Maths/math.vector.pure\";\r\nimport { type MeshPredicate, Pick, PickWithRay, Ray } from \"../Culling/ray.core\";\r\nimport { Plane } from \"../Maths/math.plane\";\r\nimport { type Scene } from \"../scene.pure\";\r\nimport { Vector3Distance } from \"../Maths/math.vector.functions\";\r\nimport { Clamp } from \"../Maths/math.scalar.functions\";\r\nimport { type PickingInfo } from \"../Collisions/pickingInfo\";\r\nimport { type Nullable } from \"../types\";\r\nimport { type InterpolatingBehavior } from \"../Behaviors/Cameras/interpolatingBehavior\";\r\nimport { type GeospatialCamera } from \"./geospatialCamera.pure\";\r\nimport { type InputMapEntry, InputMapper } from \"./inputMapper\";\r\n\r\n// ── Geospatial handler types ────────────────────────────────────────\r\n\r\n/**\r\n * Handler for geospatial pan (globe drag) interactions.\r\n * Pan uses screen coordinates and needs a lifecycle (start/update/stop) because\r\n * it establishes a drag plane on the globe surface to anchor the cursor.\r\n */\r\nexport type GeospatialPanHandler = {\r\n /** Begin a pan gesture at screen position */\r\n start(screenX: number, screenY: number): void;\r\n /** Continue panning to new screen position */\r\n update(screenX: number, screenY: number): void;\r\n /** End the pan gesture */\r\n stop(): void;\r\n};\r\n\r\n/**\r\n * Handler shape for geospatial camera interactions.\r\n * Property names are the canonical interaction type strings used in inputMap entries.\r\n * Single-method handlers are plain functions; multi-method handlers (pan) are objects.\r\n */\r\nexport type GeospatialHandlers = {\r\n /** Handler for pan (globe drag) interactions — object because it needs start/update/stop lifecycle */\r\n pan: GeospatialPanHandler;\r\n /** Handler for rotate (tilt) interactions — accepts yaw (horizontal) and pitch (vertical) deltas */\r\n rotate: (yaw: number, pitch: number) => void;\r\n /** Handler for zoom interactions — accepts delta and whether to zoom toward cursor */\r\n zoom: (delta: number, toCursor: boolean) => void;\r\n};\r\n\r\n/** Interaction type string for geospatial camera, derived from handler property names */\r\nexport type GeospatialInteraction = keyof GeospatialHandlers;\r\n\r\n/**\r\n * Geospatial-specific camera movement system that extends the base movement with\r\n * raycasting and altitude-aware zoom constraints.\r\n *\r\n * This class encapsulates geospatial camera movement logic:\r\n * - Dragging in a way which keeps cursor anchored to globe\r\n * - Latitude-based pan speed dampening\r\n * - Zoom speed scaling based on distance to center\r\n * - Raycasting to determine zoom constraints based on terrain/globe\r\n * - Altitude-based zoom clamping\r\n * - Zoom direction calculation (towards cursor vs along look vector)\r\n */\r\nexport class GeospatialCameraMovement extends CameraMovement {\r\n /** Predicate function to determine which meshes to pick against (e.g., globe mesh) */\r\n public pickPredicate?: MeshPredicate;\r\n\r\n /**\r\n * World-space picked point under the cursor, computed each frame that zoom input is active.\r\n * Used to determine the zoom direction when `zoomToCursor` is true.\r\n * Undefined when there is no active zoom or the pick misses the globe.\r\n */\r\n public computedPerFrameZoomPickPoint?: Vector3;\r\n\r\n /**\r\n * When true, zooming moves toward the point under the cursor.\r\n * When false, zooming moves along the camera's look vector.\r\n */\r\n public zoomToCursor: boolean = true;\r\n\r\n /** Input system that maps physical inputs to interactions and dispatches to handlers. */\r\n public readonly input: InputMapper<GeospatialHandlers>;\r\n\r\n private _tempPickingRay: Ray;\r\n\r\n private _hitPointRadius?: number = undefined;\r\n private _dragPlane: Plane = new Plane(0, 0, 0, 0);\r\n private _dragPlaneNormal: Vector3 = Vector3.Zero();\r\n private _dragPlaneOriginPointEcef: Vector3 = Vector3.Zero();\r\n private _dragPlaneHitPointLocal: Vector3 = Vector3.Zero();\r\n private _previousDragPlaneHitPointLocal: Vector3 = Vector3.Zero();\r\n\r\n constructor(\r\n scene: Scene,\r\n /** Geospatial bounds (min/max latitude, longitude, altitude, etc.) used to clamp camera motion. */\r\n public limits: GeospatialLimits,\r\n cameraPosition: Vector3,\r\n private _cameraCenter: Vector3,\r\n private _cameraLookAt: Vector3,\r\n pickPredicate?: MeshPredicate,\r\n behavior?: InterpolatingBehavior<GeospatialCamera>\r\n ) {\r\n super(scene, cameraPosition, behavior);\r\n this.pickPredicate = pickPredicate;\r\n this._tempPickingRay = Ray.Zero();\r\n this.panInertia = 0;\r\n this.rotationInertia = 0;\r\n this.rotationXSpeed = Math.PI / 500; // Move 1/500th of a half circle per pixel\r\n this.rotationYSpeed = Math.PI / 500; // Move 1/500th of a half circle per pixel\r\n this.zoomSpeed = 2; // Base zoom speed; actual speed is scaled based on altitude\r\n\r\n this.input = new InputMapper<GeospatialHandlers>(\r\n {\r\n pan: {\r\n start: (screenX: number, screenY: number) => {\r\n this.startDrag(screenX, screenY);\r\n },\r\n update: (screenX: number, screenY: number) => {\r\n this.handleDrag(screenX, screenY);\r\n },\r\n stop: () => {\r\n this.stopDrag();\r\n },\r\n },\r\n rotate: (yaw: number, pitch: number) => {\r\n this.rotationAccumulatedPixels.y += yaw;\r\n this.rotationAccumulatedPixels.x += pitch;\r\n },\r\n zoom: (delta: number, toCursor: boolean) => {\r\n this.handleZoom(delta, toCursor);\r\n },\r\n },\r\n () => this._createDefaultInputMap()\r\n );\r\n }\r\n\r\n private _createDefaultInputMap(): InputMapEntry<GeospatialInteraction>[] {\r\n return [\r\n { source: \"pointer\", button: 0, interaction: \"pan\" },\r\n { source: \"pointer\", button: 1, interaction: \"rotate\" },\r\n { source: \"pointer\", button: 2, interaction: \"rotate\" },\r\n { source: \"wheel\", interaction: \"zoom\" },\r\n { source: \"keyboard\", key: [187, 107, 189, 109], interaction: \"zoom\", sensitivity: 1.0 }, // +/-/numpad+/numpad-\r\n { source: \"keyboard\", modifiers: { ctrl: true }, interaction: \"rotate\", sensitivity: 1.0 },\r\n { source: \"keyboard\", modifiers: { alt: true }, interaction: \"rotate\", sensitivity: 1.0 },\r\n { source: \"keyboard\", interaction: \"pan\", sensitivity: 1.0 },\r\n ];\r\n }\r\n\r\n /**\r\n * Function to calculate the up vector from a given point.\r\n * Can be overridden to support non-spherical planets or custom up vector logic.\r\n * Defaults to using the geocentric normal.\r\n * @param point The point from which to calculate the up vector (e.g., camera position)\r\n * @param result The vector to store the calculated up vector\r\n * @returns The calculated up vector\r\n */\r\n public calculateUpVectorFromPointToRef = (point: Vector3, result: Vector3): Vector3 => {\r\n return point.normalizeToRef(result);\r\n };\r\n\r\n /**\r\n * Begins a drag (pan) gesture by picking the globe at the given screen position\r\n * and establishing a drag plane for subsequent updates.\r\n * @param pointerX - Screen X coordinate of the pointer\r\n * @param pointerY - Screen Y coordinate of the pointer\r\n */\r\n public startDrag(pointerX: number, pointerY: number) {\r\n const pickResult = this._scene.pick(pointerX, pointerY, this.pickPredicate);\r\n if (pickResult.pickedPoint && pickResult.ray) {\r\n // Store radius from earth center to pickedPoint, used when calculating drag plane\r\n this._hitPointRadius = pickResult.pickedPoint.length();\r\n\r\n this._recalculateDragPlaneHitPoint(this._hitPointRadius, pickResult.ray, TmpVectors.Matrix[0]);\r\n this._previousDragPlaneHitPointLocal.copyFrom(this._dragPlaneHitPointLocal);\r\n } else {\r\n this._hitPointRadius = undefined; // can't drag without a hit on the globe\r\n }\r\n }\r\n\r\n /**\r\n * Ends the current drag gesture, releasing the drag plane.\r\n */\r\n public stopDrag() {\r\n this._hitPointRadius = undefined;\r\n }\r\n\r\n /**\r\n * The previous drag plane hit point in local space is stored to compute the movement delta.\r\n * As the drag movement occurs, we will continuously recalculate this point. The delta between the previous and current hit points is the delta we will apply to the camera's localtranslation\r\n * @param hitPointRadius The distance between the world origin (center of globe) and the initial drag hit point\r\n * @param ray The ray from the camera to the new cursor location\r\n * @param localToEcefResult The matrix to convert from local to ECEF space\r\n */\r\n private _recalculateDragPlaneHitPoint(hitPointRadius: number, ray: Ray, localToEcefResult: Matrix): void {\r\n // Use the camera's geocentric normal to find the dragPlaneOriginPoint which lives at hitPointRadius along the camera's geocentric normal\r\n this._cameraPosition.scaleToRef(hitPointRadius / Math.max(0.00001, this._cameraPosition.length()), this._dragPlaneOriginPointEcef);\r\n\r\n // The dragPlaneOffsetVector will later be recalculated when drag occurs, and the delta between the offset vectors will be applied to localTranslation\r\n ComputeLocalBasisToRefs(\r\n this._dragPlaneOriginPointEcef,\r\n TmpVectors.Vector3[0],\r\n TmpVectors.Vector3[1],\r\n this._dragPlaneNormal,\r\n this._scene.useRightHandedSystem,\r\n this.calculateUpVectorFromPointToRef\r\n );\r\n const localToEcef = Matrix.FromXYZAxesToRef(TmpVectors.Vector3[0], TmpVectors.Vector3[1], this._dragPlaneNormal, localToEcefResult);\r\n localToEcef.setTranslationFromFloats(this._dragPlaneOriginPointEcef.x, this._dragPlaneOriginPointEcef.y, this._dragPlaneOriginPointEcef.z);\r\n const ecefToLocal = localToEcef.invertToRef(TmpVectors.Matrix[1]);\r\n\r\n // Now create a plane at that point, perpendicular to _dragPlaneNormal.\r\n Plane.FromPositionAndNormalToRef(this._dragPlaneOriginPointEcef, this._dragPlaneNormal, this._dragPlane);\r\n\r\n // Lastly, find the _dragPlaneHitPoint where the ray intersects the _dragPlane.\r\n if (IntersectRayWithPlaneToRef(ray, this._dragPlane, this._dragPlaneHitPointLocal)) {\r\n // If hit, convert the drag plane hit point into the local space.\r\n Vector3.TransformCoordinatesToRef(this._dragPlaneHitPointLocal, ecefToLocal, this._dragPlaneHitPointLocal);\r\n }\r\n }\r\n\r\n /**\r\n * Updates the drag gesture by recalculating the intersection with the drag plane\r\n * and accumulating the resulting pan delta.\r\n * @param pointerX - Current screen X coordinate\r\n * @param pointerY - Current screen Y coordinate\r\n */\r\n public handleDrag(pointerX: number, pointerY: number) {\r\n const scene = this._scene;\r\n if (!this._hitPointRadius || !scene.activeCamera) {\r\n return;\r\n }\r\n\r\n scene.createPickingRayToRef(pointerX, pointerY, null, this._tempPickingRay, scene.activeCamera);\r\n\r\n const localToEcef = TmpVectors.Matrix[0];\r\n this._recalculateDragPlaneHitPoint(this._hitPointRadius, this._tempPickingRay, localToEcef);\r\n\r\n const delta = this._dragPlaneHitPointLocal.subtractToRef(this._previousDragPlaneHitPointLocal, TmpVectors.Vector3[6]);\r\n\r\n // When the camera is pitched nearly parallel to the drag plane, ray-plane intersection\r\n // can produce enormous deltas. Clamp the delta to avoid massive jumps.\r\n const maxDragDelta = this._hitPointRadius * 0.1; // Max 10% of hit radius per frame\r\n const deltaLength = delta.length();\r\n if (deltaLength > maxDragDelta) {\r\n delta.scaleInPlace(maxDragDelta / deltaLength);\r\n }\r\n\r\n this._previousDragPlaneHitPointLocal.copyFrom(this._dragPlaneHitPointLocal);\r\n\r\n Vector3.TransformNormalToRef(delta, localToEcef, delta);\r\n this._dragPlaneOriginPointEcef.addInPlace(delta);\r\n\r\n this.panAccumulatedPixels.subtractInPlace(delta);\r\n }\r\n\r\n /**\r\n * Consumes the per-frame accumulated pan/rotate/zoom deltas and applies them to the camera state,\r\n * with geospatial-specific dampening (e.g. slower panning near the poles, parallax-based pan compensation).\r\n * Called once per frame by the scene's render loop via `_checkInputs`.\r\n * @override\r\n */\r\n public override computeCurrentFrameDeltas(): void {\r\n const cameraCenter = this._cameraCenter;\r\n\r\n // Slows down panning near the poles\r\n if (this.panAccumulatedPixels.lengthSquared() > Epsilon) {\r\n const centerRadius = cameraCenter.length(); // distance from planet origin to camera center\r\n const currentRadius = this._cameraPosition.length();\r\n // Dampen the pan speed based on latitude (slower near poles)\r\n const upAtCenter = TmpVectors.Vector3[7];\r\n this.calculateUpVectorFromPointToRef(cameraCenter, upAtCenter);\r\n // Latitude is derived from the Z component of the up vector (ECEF convention: Z = polar axis)\r\n const sineOfSphericalLat = upAtCenter.z;\r\n const cosOfSphericalLat = Math.sqrt(1 - Math.min(1, sineOfSphericalLat * sineOfSphericalLat));\r\n const latitudeDampening = Math.sqrt(Math.abs(cosOfSphericalLat)); // sqrt here reduces effect near equator\r\n\r\n // Reduce the dampening effect near surface (so that at ground level, pan speed is not affected by latitude)\r\n const height = Math.max(currentRadius - centerRadius, Epsilon);\r\n const latitudeDampeningScale = Math.max(1, centerRadius / height);\r\n\r\n this._panSpeedMultiplier = Clamp(latitudeDampeningScale * latitudeDampening, 0, 1);\r\n } else {\r\n this._panSpeedMultiplier = 1;\r\n }\r\n\r\n // If a pan drag or active rotation is occurring, stop zooming.\r\n let zoomTargetDistance: number | undefined;\r\n if (this.isDragging || this.rotationAccumulatedPixels.lengthSquared() > Epsilon) {\r\n this._zoomSpeedMultiplier = 0;\r\n this._zoomVelocity = 0;\r\n } else {\r\n zoomTargetDistance = this.computedPerFrameZoomPickPoint ? Vector3Distance(this._cameraPosition, this.computedPerFrameZoomPickPoint) : undefined;\r\n\r\n // Scales zoom movement speed based on camera distance to zoom target.\r\n this._zoomSpeedMultiplier = (zoomTargetDistance ?? Vector3Distance(this._cameraPosition, cameraCenter)) * 0.01;\r\n }\r\n\r\n super.computeCurrentFrameDeltas();\r\n }\r\n\r\n /**\r\n * Returns true when a drag gesture is active (between startDrag and stopDrag).\r\n */\r\n public get isDragging() {\r\n return this._hitPointRadius !== undefined;\r\n }\r\n\r\n /**\r\n * Accumulates a zoom delta and determines the zoom target point via raycasting.\r\n * @param zoomDelta - Signed zoom amount (positive = zoom in, negative = zoom out)\r\n * @param toCursor - When true, zoom toward the point under the cursor; when false, zoom along the look vector\r\n */\r\n public handleZoom(zoomDelta: number, toCursor: boolean) {\r\n if (zoomDelta !== 0) {\r\n this.zoomAccumulatedPixels += zoomDelta;\r\n\r\n const pickResult = Pick(this._scene, this._scene.pointerX, this._scene.pointerY, this.pickPredicate);\r\n\r\n if (toCursor && pickResult.hit && pickResult.pickedPoint && pickResult.ray && this.zoomToCursor) {\r\n this.computedPerFrameZoomPickPoint = pickResult.pickedPoint;\r\n } else {\r\n // If no hit under cursor or explicitly told not to zoom to cursor, zoom along lookVector instead\r\n const lookPickResult = this.pickAlongVector(this._cameraLookAt);\r\n this.computedPerFrameZoomPickPoint = lookPickResult?.pickedPoint ?? undefined;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Casts a ray from the camera position along the given direction and returns the pick result.\r\n * @param vector - World-space direction to cast along\r\n * @returns The pick result, or null if no hit\r\n */\r\n public pickAlongVector(vector: Vector3): Nullable<PickingInfo> {\r\n this._tempPickingRay.origin.copyFrom(this._cameraPosition);\r\n this._tempPickingRay.direction.copyFrom(vector);\r\n return PickWithRay(this._scene, this._tempPickingRay, this.pickPredicate);\r\n }\r\n}\r\n/** @internal */\r\nexport function ClampCenterFromPolesInPlace(center: Vector3) {\r\n const sineOfSphericalLatitudeLimit = 0.998749218; // ~90 degrees\r\n const centerMagnitude = center.length(); // distance from planet origin\r\n if (centerMagnitude > Epsilon) {\r\n const sineSphericalLat = centerMagnitude === 0 ? 0 : center.z / centerMagnitude;\r\n if (Math.abs(sineSphericalLat) > sineOfSphericalLatitudeLimit) {\r\n // Clamp the spherical latitude (and derive longitude)\r\n const sineOfClampedSphericalLat = Clamp(sineSphericalLat, -sineOfSphericalLatitudeLimit, sineOfSphericalLatitudeLimit);\r\n const cosineOfClampedSphericalLat = Math.sqrt(1 - sineOfClampedSphericalLat * sineOfClampedSphericalLat);\r\n const longitude = Math.atan2(center.y, center.x);\r\n\r\n // Spherical to Cartesian\r\n const newX = centerMagnitude * Math.cos(longitude) * cosineOfClampedSphericalLat;\r\n const newY = centerMagnitude * Math.sin(longitude) * cosineOfClampedSphericalLat;\r\n const newZ = centerMagnitude * sineOfClampedSphericalLat;\r\n\r\n center.set(newX, newY, newZ);\r\n }\r\n }\r\n return center;\r\n}\r\n\r\nfunction IntersectRayWithPlaneToRef(ray: Ray, plane: Plane, ref: Vector3): boolean {\r\n // Distance along the ray to the plane; null if no hit\r\n const dist = ray.intersectsPlane(plane);\r\n\r\n if (dist !== null && dist >= 0) {\r\n ray.origin.addToRef(ray.direction.scaleToRef(dist, TmpVectors.Vector3[0]), ref);\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Helper to build east/north/up basis vectors at a world position.\r\n * Cross product order is swapped based on handedness so that the east vector\r\n * encodes the coordinate-system convention, removing the need for a separate yawScale.\r\n * @param worldPos - The position on the globe\r\n * @param refEast - Receives the east direction\r\n * @param refNorth - Receives the north direction\r\n * @param refUp - Receives the up (outward) direction\r\n * @param useRightHandedSystem - Whether the scene uses a right-handed coordinate system (default: false)\r\n * @param calculateUpVectorFromPointToRef - Optional function to calculate the up vector from a point. If supplied, this function will be used instead of assuming a spherical geocentric normal, allowing support for non-spherical planets or custom up vector logic.\r\n * @internal\r\n */\r\nexport function ComputeLocalBasisToRefs(\r\n worldPos: Vector3,\r\n refEast: Vector3,\r\n refNorth: Vector3,\r\n refUp: Vector3,\r\n useRightHandedSystem: boolean = false,\r\n calculateUpVectorFromPointToRef?: (point: Vector3, result: Vector3) => Vector3\r\n): void {\r\n if (calculateUpVectorFromPointToRef) {\r\n calculateUpVectorFromPointToRef(worldPos, refUp);\r\n } else {\r\n // up = normalized position (geocentric normal)\r\n refUp.copyFrom(worldPos).normalize();\r\n }\r\n\r\n // east – cross product order determines handedness\r\n const worldNorth = Vector3.LeftHandedForwardReadOnly; // (0,0,1)\r\n if (useRightHandedSystem) {\r\n Vector3.CrossToRef(worldNorth, refUp, refEast);\r\n } else {\r\n Vector3.CrossToRef(refUp, worldNorth, refEast);\r\n }\r\n\r\n // at poles, cross with worldRight instead\r\n if (refEast.lengthSquared() < Epsilon) {\r\n if (useRightHandedSystem) {\r\n Vector3.CrossToRef(Vector3.Right(), refUp, refEast);\r\n } else {\r\n Vector3.CrossToRef(refUp, Vector3.Right(), refEast);\r\n }\r\n }\r\n refEast.normalize();\r\n\r\n // north – completes the basis (cross order also swapped for handedness)\r\n if (useRightHandedSystem) {\r\n Vector3.CrossToRef(refUp, refEast, refNorth);\r\n } else {\r\n Vector3.CrossToRef(refEast, refUp, refNorth);\r\n }\r\n refNorth.normalize();\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"geospatialCameraMovement.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/geospatialCameraMovement.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAsB,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAKvD,OAAO,EAAsB,WAAW,EAAE,MAAM,eAAe,CAAC;AAmChE;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,wBAAyB,SAAQ,cAAc;IA6BxD,YACI,KAAY;IACZ,mGAAmG;IAC5F,MAAwB,EAC/B,cAAuB,EACf,aAAsB,EACtB,aAAsB,EAC9B,aAA6B,EAC7B,QAAkD;QAElD,KAAK,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC;QAPhC,WAAM,GAAN,MAAM,CAAkB;QAEvB,kBAAa,GAAb,aAAa,CAAS;QACtB,kBAAa,GAAb,aAAa,CAAS;QAxBlC;;;WAGG;QACI,iBAAY,GAAY,IAAI,CAAC;QAO5B,oBAAe,GAAY,SAAS,CAAC;QACrC,eAAU,GAAU,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;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BAAoB,EAAE,CAAC;QACvB,OAAO,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACjD,CAAC;IACD,QAAQ,CAAC,SAAS,EAAE,CAAC;AACzB,CAAC","sourcesContent":["/** This file must only contain pure code and pure imports */\r\n\r\nimport { CameraMovement } from \"./cameraMovement\";\r\nimport { Epsilon } from \"../Maths/math.constants\";\r\nimport { type GeospatialLimits } from \"./Limits/geospatialLimits\";\r\nimport { Matrix, TmpVectors, Vector3 } from \"../Maths/math.vector.pure\";\r\nimport { type MeshPredicate, Pick, PickWithRay, Ray } from \"../Culling/ray.core\";\r\nimport { Plane } from \"../Maths/math.plane\";\r\nimport { type Scene } from \"../scene.pure\";\r\nimport { Vector3Distance } from \"../Maths/math.vector.functions\";\r\nimport { Clamp } from \"../Maths/math.scalar.functions\";\r\nimport { type PickingInfo } from \"../Collisions/pickingInfo\";\r\nimport { type Nullable } from \"../types\";\r\nimport { type InterpolatingBehavior } from \"../Behaviors/Cameras/interpolatingBehavior\";\r\nimport { type GeospatialCamera } from \"./geospatialCamera.pure\";\r\nimport { type InputMapEntry, InputMapper } from \"./inputMapper\";\r\n\r\n// ── Geospatial handler types ────────────────────────────────────────\r\n\r\n/**\r\n * Handler for geospatial pan (globe drag) interactions.\r\n * Pan uses screen coordinates and needs a lifecycle (start/update/stop) because\r\n * it establishes a drag plane on the globe surface to anchor the cursor.\r\n */\r\nexport type GeospatialPanHandler = {\r\n /** Begin a pan gesture at screen position */\r\n start(screenX: number, screenY: number): void;\r\n /** Continue panning to new screen position */\r\n update(screenX: number, screenY: number): void;\r\n /** End the pan gesture */\r\n stop(): void;\r\n};\r\n\r\n/**\r\n * Handler shape for geospatial camera interactions.\r\n * Property names are the canonical interaction type strings used in inputMap entries.\r\n * Single-method handlers are plain functions; multi-method handlers (pan) are objects.\r\n */\r\nexport type GeospatialHandlers = {\r\n /** Handler for pan (globe drag) interactions — object because it needs start/update/stop lifecycle */\r\n pan: GeospatialPanHandler;\r\n /** Handler for rotate (tilt) interactions — accepts yaw (horizontal) and pitch (vertical) deltas */\r\n rotate: (yaw: number, pitch: number) => void;\r\n /** Handler for zoom interactions — accepts delta and whether to zoom toward cursor */\r\n zoom: (delta: number, toCursor: boolean) => void;\r\n};\r\n\r\n/** Interaction type string for geospatial camera, derived from handler property names */\r\nexport type GeospatialInteraction = keyof GeospatialHandlers;\r\n\r\n/**\r\n * Geospatial-specific camera movement system that extends the base movement with\r\n * raycasting and altitude-aware zoom constraints.\r\n *\r\n * This class encapsulates geospatial camera movement logic:\r\n * - Dragging in a way which keeps cursor anchored to globe\r\n * - Latitude-based pan speed dampening\r\n * - Zoom speed scaling based on distance to center\r\n * - Raycasting to determine zoom constraints based on terrain/globe\r\n * - Altitude-based zoom clamping\r\n * - Zoom direction calculation (towards cursor vs along look vector)\r\n */\r\nexport class GeospatialCameraMovement extends CameraMovement {\r\n /** Predicate function to determine which meshes to pick against (e.g., globe mesh) */\r\n public pickPredicate?: MeshPredicate;\r\n\r\n /**\r\n * World-space picked point under the cursor, computed each frame that zoom input is active.\r\n * Used to determine the zoom direction when `zoomToCursor` is true.\r\n * Undefined when there is no active zoom or the pick misses the globe.\r\n */\r\n public computedPerFrameZoomPickPoint?: Vector3;\r\n\r\n /**\r\n * When true, zooming moves toward the point under the cursor.\r\n * When false, zooming moves along the camera's look vector.\r\n */\r\n public zoomToCursor: boolean = true;\r\n\r\n /** Input system that maps physical inputs to interactions and dispatches to handlers. */\r\n public readonly input: InputMapper<GeospatialHandlers>;\r\n\r\n private _tempPickingRay: Ray;\r\n\r\n private _hitPointRadius?: number = undefined;\r\n private _dragPlane: Plane = new Plane(0, 0, 0, 0);\r\n private _dragPlaneNormal: Vector3 = Vector3.Zero();\r\n private _dragPlaneOriginPointEcef: Vector3 = Vector3.Zero();\r\n private _dragPlaneHitPointLocal: Vector3 = Vector3.Zero();\r\n private _previousDragPlaneHitPointLocal: Vector3 = Vector3.Zero();\r\n\r\n constructor(\r\n scene: Scene,\r\n /** Geospatial bounds (min/max latitude, longitude, altitude, etc.) used to clamp camera motion. */\r\n public limits: GeospatialLimits,\r\n cameraPosition: Vector3,\r\n private _cameraCenter: Vector3,\r\n private _cameraLookAt: Vector3,\r\n pickPredicate?: MeshPredicate,\r\n behavior?: InterpolatingBehavior<GeospatialCamera>\r\n ) {\r\n super(scene, cameraPosition, behavior);\r\n this.pickPredicate = pickPredicate;\r\n this._tempPickingRay = Ray.Zero();\r\n this.panInertia = 0;\r\n this.rotationInertia = 0;\r\n this.rotationXSpeed = Math.PI / 500; // Move 1/500th of a half circle per pixel\r\n this.rotationYSpeed = Math.PI / 500; // Move 1/500th of a half circle per pixel\r\n this.zoomSpeed = 2; // Base zoom speed; actual speed is scaled based on altitude\r\n\r\n this.input = new InputMapper<GeospatialHandlers>(\r\n {\r\n pan: {\r\n start: (screenX: number, screenY: number) => {\r\n this.startDrag(screenX, screenY);\r\n },\r\n update: (screenX: number, screenY: number) => {\r\n this.handleDrag(screenX, screenY);\r\n },\r\n stop: () => {\r\n this.stopDrag();\r\n },\r\n },\r\n rotate: (yaw: number, pitch: number) => {\r\n this.rotationAccumulatedPixels.y += yaw;\r\n this.rotationAccumulatedPixels.x += pitch;\r\n },\r\n zoom: (delta: number, toCursor: boolean) => {\r\n this.handleZoom(delta, toCursor);\r\n },\r\n },\r\n () => this._createDefaultInputMap()\r\n );\r\n }\r\n\r\n private _createDefaultInputMap(): InputMapEntry<GeospatialInteraction>[] {\r\n return [\r\n { source: \"pointer\", button: 0, interaction: \"pan\" },\r\n { source: \"pointer\", button: 1, interaction: \"rotate\" },\r\n { source: \"pointer\", button: 2, interaction: \"rotate\" },\r\n { source: \"wheel\", interaction: \"zoom\" },\r\n { source: \"keyboard\", key: [187, 107, 189, 109], interaction: \"zoom\", sensitivity: 1.0 }, // +/-/numpad+/numpad-\r\n { source: \"keyboard\", modifiers: { ctrl: true }, interaction: \"rotate\", sensitivity: 1.0 },\r\n { source: \"keyboard\", modifiers: { alt: true }, interaction: \"rotate\", sensitivity: 1.0 },\r\n { source: \"keyboard\", interaction: \"pan\", sensitivity: 1.0 },\r\n ];\r\n }\r\n\r\n /**\r\n * Function to calculate the up vector from a given point.\r\n * Can be overridden to support non-spherical planets or custom up vector logic.\r\n * Defaults to using the geocentric normal.\r\n * @param point The point from which to calculate the up vector (e.g., camera position)\r\n * @param result The vector to store the calculated up vector\r\n * @returns The calculated up vector\r\n */\r\n public calculateUpVectorFromPointToRef = (point: Vector3, result: Vector3): Vector3 => {\r\n return point.normalizeToRef(result);\r\n };\r\n\r\n /**\r\n * Begins a drag (pan) gesture by picking the globe at the given screen position\r\n * and establishing a drag plane for subsequent updates.\r\n * @param pointerX - Screen X coordinate of the pointer\r\n * @param pointerY - Screen Y coordinate of the pointer\r\n */\r\n public startDrag(pointerX: number, pointerY: number) {\r\n const pickResult = this._scene.pick(pointerX, pointerY, this.pickPredicate);\r\n if (pickResult.pickedPoint && pickResult.ray) {\r\n // Store radius from earth center to pickedPoint, used when calculating drag plane\r\n this._hitPointRadius = pickResult.pickedPoint.length();\r\n\r\n this._recalculateDragPlaneHitPoint(this._hitPointRadius, pickResult.ray, TmpVectors.Matrix[0]);\r\n this._previousDragPlaneHitPointLocal.copyFrom(this._dragPlaneHitPointLocal);\r\n } else {\r\n this._hitPointRadius = undefined; // can't drag without a hit on the globe\r\n }\r\n }\r\n\r\n /**\r\n * Ends the current drag gesture, releasing the drag plane.\r\n */\r\n public stopDrag() {\r\n this._hitPointRadius = undefined;\r\n }\r\n\r\n /**\r\n * The previous drag plane hit point in local space is stored to compute the movement delta.\r\n * As the drag movement occurs, we will continuously recalculate this point. The delta between the previous and current hit points is the delta we will apply to the camera's localtranslation\r\n * @param hitPointRadius The distance between the world origin (center of globe) and the initial drag hit point\r\n * @param ray The ray from the camera to the new cursor location\r\n * @param localToEcefResult The matrix to convert from local to ECEF space\r\n */\r\n private _recalculateDragPlaneHitPoint(hitPointRadius: number, ray: Ray, localToEcefResult: Matrix): void {\r\n // Use the camera's geocentric normal to find the dragPlaneOriginPoint which lives at hitPointRadius along the camera's geocentric normal\r\n this._cameraPosition.scaleToRef(hitPointRadius / Math.max(0.00001, this._cameraPosition.length()), this._dragPlaneOriginPointEcef);\r\n\r\n // The dragPlaneOffsetVector will later be recalculated when drag occurs, and the delta between the offset vectors will be applied to localTranslation\r\n ComputeLocalBasisToRefs(\r\n this._dragPlaneOriginPointEcef,\r\n TmpVectors.Vector3[0],\r\n TmpVectors.Vector3[1],\r\n this._dragPlaneNormal,\r\n this._scene.useRightHandedSystem,\r\n this.calculateUpVectorFromPointToRef\r\n );\r\n const localToEcef = Matrix.FromXYZAxesToRef(TmpVectors.Vector3[0], TmpVectors.Vector3[1], this._dragPlaneNormal, localToEcefResult);\r\n localToEcef.setTranslationFromFloats(this._dragPlaneOriginPointEcef.x, this._dragPlaneOriginPointEcef.y, this._dragPlaneOriginPointEcef.z);\r\n const ecefToLocal = localToEcef.invertToRef(TmpVectors.Matrix[1]);\r\n\r\n // Now create a plane at that point, perpendicular to _dragPlaneNormal.\r\n Plane.FromPositionAndNormalToRef(this._dragPlaneOriginPointEcef, this._dragPlaneNormal, this._dragPlane);\r\n\r\n // Lastly, find the _dragPlaneHitPoint where the ray intersects the _dragPlane.\r\n if (IntersectRayWithPlaneToRef(ray, this._dragPlane, this._dragPlaneHitPointLocal)) {\r\n // If hit, convert the drag plane hit point into the local space.\r\n Vector3.TransformCoordinatesToRef(this._dragPlaneHitPointLocal, ecefToLocal, this._dragPlaneHitPointLocal);\r\n }\r\n }\r\n\r\n /**\r\n * Updates the drag gesture by recalculating the intersection with the drag plane\r\n * and accumulating the resulting pan delta.\r\n * @param pointerX - Current screen X coordinate\r\n * @param pointerY - Current screen Y coordinate\r\n */\r\n public handleDrag(pointerX: number, pointerY: number) {\r\n const scene = this._scene;\r\n if (!this._hitPointRadius || !scene.activeCamera) {\r\n return;\r\n }\r\n\r\n scene.createPickingRayToRef(pointerX, pointerY, null, this._tempPickingRay, scene.activeCamera);\r\n\r\n const localToEcef = TmpVectors.Matrix[0];\r\n this._recalculateDragPlaneHitPoint(this._hitPointRadius, this._tempPickingRay, localToEcef);\r\n\r\n const delta = this._dragPlaneHitPointLocal.subtractToRef(this._previousDragPlaneHitPointLocal, TmpVectors.Vector3[6]);\r\n\r\n // When the camera is pitched nearly parallel to the drag plane, ray-plane intersection\r\n // can produce enormous deltas. Clamp the delta to avoid massive jumps.\r\n const maxDragDelta = this._hitPointRadius * 0.1; // Max 10% of hit radius per frame\r\n const deltaLength = delta.length();\r\n if (deltaLength > maxDragDelta) {\r\n delta.scaleInPlace(maxDragDelta / deltaLength);\r\n }\r\n\r\n this._previousDragPlaneHitPointLocal.copyFrom(this._dragPlaneHitPointLocal);\r\n\r\n Vector3.TransformNormalToRef(delta, localToEcef, delta);\r\n this._dragPlaneOriginPointEcef.addInPlace(delta);\r\n\r\n this.panAccumulatedPixels.subtractInPlace(delta);\r\n }\r\n\r\n /**\r\n * Consumes the per-frame accumulated pan/rotate/zoom deltas and applies them to the camera state,\r\n * with geospatial-specific dampening (e.g. slower panning near the poles, parallax-based pan compensation).\r\n * Called once per frame by the scene's render loop via `_checkInputs`.\r\n * @override\r\n */\r\n public override computeCurrentFrameDeltas(): void {\r\n const cameraCenter = this._cameraCenter;\r\n\r\n // Slows down panning near the poles\r\n if (this.panAccumulatedPixels.lengthSquared() > Epsilon) {\r\n const centerRadius = cameraCenter.length(); // distance from planet origin to camera center\r\n const currentRadius = this._cameraPosition.length();\r\n // Dampen the pan speed based on latitude (slower near poles)\r\n const upAtCenter = TmpVectors.Vector3[7];\r\n this.calculateUpVectorFromPointToRef(cameraCenter, upAtCenter);\r\n // Latitude is derived from the Z component of the up vector (ECEF convention: Z = polar axis)\r\n const sineOfSphericalLat = upAtCenter.z;\r\n const cosOfSphericalLat = Math.sqrt(1 - Math.min(1, sineOfSphericalLat * sineOfSphericalLat));\r\n const latitudeDampening = Math.sqrt(Math.abs(cosOfSphericalLat)); // sqrt here reduces effect near equator\r\n\r\n // Reduce the dampening effect near surface (so that at ground level, pan speed is not affected by latitude)\r\n const height = Math.max(currentRadius - centerRadius, Epsilon);\r\n const latitudeDampeningScale = Math.max(1, centerRadius / height);\r\n\r\n this._panSpeedMultiplier = Clamp(latitudeDampeningScale * latitudeDampening, 0, 1);\r\n } else {\r\n this._panSpeedMultiplier = 1;\r\n }\r\n\r\n // If a pan drag is occurring, stop zooming. Rotation and zoom are allowed simultaneously.\r\n let zoomTargetDistance: number | undefined;\r\n if (this.isDragging) {\r\n this._zoomSpeedMultiplier = 0;\r\n this._zoomVelocity = 0;\r\n } else {\r\n zoomTargetDistance = this.computedPerFrameZoomPickPoint ? Vector3Distance(this._cameraPosition, this.computedPerFrameZoomPickPoint) : undefined;\r\n\r\n // Scales zoom movement speed based on camera distance to zoom target.\r\n this._zoomSpeedMultiplier = (zoomTargetDistance ?? Vector3Distance(this._cameraPosition, cameraCenter)) * 0.01;\r\n }\r\n\r\n super.computeCurrentFrameDeltas();\r\n }\r\n\r\n /**\r\n * Returns true when a drag gesture is active (between startDrag and stopDrag).\r\n */\r\n public get isDragging() {\r\n return this._hitPointRadius !== undefined;\r\n }\r\n\r\n /**\r\n * Accumulates a zoom delta and determines the zoom target point via raycasting.\r\n * @param zoomDelta - Signed zoom amount (positive = zoom in, negative = zoom out)\r\n * @param toCursor - When true, zoom toward the point under the cursor; when false, zoom along the look vector\r\n */\r\n public handleZoom(zoomDelta: number, toCursor: boolean) {\r\n if (zoomDelta !== 0) {\r\n this.zoomAccumulatedPixels += zoomDelta;\r\n\r\n const pickResult = Pick(this._scene, this._scene.pointerX, this._scene.pointerY, this.pickPredicate);\r\n\r\n if (toCursor && pickResult.hit && pickResult.pickedPoint && pickResult.ray && this.zoomToCursor) {\r\n this.computedPerFrameZoomPickPoint = pickResult.pickedPoint;\r\n } else {\r\n // If no hit under cursor or explicitly told not to zoom to cursor, zoom along lookVector instead\r\n const lookPickResult = this.pickAlongVector(this._cameraLookAt);\r\n this.computedPerFrameZoomPickPoint = lookPickResult?.pickedPoint ?? undefined;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Casts a ray from the camera position along the given direction and returns the pick result.\r\n * @param vector - World-space direction to cast along\r\n * @returns The pick result, or null if no hit\r\n */\r\n public pickAlongVector(vector: Vector3): Nullable<PickingInfo> {\r\n this._tempPickingRay.origin.copyFrom(this._cameraPosition);\r\n this._tempPickingRay.direction.copyFrom(vector);\r\n return PickWithRay(this._scene, this._tempPickingRay, this.pickPredicate);\r\n }\r\n}\r\n/** @internal */\r\nexport function ClampCenterFromPolesInPlace(center: Vector3) {\r\n const sineOfSphericalLatitudeLimit = 0.998749218; // ~90 degrees\r\n const centerMagnitude = center.length(); // distance from planet origin\r\n if (centerMagnitude > Epsilon) {\r\n const sineSphericalLat = centerMagnitude === 0 ? 0 : center.z / centerMagnitude;\r\n if (Math.abs(sineSphericalLat) > sineOfSphericalLatitudeLimit) {\r\n // Clamp the spherical latitude (and derive longitude)\r\n const sineOfClampedSphericalLat = Clamp(sineSphericalLat, -sineOfSphericalLatitudeLimit, sineOfSphericalLatitudeLimit);\r\n const cosineOfClampedSphericalLat = Math.sqrt(1 - sineOfClampedSphericalLat * sineOfClampedSphericalLat);\r\n const longitude = Math.atan2(center.y, center.x);\r\n\r\n // Spherical to Cartesian\r\n const newX = centerMagnitude * Math.cos(longitude) * cosineOfClampedSphericalLat;\r\n const newY = centerMagnitude * Math.sin(longitude) * cosineOfClampedSphericalLat;\r\n const newZ = centerMagnitude * sineOfClampedSphericalLat;\r\n\r\n center.set(newX, newY, newZ);\r\n }\r\n }\r\n return center;\r\n}\r\n\r\nfunction IntersectRayWithPlaneToRef(ray: Ray, plane: Plane, ref: Vector3): boolean {\r\n // Distance along the ray to the plane; null if no hit\r\n const dist = ray.intersectsPlane(plane);\r\n\r\n if (dist !== null && dist >= 0) {\r\n ray.origin.addToRef(ray.direction.scaleToRef(dist, TmpVectors.Vector3[0]), ref);\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/**\r\n * Helper to build east/north/up basis vectors at a world position.\r\n * Cross product order is swapped based on handedness so that the east vector\r\n * encodes the coordinate-system convention, removing the need for a separate yawScale.\r\n * @param worldPos - The position on the globe\r\n * @param refEast - Receives the east direction\r\n * @param refNorth - Receives the north direction\r\n * @param refUp - Receives the up (outward) direction\r\n * @param useRightHandedSystem - Whether the scene uses a right-handed coordinate system (default: false)\r\n * @param calculateUpVectorFromPointToRef - Optional function to calculate the up vector from a point. If supplied, this function will be used instead of assuming a spherical geocentric normal, allowing support for non-spherical planets or custom up vector logic.\r\n * @internal\r\n */\r\nexport function ComputeLocalBasisToRefs(\r\n worldPos: Vector3,\r\n refEast: Vector3,\r\n refNorth: Vector3,\r\n refUp: Vector3,\r\n useRightHandedSystem: boolean = false,\r\n calculateUpVectorFromPointToRef?: (point: Vector3, result: Vector3) => Vector3\r\n): void {\r\n if (calculateUpVectorFromPointToRef) {\r\n calculateUpVectorFromPointToRef(worldPos, refUp);\r\n } else {\r\n // up = normalized position (geocentric normal)\r\n refUp.copyFrom(worldPos).normalize();\r\n }\r\n\r\n // east – cross product order determines handedness\r\n const worldNorth = Vector3.LeftHandedForwardReadOnly; // (0,0,1)\r\n if (useRightHandedSystem) {\r\n Vector3.CrossToRef(worldNorth, refUp, refEast);\r\n } else {\r\n Vector3.CrossToRef(refUp, worldNorth, refEast);\r\n }\r\n\r\n // at poles, cross with worldRight instead\r\n if (refEast.lengthSquared() < Epsilon) {\r\n if (useRightHandedSystem) {\r\n Vector3.CrossToRef(Vector3.Right(), refUp, refEast);\r\n } else {\r\n Vector3.CrossToRef(refUp, Vector3.Right(), refEast);\r\n }\r\n }\r\n refEast.normalize();\r\n\r\n // north – completes the basis (cross order also swapped for handedness)\r\n if (useRightHandedSystem) {\r\n Vector3.CrossToRef(refUp, refEast, refNorth);\r\n } else {\r\n Vector3.CrossToRef(refEast, refUp, refNorth);\r\n }\r\n refNorth.normalize();\r\n}\r\n"]}
|
package/Cameras/index.d.ts
CHANGED
|
@@ -21,5 +21,6 @@ export * from "./RigModes/index.js";
|
|
|
21
21
|
export * from "./geospatialCamera.js";
|
|
22
22
|
export * from "./inputMapper.js";
|
|
23
23
|
export * from "./cameraMovement.js";
|
|
24
|
+
export * from "./targetCameraMovement.js";
|
|
24
25
|
export * from "./geospatialCameraMovement.js";
|
|
25
26
|
export * from "./arcRotateCameraMovement.js";
|
package/Cameras/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export * from "./RigModes/index.js";
|
|
|
22
22
|
export * from "./geospatialCamera.js";
|
|
23
23
|
export * from "./inputMapper.js";
|
|
24
24
|
export * from "./cameraMovement.js";
|
|
25
|
+
export * from "./targetCameraMovement.js";
|
|
25
26
|
export * from "./geospatialCameraMovement.js";
|
|
26
27
|
export * from "./arcRotateCameraMovement.js";
|
|
27
28
|
//# sourceMappingURL=index.js.map
|
package/Cameras/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nexport * from \"./Inputs/index\";\r\nexport * from \"./cameraInputsManager\";\r\nexport * from \"./camera\";\r\nexport * from \"./targetCamera\";\r\nexport * from \"./freeCamera\";\r\nexport * from \"./freeCameraInputsManager\";\r\nexport * from \"./touchCamera\";\r\nexport * from \"./arcRotateCamera\";\r\nexport * from \"./arcRotateCameraInputsManager\";\r\nexport * from \"./deviceOrientationCamera\";\r\nexport * from \"./flyCamera\";\r\nexport * from \"./flyCameraInputsManager\";\r\nexport * from \"./followCamera\";\r\nexport * from \"./followCameraInputsManager\";\r\nexport * from \"./gamepadCamera\";\r\nexport * from \"./Stereoscopic/index\";\r\nexport * from \"./universalCamera\";\r\nexport * from \"./virtualJoysticksCamera\";\r\nexport * from \"./VR/index\";\r\nexport * from \"./RigModes/index\";\r\nexport * from \"./geospatialCamera\";\r\nexport * from \"./inputMapper\";\r\nexport * from \"./cameraMovement\";\r\nexport * from \"./geospatialCameraMovement\";\r\nexport * from \"./arcRotateCameraMovement\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-restricted-imports */\r\nexport * from \"./Inputs/index\";\r\nexport * from \"./cameraInputsManager\";\r\nexport * from \"./camera\";\r\nexport * from \"./targetCamera\";\r\nexport * from \"./freeCamera\";\r\nexport * from \"./freeCameraInputsManager\";\r\nexport * from \"./touchCamera\";\r\nexport * from \"./arcRotateCamera\";\r\nexport * from \"./arcRotateCameraInputsManager\";\r\nexport * from \"./deviceOrientationCamera\";\r\nexport * from \"./flyCamera\";\r\nexport * from \"./flyCameraInputsManager\";\r\nexport * from \"./followCamera\";\r\nexport * from \"./followCameraInputsManager\";\r\nexport * from \"./gamepadCamera\";\r\nexport * from \"./Stereoscopic/index\";\r\nexport * from \"./universalCamera\";\r\nexport * from \"./virtualJoysticksCamera\";\r\nexport * from \"./VR/index\";\r\nexport * from \"./RigModes/index\";\r\nexport * from \"./geospatialCamera\";\r\nexport * from \"./inputMapper\";\r\nexport * from \"./cameraMovement\";\r\nexport * from \"./targetCameraMovement\";\r\nexport * from \"./geospatialCameraMovement\";\r\nexport * from \"./arcRotateCameraMovement\";\r\n"]}
|
package/Cameras/pure.d.ts
CHANGED
|
@@ -22,5 +22,6 @@ export * from "./RigModes/pure.js";
|
|
|
22
22
|
export * from "./geospatialCamera.pure.js";
|
|
23
23
|
export * from "./inputMapper.js";
|
|
24
24
|
export * from "./cameraMovement.js";
|
|
25
|
+
export * from "./targetCameraMovement.js";
|
|
25
26
|
export * from "./geospatialCameraMovement.js";
|
|
26
27
|
export * from "./arcRotateCameraMovement.js";
|
package/Cameras/pure.js
CHANGED
|
@@ -23,6 +23,7 @@ export * from "./RigModes/pure.js";
|
|
|
23
23
|
export * from "./geospatialCamera.pure.js";
|
|
24
24
|
export * from "./inputMapper.js";
|
|
25
25
|
export * from "./cameraMovement.js";
|
|
26
|
+
export * from "./targetCameraMovement.js";
|
|
26
27
|
export * from "./geospatialCameraMovement.js";
|
|
27
28
|
export * from "./arcRotateCameraMovement.js";
|
|
28
29
|
//# sourceMappingURL=pure.js.map
|
package/Cameras/pure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,6DAA6D;AAC7D,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\n/* eslint-disable @typescript-eslint/no-restricted-imports */\nexport * from \"./Inputs/pure\";\nexport * from \"./cameraInputsManager\";\nexport * from \"./camera.pure\";\nexport * from \"./targetCamera.pure\";\nexport * from \"./freeCamera.pure\";\nexport * from \"./freeCameraInputsManager.pure\";\nexport * from \"./touchCamera.pure\";\nexport * from \"./arcRotateCamera.pure\";\nexport * from \"./arcRotateCameraInputsManager.pure\";\nexport * from \"./deviceOrientationCamera.pure\";\nexport * from \"./flyCamera.pure\";\nexport * from \"./flyCameraInputsManager\";\nexport * from \"./followCamera.pure\";\nexport * from \"./followCameraInputsManager\";\nexport * from \"./gamepadCamera.pure\";\nexport * from \"./Stereoscopic/pure\";\nexport * from \"./universalCamera.pure\";\nexport * from \"./virtualJoysticksCamera.pure\";\nexport * from \"./VR/pure\";\nexport * from \"./RigModes/pure\";\nexport * from \"./geospatialCamera.pure\";\nexport * from \"./inputMapper\";\nexport * from \"./cameraMovement\";\nexport * from \"./geospatialCameraMovement\";\nexport * from \"./arcRotateCameraMovement\";\n"]}
|
|
1
|
+
{"version":3,"file":"pure.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/pure.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,6DAA6D;AAC7D,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC","sourcesContent":["/** Pure barrel — re-exports only side-effect-free modules */\n/* eslint-disable @typescript-eslint/no-restricted-imports */\nexport * from \"./Inputs/pure\";\nexport * from \"./cameraInputsManager\";\nexport * from \"./camera.pure\";\nexport * from \"./targetCamera.pure\";\nexport * from \"./freeCamera.pure\";\nexport * from \"./freeCameraInputsManager.pure\";\nexport * from \"./touchCamera.pure\";\nexport * from \"./arcRotateCamera.pure\";\nexport * from \"./arcRotateCameraInputsManager.pure\";\nexport * from \"./deviceOrientationCamera.pure\";\nexport * from \"./flyCamera.pure\";\nexport * from \"./flyCameraInputsManager\";\nexport * from \"./followCamera.pure\";\nexport * from \"./followCameraInputsManager\";\nexport * from \"./gamepadCamera.pure\";\nexport * from \"./Stereoscopic/pure\";\nexport * from \"./universalCamera.pure\";\nexport * from \"./virtualJoysticksCamera.pure\";\nexport * from \"./VR/pure\";\nexport * from \"./RigModes/pure\";\nexport * from \"./geospatialCamera.pure\";\nexport * from \"./inputMapper\";\nexport * from \"./cameraMovement\";\nexport * from \"./targetCameraMovement\";\nexport * from \"./geospatialCameraMovement\";\nexport * from \"./arcRotateCameraMovement\";\n"]}
|
|
@@ -3,6 +3,7 @@ import { type Nullable } from "../types.js";
|
|
|
3
3
|
import { Camera } from "./camera.pure.js";
|
|
4
4
|
import { type Scene } from "../scene.pure.js";
|
|
5
5
|
import { Quaternion, Matrix, Vector3, Vector2 } from "../Maths/math.vector.pure.js";
|
|
6
|
+
import { type CameraMovement } from "./cameraMovement.js";
|
|
6
7
|
/**
|
|
7
8
|
* A target camera takes a mesh or position as a target and continues to look at it while it moves.
|
|
8
9
|
* This is the base of the follow, arc rotate cameras and Free camera
|
|
@@ -20,6 +21,30 @@ export declare class TargetCamera extends Camera {
|
|
|
20
21
|
* Define the current rotation the camera is rotating to
|
|
21
22
|
*/
|
|
22
23
|
cameraRotation: Vector2;
|
|
24
|
+
/**
|
|
25
|
+
* Framerate-independent movement controller shared by the TargetCamera family
|
|
26
|
+
* (FreeCamera/FlyCamera/FollowCamera). Provides inertial physics and the configurable
|
|
27
|
+
* input map. Subclasses may replace it with a specialized {@link CameraMovement}
|
|
28
|
+
* (for example ArcRotateCamera uses ArcRotateCameraMovement).
|
|
29
|
+
*/
|
|
30
|
+
movement: CameraMovement;
|
|
31
|
+
private _targetInertia;
|
|
32
|
+
/**
|
|
33
|
+
* Defines the inertia (decay coefficient applied per reference frame at 60fps) of the camera.
|
|
34
|
+
* This helps giving a smooth feeling to the camera movement.
|
|
35
|
+
*
|
|
36
|
+
* Override of {@link Camera.inertia} that writes through to the {@link movement} system so the
|
|
37
|
+
* framerate-independent pan/rotation glide stays in sync. Setting this updates the movement
|
|
38
|
+
* system immediately (matching the accessor convergence used by {@link ArcRotateCamera}).
|
|
39
|
+
*
|
|
40
|
+
* Backed by a local field rather than `super.inertia`: the shipped UMD bundle is compiled with
|
|
41
|
+
* TypeScript at `target: ES5`, and ES5 downleveling of `super` access inside a decorated accessor
|
|
42
|
+
* (the base {@link Camera.inertia} carries `@serialize()`) mis-compiles to `undefined`. That would
|
|
43
|
+
* feed `NaN` into the movement decay and freeze the camera. It only breaks in the ES5 UMD bundle;
|
|
44
|
+
* native-ESM dev keeps real `super`. See the `babylonjs/no-super-in-accessor` lint rule.
|
|
45
|
+
*/
|
|
46
|
+
get inertia(): number;
|
|
47
|
+
set inertia(value: number);
|
|
23
48
|
/**
|
|
24
49
|
* When set, the up vector of the camera will be updated by the rotation of the camera
|
|
25
50
|
*/
|