e4c44bf509562707abacdeb186e0856291da38e27433c580aecb45be37a2616d.json 138 KB

1
  1. {"ast":null,"code":"import { __decorate } from \"../tslib.es6.js\";\nimport { serialize, serializeAsVector3 } from \"../Misc/decorators.js\";\nimport { SmartArray } from \"../Misc/smartArray.js\";\nimport { Tools } from \"../Misc/tools.js\";\nimport { Observable } from \"../Misc/observable.js\";\nimport { Matrix, Vector3, Quaternion } from \"../Maths/math.vector.js\";\nimport { Node } from \"../node.js\";\nimport { Logger } from \"../Misc/logger.js\";\nimport { GetClass } from \"../Misc/typeStore.js\";\nimport { _WarnImport } from \"../Misc/devTools.js\";\nimport { Viewport } from \"../Maths/math.viewport.js\";\nimport { Frustum } from \"../Maths/math.frustum.js\";\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\n/**\n * This is the base class of all the camera used in the application.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\n */\nexport class Camera extends Node {\n /**\n * Define the current local position of the camera in the scene\n */\n get position() {\n return this._position;\n }\n set position(newPosition) {\n this._position = newPosition;\n }\n /**\n * The vector the camera should consider as up.\n * (default is Vector3(0, 1, 0) aka Vector3.Up())\n */\n set upVector(vec) {\n this._upVector = vec;\n }\n get upVector() {\n return this._upVector;\n }\n /**\n * The screen area in scene units squared\n */\n get screenArea() {\n let x = 0;\n let y = 0;\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\n if (this.fovMode === Camera.FOVMODE_VERTICAL_FIXED) {\n y = this.minZ * 2 * Math.tan(this.fov / 2);\n x = this.getEngine().getAspectRatio(this) * y;\n } else {\n x = this.minZ * 2 * Math.tan(this.fov / 2);\n y = x / this.getEngine().getAspectRatio(this);\n }\n } else {\n var _this$orthoRight, _this$orthoLeft, _this$orthoTop, _this$orthoBottom;\n const halfWidth = this.getEngine().getRenderWidth() / 2.0;\n const halfHeight = this.getEngine().getRenderHeight() / 2.0;\n x = ((_this$orthoRight = this.orthoRight) !== null && _this$orthoRight !== void 0 ? _this$orthoRight : halfWidth) - ((_this$orthoLeft = this.orthoLeft) !== null && _this$orthoLeft !== void 0 ? _this$orthoLeft : -halfWidth);\n y = ((_this$orthoTop = this.orthoTop) !== null && _this$orthoTop !== void 0 ? _this$orthoTop : halfHeight) - ((_this$orthoBottom = this.orthoBottom) !== null && _this$orthoBottom !== void 0 ? _this$orthoBottom : -halfHeight);\n }\n return x * y;\n }\n /**\n * Define the current limit on the left side for an orthographic camera\n * In scene unit\n */\n set orthoLeft(value) {\n this._orthoLeft = value;\n for (const rigCamera of this._rigCameras) {\n rigCamera.orthoLeft = value;\n }\n }\n get orthoLeft() {\n return this._orthoLeft;\n }\n /**\n * Define the current limit on the right side for an orthographic camera\n * In scene unit\n */\n set orthoRight(value) {\n this._orthoRight = value;\n for (const rigCamera of this._rigCameras) {\n rigCamera.orthoRight = value;\n }\n }\n get orthoRight() {\n return this._orthoRight;\n }\n /**\n * Define the current limit on the bottom side for an orthographic camera\n * In scene unit\n */\n set orthoBottom(value) {\n this._orthoBottom = value;\n for (const rigCamera of this._rigCameras) {\n rigCamera.orthoBottom = value;\n }\n }\n get orthoBottom() {\n return this._orthoBottom;\n }\n /**\n * Define the current limit on the top side for an orthographic camera\n * In scene unit\n */\n set orthoTop(value) {\n this._orthoTop = value;\n for (const rigCamera of this._rigCameras) {\n rigCamera.orthoTop = value;\n }\n }\n get orthoTop() {\n return this._orthoTop;\n }\n /**\n * Define the mode of the camera (Camera.PERSPECTIVE_CAMERA or Camera.ORTHOGRAPHIC_CAMERA)\n */\n set mode(mode) {\n this._mode = mode;\n // Pass the mode down to the rig cameras\n for (const rigCamera of this._rigCameras) {\n rigCamera.mode = mode;\n }\n }\n get mode() {\n return this._mode;\n }\n /**\n * Gets a flag indicating that the camera has moved in some way since the last call to Camera.update()\n */\n get hasMoved() {\n return this._hasMoved;\n }\n /**\n * Instantiates a new camera object.\n * This should not be used directly but through the inherited cameras: ArcRotate, Free...\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\n * @param name Defines the name of the camera in the scene\n * @param position Defines the position of the camera\n * @param scene Defines the scene the camera belongs too\n * @param setActiveOnSceneIfNoneActive Defines if the camera should be set as active after creation if no other camera have been defined in the scene\n */\n constructor(name, position, scene, setActiveOnSceneIfNoneActive = true) {\n super(name, scene, false);\n /** @internal */\n this._position = Vector3.Zero();\n this._upVector = Vector3.Up();\n /**\n * Object containing oblique projection values (only used with ORTHOGRAPHIC_CAMERA)\n */\n this.oblique = null;\n this._orthoLeft = null;\n this._orthoRight = null;\n this._orthoBottom = null;\n this._orthoTop = null;\n /**\n * Field Of View is set in Radians. (default is 0.8)\n */\n this.fov = 0.8;\n /**\n * Projection plane tilt around the X axis (horizontal), set in Radians. (default is 0)\n * Can be used to make vertical lines in world space actually vertical on the screen.\n * See https://forum.babylonjs.com/t/add-vertical-shift-to-3ds-max-exporter-babylon-cameras/17480\n */\n this.projectionPlaneTilt = 0;\n /**\n * Define the minimum distance the camera can see from.\n * This is important to note that the depth buffer are not infinite and the closer it starts\n * the more your scene might encounter depth fighting issue.\n */\n this.minZ = 1;\n /**\n * Define the maximum distance the camera can see to.\n * This is important to note that the depth buffer are not infinite and the further it end\n * the more your scene might encounter depth fighting issue.\n */\n this.maxZ = 10000.0;\n /**\n * Define the default inertia of the camera.\n * This helps giving a smooth feeling to the camera movement.\n */\n this.inertia = 0.9;\n this._mode = Camera.PERSPECTIVE_CAMERA;\n /**\n * Define whether the camera is intermediate.\n * This is useful to not present the output directly to the screen in case of rig without post process for instance\n */\n this.isIntermediate = false;\n /**\n * Define the viewport of the camera.\n * This correspond to the portion of the screen the camera will render to in normalized 0 to 1 unit.\n */\n this.viewport = new Viewport(0, 0, 1.0, 1.0);\n /**\n * Restricts the camera to viewing objects with the same layerMask.\n * A camera with a layerMask of 1 will render mesh.layerMask & camera.layerMask!== 0\n */\n this.layerMask = 0x0fffffff;\n /**\n * fovMode sets the camera frustum bounds to the viewport bounds. (default is FOVMODE_VERTICAL_FIXED)\n */\n this.fovMode = Camera.FOVMODE_VERTICAL_FIXED;\n /**\n * Rig mode of the camera.\n * This is useful to create the camera with two \"eyes\" instead of one to create VR or stereoscopic scenes.\n * This is normally controlled byt the camera themselves as internal use.\n */\n this.cameraRigMode = Camera.RIG_MODE_NONE;\n /**\n * Defines the list of custom render target which are rendered to and then used as the input to this camera's render. Eg. display another camera view on a TV in the main scene\n * This is pretty helpful if you wish to make a camera render to a texture you could reuse somewhere\n * else in the scene. (Eg. security camera)\n *\n * To change the final output target of the camera, camera.outputRenderTarget should be used instead (eg. webXR renders to a render target corresponding to an HMD)\n */\n this.customRenderTargets = [];\n /**\n * When set, the camera will render to this render target instead of the default canvas\n *\n * If the desire is to use the output of a camera as a texture in the scene consider using camera.customRenderTargets instead\n */\n this.outputRenderTarget = null;\n /**\n * Observable triggered when the camera view matrix has changed.\n * Beware of reentrance! Some methods like Camera.getViewMatrix and Camera.getWorldMatrix can trigger the onViewMatrixChangedObservable\n * observable, so using them inside an observer will require additional logic to avoid a stack overflow error.\n */\n this.onViewMatrixChangedObservable = new Observable();\n /**\n * Observable triggered when the camera Projection matrix has changed.\n */\n this.onProjectionMatrixChangedObservable = new Observable();\n /**\n * Observable triggered when the inputs have been processed.\n */\n this.onAfterCheckInputsObservable = new Observable();\n /**\n * Observable triggered when reset has been called and applied to the camera.\n */\n this.onRestoreStateObservable = new Observable();\n /**\n * Is this camera a part of a rig system?\n */\n this.isRigCamera = false;\n this._hasMoved = false;\n /** @internal */\n this._rigCameras = new Array();\n /** @internal */\n this._skipRendering = false;\n /** @internal */\n this._projectionMatrix = new Matrix();\n /** @internal */\n this._postProcesses = new Array();\n /** @internal */\n this._activeMeshes = new SmartArray(256);\n this._globalPosition = Vector3.Zero();\n /** @internal */\n this._computedViewMatrix = Matrix.Identity();\n this._doNotComputeProjectionMatrix = false;\n this._transformMatrix = Matrix.Zero();\n this._refreshFrustumPlanes = true;\n this._absoluteRotation = Quaternion.Identity();\n /** @internal */\n this._isCamera = true;\n /** @internal */\n this._isLeftCamera = false;\n /** @internal */\n this._isRightCamera = false;\n this.getScene().addCamera(this);\n if (setActiveOnSceneIfNoneActive && !this.getScene().activeCamera) {\n this.getScene().activeCamera = this;\n }\n this.position = position;\n this.renderPassId = this.getScene().getEngine().createRenderPassId(`Camera ${name}`);\n }\n /**\n * Store current camera state (fov, position, etc..)\n * @returns the camera\n */\n storeState() {\n this._stateStored = true;\n this._storedFov = this.fov;\n return this;\n }\n /**\n * Returns true if a state has been stored by calling storeState method.\n * @returns true if state has been stored.\n */\n hasStateStored() {\n return !!this._stateStored;\n }\n /**\n * Restores the camera state values if it has been stored. You must call storeState() first\n * @returns true if restored and false otherwise\n */\n _restoreStateValues() {\n if (!this._stateStored) {\n return false;\n }\n this.fov = this._storedFov;\n return true;\n }\n /**\n * Restored camera state. You must call storeState() first.\n * @returns true if restored and false otherwise\n */\n restoreState() {\n if (this._restoreStateValues()) {\n this.onRestoreStateObservable.notifyObservers(this);\n return true;\n }\n return false;\n }\n /**\n * Gets the class name of the camera.\n * @returns the class name\n */\n getClassName() {\n return \"Camera\";\n }\n /**\n * Gets a string representation of the camera useful for debug purpose.\n * @param fullDetails Defines that a more verbose level of logging is required\n * @returns the string representation\n */\n toString(fullDetails) {\n let ret = \"Name: \" + this.name;\n ret += \", type: \" + this.getClassName();\n if (this.animations) {\n for (let i = 0; i < this.animations.length; i++) {\n ret += \", animation[0]: \" + this.animations[i].toString(fullDetails);\n }\n }\n return ret;\n }\n /**\n * Automatically tilts the projection plane, using `projectionPlaneTilt`, to correct the perspective effect on vertical lines.\n */\n applyVerticalCorrection() {\n const rot = this.absoluteRotation.toEulerAngles();\n this.projectionPlaneTilt = this._scene.useRightHandedSystem ? -rot.x : rot.x;\n }\n /**\n * Gets the current world space position of the camera.\n */\n get globalPosition() {\n return this._globalPosition;\n }\n /**\n * Gets the list of active meshes this frame (meshes no culled or excluded by lod s in the frame)\n * @returns the active meshe list\n */\n getActiveMeshes() {\n return this._activeMeshes;\n }\n /**\n * Check whether a mesh is part of the current active mesh list of the camera\n * @param mesh Defines the mesh to check\n * @returns true if active, false otherwise\n */\n isActiveMesh(mesh) {\n return this._activeMeshes.indexOf(mesh) !== -1;\n }\n /**\n * Is this camera ready to be used/rendered\n * @param completeCheck defines if a complete check (including post processes) has to be done (false by default)\n * @returns true if the camera is ready\n */\n isReady(completeCheck = false) {\n if (completeCheck) {\n for (const pp of this._postProcesses) {\n if (pp && !pp.isReady()) {\n return false;\n }\n }\n }\n return super.isReady(completeCheck);\n }\n /** @internal */\n _initCache() {\n super._initCache();\n this._cache.position = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n this._cache.upVector = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n this._cache.mode = undefined;\n this._cache.minZ = undefined;\n this._cache.maxZ = undefined;\n this._cache.fov = undefined;\n this._cache.fovMode = undefined;\n this._cache.aspectRatio = undefined;\n this._cache.orthoLeft = undefined;\n this._cache.orthoRight = undefined;\n this._cache.orthoBottom = undefined;\n this._cache.orthoTop = undefined;\n this._cache.obliqueAngle = undefined;\n this._cache.obliqueLength = undefined;\n this._cache.obliqueOffset = undefined;\n this._cache.renderWidth = undefined;\n this._cache.renderHeight = undefined;\n }\n /**\n * @internal\n */\n _updateCache(ignoreParentClass) {\n if (!ignoreParentClass) {\n super._updateCache();\n }\n this._cache.position.copyFrom(this.position);\n this._cache.upVector.copyFrom(this.upVector);\n }\n /** @internal */\n _isSynchronized() {\n return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();\n }\n /** @internal */\n _isSynchronizedViewMatrix() {\n if (!super._isSynchronized()) {\n return false;\n }\n return this._cache.position.equals(this.position) && this._cache.upVector.equals(this.upVector) && this.isSynchronizedWithParent();\n }\n /** @internal */\n _isSynchronizedProjectionMatrix() {\n let isSynchronized = this._cache.mode === this.mode && this._cache.minZ === this.minZ && this._cache.maxZ === this.maxZ;\n if (!isSynchronized) {\n return false;\n }\n const engine = this.getEngine();\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\n isSynchronized = this._cache.fov === this.fov && this._cache.fovMode === this.fovMode && this._cache.aspectRatio === engine.getAspectRatio(this) && this._cache.projectionPlaneTilt === this.projectionPlaneTilt;\n } else {\n isSynchronized = this._cache.orthoLeft === this.orthoLeft && this._cache.orthoRight === this.orthoRight && this._cache.orthoBottom === this.orthoBottom && this._cache.orthoTop === this.orthoTop && this._cache.renderWidth === engine.getRenderWidth() && this._cache.renderHeight === engine.getRenderHeight();\n if (this.oblique) {\n isSynchronized = isSynchronized && this._cache.obliqueAngle === this.oblique.angle && this._cache.obliqueLength === this.oblique.length && this._cache.obliqueOffset === this.oblique.offset;\n }\n }\n return isSynchronized;\n }\n /**\n * Attach the input controls to a specific dom element to get the input from.\n * This function is here because typescript removes the typing of the last function.\n * @param _ignored defines an ignored parameter kept for backward compatibility.\n * @param _noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)\n */\n attachControl(_ignored, _noPreventDefault) {}\n /**\n * Detach the current controls from the specified dom element.\n * This function is here because typescript removes the typing of the last function.\n * @param _ignored defines an ignored parameter kept for backward compatibility.\n */\n detachControl(_ignored) {}\n /**\n * Update the camera state according to the different inputs gathered during the frame.\n */\n update() {\n this._hasMoved = false;\n this._checkInputs();\n if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\n this._updateRigCameras();\n }\n // Attempt to update the camera's view and projection matrices.\n // This call is being made because these matrices are no longer being updated\n // as a part of the picking ray process (in addition to scene.render).\n this.getViewMatrix();\n this.getProjectionMatrix();\n }\n /** @internal */\n _checkInputs() {\n this.onAfterCheckInputsObservable.notifyObservers(this);\n }\n /** @internal */\n get rigCameras() {\n return this._rigCameras;\n }\n /**\n * Gets the post process used by the rig cameras\n */\n get rigPostProcess() {\n return this._rigPostProcess;\n }\n /**\n * Internal, gets the first post process.\n * @returns the first post process to be run on this camera.\n */\n _getFirstPostProcess() {\n for (let ppIndex = 0; ppIndex < this._postProcesses.length; ppIndex++) {\n if (this._postProcesses[ppIndex] !== null) {\n return this._postProcesses[ppIndex];\n }\n }\n return null;\n }\n _cascadePostProcessesToRigCams() {\n // invalidate framebuffer\n const firstPostProcess = this._getFirstPostProcess();\n if (firstPostProcess) {\n firstPostProcess.markTextureDirty();\n }\n // glue the rigPostProcess to the end of the user postprocesses & assign to each sub-camera\n for (let i = 0, len = this._rigCameras.length; i < len; i++) {\n const cam = this._rigCameras[i];\n const rigPostProcess = cam._rigPostProcess;\n // for VR rig, there does not have to be a post process\n if (rigPostProcess) {\n const isPass = rigPostProcess.getEffectName() === \"pass\";\n if (isPass) {\n // any rig which has a PassPostProcess for rig[0], cannot be isIntermediate when there are also user postProcesses\n cam.isIntermediate = this._postProcesses.length === 0;\n }\n cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess);\n rigPostProcess.markTextureDirty();\n } else {\n cam._postProcesses = this._postProcesses.slice(0);\n }\n }\n }\n /**\n * Attach a post process to the camera.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess\n * @param postProcess The post process to attach to the camera\n * @param insertAt The position of the post process in case several of them are in use in the scene\n * @returns the position the post process has been inserted at\n */\n attachPostProcess(postProcess, insertAt = null) {\n if (!postProcess.isReusable() && this._postProcesses.indexOf(postProcess) > -1) {\n Logger.Error(\"You're trying to reuse a post process not defined as reusable.\");\n return 0;\n }\n if (insertAt == null || insertAt < 0) {\n this._postProcesses.push(postProcess);\n } else if (this._postProcesses[insertAt] === null) {\n this._postProcesses[insertAt] = postProcess;\n } else {\n this._postProcesses.splice(insertAt, 0, postProcess);\n }\n this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated\n // Update prePass\n if (this._scene.prePassRenderer) {\n this._scene.prePassRenderer.markAsDirty();\n }\n return this._postProcesses.indexOf(postProcess);\n }\n /**\n * Detach a post process to the camera.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess\n * @param postProcess The post process to detach from the camera\n */\n detachPostProcess(postProcess) {\n const idx = this._postProcesses.indexOf(postProcess);\n if (idx !== -1) {\n this._postProcesses[idx] = null;\n }\n // Update prePass\n if (this._scene.prePassRenderer) {\n this._scene.prePassRenderer.markAsDirty();\n }\n this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated\n }\n /**\n * Gets the current world matrix of the camera\n * @returns the world matrix\n */\n getWorldMatrix() {\n if (this._isSynchronizedViewMatrix()) {\n return this._worldMatrix;\n }\n // Getting the view matrix will also compute the world matrix.\n this.getViewMatrix();\n return this._worldMatrix;\n }\n /** @internal */\n _getViewMatrix() {\n return Matrix.Identity();\n }\n /**\n * Gets the current view matrix of the camera.\n * @param force forces the camera to recompute the matrix without looking at the cached state\n * @returns the view matrix\n */\n getViewMatrix(force) {\n if (!force && this._isSynchronizedViewMatrix()) {\n return this._computedViewMatrix;\n }\n this._hasMoved = true;\n this.updateCache();\n this._computedViewMatrix = this._getViewMatrix();\n this._currentRenderId = this.getScene().getRenderId();\n this._childUpdateId++;\n this._refreshFrustumPlanes = true;\n if (this._cameraRigParams && this._cameraRigParams.vrPreViewMatrix) {\n this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix, this._computedViewMatrix);\n }\n // Notify parent camera if rig camera is changed\n if (this.parent && this.parent.onViewMatrixChangedObservable) {\n this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent);\n }\n this.onViewMatrixChangedObservable.notifyObservers(this);\n this._computedViewMatrix.invertToRef(this._worldMatrix);\n return this._computedViewMatrix;\n }\n /**\n * Freeze the projection matrix.\n * It will prevent the cache check of the camera projection compute and can speed up perf\n * if no parameter of the camera are meant to change\n * @param projection Defines manually a projection if necessary\n */\n freezeProjectionMatrix(projection) {\n this._doNotComputeProjectionMatrix = true;\n if (projection !== undefined) {\n this._projectionMatrix = projection;\n }\n }\n /**\n * Unfreeze the projection matrix if it has previously been freezed by freezeProjectionMatrix.\n */\n unfreezeProjectionMatrix() {\n this._doNotComputeProjectionMatrix = false;\n }\n /**\n * Gets the current projection matrix of the camera.\n * @param force forces the camera to recompute the matrix without looking at the cached state\n * @returns the projection matrix\n */\n getProjectionMatrix(force) {\n if (this._doNotComputeProjectionMatrix || !force && this._isSynchronizedProjectionMatrix()) {\n return this._projectionMatrix;\n }\n // Cache\n this._cache.mode = this.mode;\n this._cache.minZ = this.minZ;\n this._cache.maxZ = this.maxZ;\n // Matrix\n this._refreshFrustumPlanes = true;\n const engine = this.getEngine();\n const scene = this.getScene();\n const reverseDepth = engine.useReverseDepthBuffer;\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\n this._cache.fov = this.fov;\n this._cache.fovMode = this.fovMode;\n this._cache.aspectRatio = engine.getAspectRatio(this);\n this._cache.projectionPlaneTilt = this.projectionPlaneTilt;\n if (this.minZ <= 0) {\n this.minZ = 0.1;\n }\n let getProjectionMatrix;\n if (scene.useRightHandedSystem) {\n getProjectionMatrix = Matrix.PerspectiveFovRHToRef;\n } else {\n getProjectionMatrix = Matrix.PerspectiveFovLHToRef;\n }\n getProjectionMatrix(this.fov, engine.getAspectRatio(this), reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, this.fovMode === Camera.FOVMODE_VERTICAL_FIXED, engine.isNDCHalfZRange, this.projectionPlaneTilt, reverseDepth);\n } else {\n var _this$oblique, _this$oblique2, _this$oblique3;\n const halfWidth = engine.getRenderWidth() / 2.0;\n const halfHeight = engine.getRenderHeight() / 2.0;\n if (scene.useRightHandedSystem) {\n if (this.oblique) {\n var _this$orthoLeft2, _this$orthoRight2, _this$orthoBottom2, _this$orthoTop2;\n Matrix.ObliqueOffCenterRHToRef((_this$orthoLeft2 = this.orthoLeft) !== null && _this$orthoLeft2 !== void 0 ? _this$orthoLeft2 : -halfWidth, (_this$orthoRight2 = this.orthoRight) !== null && _this$orthoRight2 !== void 0 ? _this$orthoRight2 : halfWidth, (_this$orthoBottom2 = this.orthoBottom) !== null && _this$orthoBottom2 !== void 0 ? _this$orthoBottom2 : -halfHeight, (_this$orthoTop2 = this.orthoTop) !== null && _this$orthoTop2 !== void 0 ? _this$orthoTop2 : halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this.oblique.length, this.oblique.angle, this._computeObliqueDistance(this.oblique.offset), this._projectionMatrix, engine.isNDCHalfZRange);\n } else {\n var _this$orthoLeft3, _this$orthoRight3, _this$orthoBottom3, _this$orthoTop3;\n Matrix.OrthoOffCenterRHToRef((_this$orthoLeft3 = this.orthoLeft) !== null && _this$orthoLeft3 !== void 0 ? _this$orthoLeft3 : -halfWidth, (_this$orthoRight3 = this.orthoRight) !== null && _this$orthoRight3 !== void 0 ? _this$orthoRight3 : halfWidth, (_this$orthoBottom3 = this.orthoBottom) !== null && _this$orthoBottom3 !== void 0 ? _this$orthoBottom3 : -halfHeight, (_this$orthoTop3 = this.orthoTop) !== null && _this$orthoTop3 !== void 0 ? _this$orthoTop3 : halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, engine.isNDCHalfZRange);\n }\n } else {\n if (this.oblique) {\n var _this$orthoLeft4, _this$orthoRight4, _this$orthoBottom4, _this$orthoTop4;\n Matrix.ObliqueOffCenterLHToRef((_this$orthoLeft4 = this.orthoLeft) !== null && _this$orthoLeft4 !== void 0 ? _this$orthoLeft4 : -halfWidth, (_this$orthoRight4 = this.orthoRight) !== null && _this$orthoRight4 !== void 0 ? _this$orthoRight4 : halfWidth, (_this$orthoBottom4 = this.orthoBottom) !== null && _this$orthoBottom4 !== void 0 ? _this$orthoBottom4 : -halfHeight, (_this$orthoTop4 = this.orthoTop) !== null && _this$orthoTop4 !== void 0 ? _this$orthoTop4 : halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this.oblique.length, this.oblique.angle, this._computeObliqueDistance(this.oblique.offset), this._projectionMatrix, engine.isNDCHalfZRange);\n } else {\n var _this$orthoLeft5, _this$orthoRight5, _this$orthoBottom5, _this$orthoTop5;\n Matrix.OrthoOffCenterLHToRef((_this$orthoLeft5 = this.orthoLeft) !== null && _this$orthoLeft5 !== void 0 ? _this$orthoLeft5 : -halfWidth, (_this$orthoRight5 = this.orthoRight) !== null && _this$orthoRight5 !== void 0 ? _this$orthoRight5 : halfWidth, (_this$orthoBottom5 = this.orthoBottom) !== null && _this$orthoBottom5 !== void 0 ? _this$orthoBottom5 : -halfHeight, (_this$orthoTop5 = this.orthoTop) !== null && _this$orthoTop5 !== void 0 ? _this$orthoTop5 : halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, engine.isNDCHalfZRange);\n }\n }\n this._cache.orthoLeft = this.orthoLeft;\n this._cache.orthoRight = this.orthoRight;\n this._cache.orthoBottom = this.orthoBottom;\n this._cache.orthoTop = this.orthoTop;\n this._cache.obliqueAngle = (_this$oblique = this.oblique) === null || _this$oblique === void 0 ? void 0 : _this$oblique.angle;\n this._cache.obliqueLength = (_this$oblique2 = this.oblique) === null || _this$oblique2 === void 0 ? void 0 : _this$oblique2.length;\n this._cache.obliqueOffset = (_this$oblique3 = this.oblique) === null || _this$oblique3 === void 0 ? void 0 : _this$oblique3.offset;\n this._cache.renderWidth = engine.getRenderWidth();\n this._cache.renderHeight = engine.getRenderHeight();\n }\n this.onProjectionMatrixChangedObservable.notifyObservers(this);\n return this._projectionMatrix;\n }\n /**\n * Gets the transformation matrix (ie. the multiplication of view by projection matrices)\n * @returns a Matrix\n */\n getTransformationMatrix() {\n this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);\n return this._transformMatrix;\n }\n _computeObliqueDistance(offset) {\n const arcRotateCamera = this;\n const targetCamera = this;\n return (arcRotateCamera.radius || (targetCamera.target ? Vector3.Distance(this.position, targetCamera.target) : this.position.length())) + offset;\n }\n /** @internal */\n _updateFrustumPlanes() {\n if (!this._refreshFrustumPlanes) {\n return;\n }\n this.getTransformationMatrix();\n if (!this._frustumPlanes) {\n this._frustumPlanes = Frustum.GetPlanes(this._transformMatrix);\n } else {\n Frustum.GetPlanesToRef(this._transformMatrix, this._frustumPlanes);\n }\n this._refreshFrustumPlanes = false;\n }\n /**\n * Checks if a cullable object (mesh...) is in the camera frustum\n * This checks the bounding box center. See isCompletelyInFrustum for a full bounding check\n * @param target The object to check\n * @param checkRigCameras If the rig cameras should be checked (eg. with VR camera both eyes should be checked) (Default: false)\n * @returns true if the object is in frustum otherwise false\n */\n isInFrustum(target, checkRigCameras = false) {\n this._updateFrustumPlanes();\n if (checkRigCameras && this.rigCameras.length > 0) {\n let result = false;\n this.rigCameras.forEach(cam => {\n cam._updateFrustumPlanes();\n result = result || target.isInFrustum(cam._frustumPlanes);\n });\n return result;\n } else {\n return target.isInFrustum(this._frustumPlanes);\n }\n }\n /**\n * Checks if a cullable object (mesh...) is in the camera frustum\n * Unlike isInFrustum this checks the full bounding box\n * @param target The object to check\n * @returns true if the object is in frustum otherwise false\n */\n isCompletelyInFrustum(target) {\n this._updateFrustumPlanes();\n return target.isCompletelyInFrustum(this._frustumPlanes);\n }\n // eslint-disable-next-line jsdoc/require-returns-check\n /**\n * Gets a ray in the forward direction from the camera.\n * @param length Defines the length of the ray to create\n * @param transform Defines the transform to apply to the ray, by default the world matrix is used to create a workd space ray\n * @param origin Defines the start point of the ray which defaults to the camera position\n * @returns the forward ray\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getForwardRay(length = 100, transform, origin) {\n throw _WarnImport(\"Ray\");\n }\n // eslint-disable-next-line jsdoc/require-returns-check\n /**\n * Gets a ray in the forward direction from the camera.\n * @param refRay the ray to (re)use when setting the values\n * @param length Defines the length of the ray to create\n * @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray\n * @param origin Defines the start point of the ray which defaults to the camera position\n * @returns the forward ray\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getForwardRayToRef(refRay, length = 100, transform, origin) {\n throw _WarnImport(\"Ray\");\n }\n /**\n * Releases resources associated with this node.\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\n * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)\n */\n dispose(doNotRecurse, disposeMaterialAndTextures = false) {\n // Observables\n this.onViewMatrixChangedObservable.clear();\n this.onProjectionMatrixChangedObservable.clear();\n this.onAfterCheckInputsObservable.clear();\n this.onRestoreStateObservable.clear();\n // Inputs\n if (this.inputs) {\n this.inputs.clear();\n }\n // Animations\n this.getScene().stopAnimation(this);\n // Remove from scene\n this.getScene().removeCamera(this);\n while (this._rigCameras.length > 0) {\n const camera = this._rigCameras.pop();\n if (camera) {\n camera.dispose();\n }\n }\n if (this._parentContainer) {\n const index = this._parentContainer.cameras.indexOf(this);\n if (index > -1) {\n this._parentContainer.cameras.splice(index, 1);\n }\n this._parentContainer = null;\n }\n // Postprocesses\n if (this._rigPostProcess) {\n this._rigPostProcess.dispose(this);\n this._rigPostProcess = null;\n this._postProcesses.length = 0;\n } else if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\n this._rigPostProcess = null;\n this._postProcesses.length = 0;\n } else {\n let i = this._postProcesses.length;\n while (--i >= 0) {\n const postProcess = this._postProcesses[i];\n if (postProcess) {\n postProcess.dispose(this);\n }\n }\n }\n // Render targets\n let i = this.customRenderTargets.length;\n while (--i >= 0) {\n this.customRenderTargets[i].dispose();\n }\n this.customRenderTargets.length = 0;\n // Active Meshes\n this._activeMeshes.dispose();\n this.getScene().getEngine().releaseRenderPassId(this.renderPassId);\n super.dispose(doNotRecurse, disposeMaterialAndTextures);\n }\n /**\n * Gets the left camera of a rig setup in case of Rigged Camera\n */\n get isLeftCamera() {\n return this._isLeftCamera;\n }\n /**\n * Gets the right camera of a rig setup in case of Rigged Camera\n */\n get isRightCamera() {\n return this._isRightCamera;\n }\n /**\n * Gets the left camera of a rig setup in case of Rigged Camera\n */\n get leftCamera() {\n if (this._rigCameras.length < 1) {\n return null;\n }\n return this._rigCameras[0];\n }\n /**\n * Gets the right camera of a rig setup in case of Rigged Camera\n */\n get rightCamera() {\n if (this._rigCameras.length < 2) {\n return null;\n }\n return this._rigCameras[1];\n }\n /**\n * Gets the left camera target of a rig setup in case of Rigged Camera\n * @returns the target position\n */\n getLeftTarget() {\n if (this._rigCameras.length < 1) {\n return null;\n }\n return this._rigCameras[0].getTarget();\n }\n /**\n * Gets the right camera target of a rig setup in case of Rigged Camera\n * @returns the target position\n */\n getRightTarget() {\n if (this._rigCameras.length < 2) {\n return null;\n }\n return this._rigCameras[1].getTarget();\n }\n /**\n * @internal\n */\n setCameraRigMode(mode, rigParams) {\n if (this.cameraRigMode === mode) {\n return;\n }\n while (this._rigCameras.length > 0) {\n const camera = this._rigCameras.pop();\n if (camera) {\n camera.dispose();\n }\n }\n this.cameraRigMode = mode;\n this._cameraRigParams = {};\n //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target,\n //not from a given angle as it is now, but until that complete code rewriting provisional stereoHalfAngle value is introduced\n this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637;\n this._cameraRigParams.stereoHalfAngle = Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);\n // create the rig cameras, unless none\n if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\n const leftCamera = this.createRigCamera(this.name + \"_L\", 0);\n if (leftCamera) {\n leftCamera._isLeftCamera = true;\n }\n const rightCamera = this.createRigCamera(this.name + \"_R\", 1);\n if (rightCamera) {\n rightCamera._isRightCamera = true;\n }\n if (leftCamera && rightCamera) {\n this._rigCameras.push(leftCamera);\n this._rigCameras.push(rightCamera);\n }\n }\n this._setRigMode(rigParams);\n this._cascadePostProcessesToRigCams();\n this.update();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _setRigMode(rigParams) {\n // no-op\n }\n /** @internal */\n _getVRProjectionMatrix() {\n Matrix.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix, true, this.getEngine().isNDCHalfZRange);\n this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix);\n return this._projectionMatrix;\n }\n /**\n * @internal\n */\n setCameraRigParameter(name, value) {\n if (!this._cameraRigParams) {\n this._cameraRigParams = {};\n }\n this._cameraRigParams[name] = value;\n //provisionnally:\n if (name === \"interaxialDistance\") {\n this._cameraRigParams.stereoHalfAngle = Tools.ToRadians(value / 0.0637);\n }\n }\n /**\n * needs to be overridden by children so sub has required properties to be copied\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n createRigCamera(name, cameraIndex) {\n return null;\n }\n /**\n * May need to be overridden by children\n * @internal\n */\n _updateRigCameras() {\n for (let i = 0; i < this._rigCameras.length; i++) {\n this._rigCameras[i].minZ = this.minZ;\n this._rigCameras[i].maxZ = this.maxZ;\n this._rigCameras[i].fov = this.fov;\n this._rigCameras[i].upVector.copyFrom(this.upVector);\n }\n // only update viewport when ANAGLYPH\n if (this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH) {\n this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport;\n }\n }\n /** @internal */\n _setupInputs() {}\n /**\n * Serialiaze the camera setup to a json representation\n * @returns the JSON representation\n */\n serialize() {\n const serializationObject = SerializationHelper.Serialize(this);\n serializationObject.uniqueId = this.uniqueId;\n // Type\n serializationObject.type = this.getClassName();\n // Parent\n if (this.parent) {\n this.parent._serializeAsParent(serializationObject);\n }\n if (this.inputs) {\n this.inputs.serialize(serializationObject);\n }\n // Animations\n SerializationHelper.AppendSerializedAnimations(this, serializationObject);\n serializationObject.ranges = this.serializeAnimationRanges();\n serializationObject.isEnabled = this.isEnabled();\n return serializationObject;\n }\n /**\n * Clones the current camera.\n * @param name The cloned camera name\n * @param newParent The cloned camera's new parent (none by default)\n * @returns the cloned camera\n */\n clone(name, newParent = null) {\n const camera = SerializationHelper.Clone(Camera.GetConstructorFromName(this.getClassName(), name, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this);\n camera.name = name;\n camera.parent = newParent;\n this.onClonedObservable.notifyObservers(camera);\n return camera;\n }\n /**\n * Gets the direction of the camera relative to a given local axis.\n * @param localAxis Defines the reference axis to provide a relative direction.\n * @returns the direction\n */\n getDirection(localAxis) {\n const result = Vector3.Zero();\n this.getDirectionToRef(localAxis, result);\n return result;\n }\n /**\n * Returns the current camera absolute rotation\n */\n get absoluteRotation() {\n this.getWorldMatrix().decompose(undefined, this._absoluteRotation);\n return this._absoluteRotation;\n }\n /**\n * Gets the direction of the camera relative to a given local axis into a passed vector.\n * @param localAxis Defines the reference axis to provide a relative direction.\n * @param result Defines the vector to store the result in\n */\n getDirectionToRef(localAxis, result) {\n Vector3.TransformNormalToRef(localAxis, this.getWorldMatrix(), result);\n }\n /**\n * Gets a camera constructor for a given camera type\n * @param type The type of the camera to construct (should be equal to one of the camera class name)\n * @param name The name of the camera the result will be able to instantiate\n * @param scene The scene the result will construct the camera in\n * @param interaxial_distance In case of stereoscopic setup, the distance between both eyes\n * @param isStereoscopicSideBySide In case of stereoscopic setup, should the sereo be side b side\n * @returns a factory method to construct the camera\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n static GetConstructorFromName(type, name, scene, interaxial_distance = 0, isStereoscopicSideBySide = true) {\n const constructorFunc = Node.Construct(type, name, scene, {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n interaxial_distance: interaxial_distance,\n isStereoscopicSideBySide: isStereoscopicSideBySide\n });\n if (constructorFunc) {\n return constructorFunc;\n }\n // Default to universal camera\n return () => Camera._CreateDefaultParsedCamera(name, scene);\n }\n /**\n * Compute the world matrix of the camera.\n * @returns the camera world matrix\n */\n computeWorldMatrix() {\n return this.getWorldMatrix();\n }\n /**\n * Parse a JSON and creates the camera from the parsed information\n * @param parsedCamera The JSON to parse\n * @param scene The scene to instantiate the camera in\n * @returns the newly constructed camera\n */\n static Parse(parsedCamera, scene) {\n const type = parsedCamera.type;\n const construct = Camera.GetConstructorFromName(type, parsedCamera.name, scene, parsedCamera.interaxial_distance, parsedCamera.isStereoscopicSideBySide);\n const camera = SerializationHelper.Parse(construct, parsedCamera, scene);\n // Parent\n if (parsedCamera.parentId !== undefined) {\n camera._waitingParentId = parsedCamera.parentId;\n }\n // Parent instance index\n if (parsedCamera.parentInstanceIndex !== undefined) {\n camera._waitingParentInstanceIndex = parsedCamera.parentInstanceIndex;\n }\n //If camera has an input manager, let it parse inputs settings\n if (camera.inputs) {\n camera.inputs.parse(parsedCamera);\n camera._setupInputs();\n }\n if (parsedCamera.upVector) {\n camera.upVector = Vector3.FromArray(parsedCamera.upVector); // need to force the upVector\n }\n if (camera.setPosition) {\n // need to force position\n camera.position.copyFromFloats(0, 0, 0);\n camera.setPosition(Vector3.FromArray(parsedCamera.position));\n }\n // Target\n if (parsedCamera.target) {\n if (camera.setTarget) {\n camera.setTarget(Vector3.FromArray(parsedCamera.target));\n }\n }\n // Apply 3d rig, when found\n if (parsedCamera.cameraRigMode) {\n const rigParams = parsedCamera.interaxial_distance ? {\n interaxialDistance: parsedCamera.interaxial_distance\n } : {};\n camera.setCameraRigMode(parsedCamera.cameraRigMode, rigParams);\n }\n // Animations\n if (parsedCamera.animations) {\n for (let animationIndex = 0; animationIndex < parsedCamera.animations.length; animationIndex++) {\n const parsedAnimation = parsedCamera.animations[animationIndex];\n const internalClass = GetClass(\"BABYLON.Animation\");\n if (internalClass) {\n camera.animations.push(internalClass.Parse(parsedAnimation));\n }\n }\n Node.ParseAnimationRanges(camera, parsedCamera, scene);\n }\n if (parsedCamera.autoAnimate) {\n scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, parsedCamera.autoAnimateSpeed || 1.0);\n }\n // Check if isEnabled is defined to be back compatible with prior serialized versions.\n if (parsedCamera.isEnabled !== undefined) {\n camera.setEnabled(parsedCamera.isEnabled);\n }\n return camera;\n }\n /** @internal */\n _calculateHandednessMultiplier() {\n let handednessMultiplier = this.getScene().useRightHandedSystem ? -1 : 1;\n if (this.parent && this.parent._getWorldMatrixDeterminant() < 0) {\n handednessMultiplier *= -1;\n }\n return handednessMultiplier;\n }\n}\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nCamera._CreateDefaultParsedCamera = (name, scene) => {\n throw _WarnImport(\"UniversalCamera\");\n};\n/**\n * This is the default projection mode used by the cameras.\n * It helps recreating a feeling of perspective and better appreciate depth.\n * This is the best way to simulate real life cameras.\n */\nCamera.PERSPECTIVE_CAMERA = 0;\n/**\n * This helps creating camera with an orthographic mode.\n * Orthographic is commonly used in engineering as a means to produce object specifications that communicate dimensions unambiguously, each line of 1 unit length (cm, meter..whatever) will appear to have the same length everywhere on the drawing. This allows the drafter to dimension only a subset of lines and let the reader know that other lines of that length on the drawing are also that length in reality. Every parallel line in the drawing is also parallel in the object.\n */\nCamera.ORTHOGRAPHIC_CAMERA = 1;\n/**\n * This is the default FOV mode for perspective cameras.\n * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.\n */\nCamera.FOVMODE_VERTICAL_FIXED = 0;\n/**\n * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.\n */\nCamera.FOVMODE_HORIZONTAL_FIXED = 1;\n/**\n * This specifies there is no need for a camera rig.\n * Basically only one eye is rendered corresponding to the camera.\n */\nCamera.RIG_MODE_NONE = 0;\n/**\n * Simulates a camera Rig with one blue eye and one red eye.\n * This can be use with 3d blue and red glasses.\n */\nCamera.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10;\n/**\n * Defines that both eyes of the camera will be rendered side by side with a parallel target.\n */\nCamera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11;\n/**\n * Defines that both eyes of the camera will be rendered side by side with a none parallel target.\n */\nCamera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12;\n/**\n * Defines that both eyes of the camera will be rendered over under each other.\n */\nCamera.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13;\n/**\n * Defines that both eyes of the camera will be rendered on successive lines interlaced for passive 3d monitors.\n */\nCamera.RIG_MODE_STEREOSCOPIC_INTERLACED = 14;\n/**\n * Defines that both eyes of the camera should be renderered in a VR mode (carbox).\n */\nCamera.RIG_MODE_VR = 20;\n/**\n * Custom rig mode allowing rig cameras to be populated manually with any number of cameras\n */\nCamera.RIG_MODE_CUSTOM = 22;\n/**\n * Defines if by default attaching controls should prevent the default javascript event to continue.\n */\nCamera.ForceAttachControlToAlwaysPreventDefault = false;\n__decorate([serializeAsVector3(\"position\")], Camera.prototype, \"_position\", void 0);\n__decorate([serializeAsVector3(\"upVector\")], Camera.prototype, \"_upVector\", void 0);\n__decorate([serialize()], Camera.prototype, \"orthoLeft\", null);\n__decorate([serialize()], Camera.prototype, \"orthoRight\", null);\n__decorate([serialize()], Camera.prototype, \"orthoBottom\", null);\n__decorate([serialize()], Camera.prototype, \"orthoTop\", null);\n__decorate([serialize()], Camera.prototype, \"fov\", void 0);\n__decorate([serialize()], Camera.prototype, \"projectionPlaneTilt\", void 0);\n__decorate([serialize()], Camera.prototype, \"minZ\", void 0);\n__decorate([serialize()], Camera.prototype, \"maxZ\", void 0);\n__decorate([serialize()], Camera.prototype, \"inertia\", void 0);\n__decorate([serialize()], Camera.prototype, \"mode\", null);\n__decorate([serialize()], Camera.prototype, \"layerMask\", void 0);\n__decorate([serialize()], Camera.prototype, \"fovMode\", void 0);\n__decorate([serialize()], Camera.prototype, \"cameraRigMode\", void 0);\n__decorate([serialize()], Camera.prototype, \"interaxialDistance\", void 0);\n__decorate([serialize()], Camera.prototype, \"isStereoscopicSideBySide\", void 0);","map":{"version":3,"names":["__decorate","serialize","serializeAsVector3","SmartArray","Tools","Observable","Matrix","Vector3","Quaternion","Node","Logger","GetClass","_WarnImport","Viewport","Frustum","SerializationHelper","Camera","position","_position","newPosition","upVector","vec","_upVector","screenArea","x","y","mode","PERSPECTIVE_CAMERA","fovMode","FOVMODE_VERTICAL_FIXED","minZ","Math","tan","fov","getEngine","getAspectRatio","_this$orthoRight","_this$orthoLeft","_this$orthoTop","_this$orthoBottom","halfWidth","getRenderWidth","halfHeight","getRenderHeight","orthoRight","orthoLeft","orthoTop","orthoBottom","value","_orthoLeft","rigCamera","_rigCameras","_orthoRight","_orthoBottom","_orthoTop","_mode","hasMoved","_hasMoved","constructor","name","scene","setActiveOnSceneIfNoneActive","Zero","Up","oblique","projectionPlaneTilt","maxZ","inertia","isIntermediate","viewport","layerMask","cameraRigMode","RIG_MODE_NONE","customRenderTargets","outputRenderTarget","onViewMatrixChangedObservable","onProjectionMatrixChangedObservable","onAfterCheckInputsObservable","onRestoreStateObservable","isRigCamera","Array","_skipRendering","_projectionMatrix","_postProcesses","_activeMeshes","_globalPosition","_computedViewMatrix","Identity","_doNotComputeProjectionMatrix","_transformMatrix","_refreshFrustumPlanes","_absoluteRotation","_isCamera","_isLeftCamera","_isRightCamera","getScene","addCamera","activeCamera","renderPassId","createRenderPassId","storeState","_stateStored","_storedFov","hasStateStored","_restoreStateValues","restoreState","notifyObservers","getClassName","toString","fullDetails","ret","animations","i","length","applyVerticalCorrection","rot","absoluteRotation","toEulerAngles","_scene","useRightHandedSystem","globalPosition","getActiveMeshes","isActiveMesh","mesh","indexOf","isReady","completeCheck","pp","_initCache","_cache","Number","MAX_VALUE","undefined","aspectRatio","obliqueAngle","obliqueLength","obliqueOffset","renderWidth","renderHeight","_updateCache","ignoreParentClass","copyFrom","_isSynchronized","_isSynchronizedViewMatrix","_isSynchronizedProjectionMatrix","equals","isSynchronizedWithParent","isSynchronized","engine","angle","offset","attachControl","_ignored","_noPreventDefault","detachControl","update","_checkInputs","_updateRigCameras","getViewMatrix","getProjectionMatrix","rigCameras","rigPostProcess","_rigPostProcess","_getFirstPostProcess","ppIndex","_cascadePostProcessesToRigCams","firstPostProcess","markTextureDirty","len","cam","isPass","getEffectName","slice","concat","attachPostProcess","postProcess","insertAt","isReusable","Error","push","splice","prePassRenderer","markAsDirty","detachPostProcess","idx","getWorldMatrix","_worldMatrix","_getViewMatrix","force","updateCache","_currentRenderId","getRenderId","_childUpdateId","_cameraRigParams","vrPreViewMatrix","multiplyToRef","parent","invertToRef","freezeProjectionMatrix","projection","unfreezeProjectionMatrix","reverseDepth","useReverseDepthBuffer","PerspectiveFovRHToRef","PerspectiveFovLHToRef","isNDCHalfZRange","_this$oblique","_this$oblique2","_this$oblique3","_this$orthoLeft2","_this$orthoRight2","_this$orthoBottom2","_this$orthoTop2","ObliqueOffCenterRHToRef","_computeObliqueDistance","_this$orthoLeft3","_this$orthoRight3","_this$orthoBottom3","_this$orthoTop3","OrthoOffCenterRHToRef","_this$orthoLeft4","_this$orthoRight4","_this$orthoBottom4","_this$orthoTop4","ObliqueOffCenterLHToRef","_this$orthoLeft5","_this$orthoRight5","_this$orthoBottom5","_this$orthoTop5","OrthoOffCenterLHToRef","getTransformationMatrix","arcRotateCamera","targetCamera","radius","target","Distance","_updateFrustumPlanes","_frustumPlanes","GetPlanes","GetPlanesToRef","isInFrustum","checkRigCameras","result","forEach","isCompletelyInFrustum","getForwardRay","transform","origin","getForwardRayToRef","refRay","dispose","doNotRecurse","disposeMaterialAndTextures","clear","inputs","stopAnimation","removeCamera","camera","pop","_parentContainer","index","cameras","releaseRenderPassId","isLeftCamera","isRightCamera","leftCamera","rightCamera","getLeftTarget","getTarget","getRightTarget","setCameraRigMode","rigParams","interaxialDistance","stereoHalfAngle","ToRadians","createRigCamera","_setRigMode","_getVRProjectionMatrix","vrMetrics","aspectRatioFov","vrWorkMatrix","vrHMatrix","setCameraRigParameter","cameraIndex","RIG_MODE_STEREOSCOPIC_ANAGLYPH","_setupInputs","serializationObject","Serialize","uniqueId","type","_serializeAsParent","AppendSerializedAnimations","ranges","serializeAnimationRanges","isEnabled","clone","newParent","Clone","GetConstructorFromName","isStereoscopicSideBySide","onClonedObservable","getDirection","localAxis","getDirectionToRef","decompose","TransformNormalToRef","interaxial_distance","constructorFunc","Construct","_CreateDefaultParsedCamera","computeWorldMatrix","Parse","parsedCamera","construct","parentId","_waitingParentId","parentInstanceIndex","_waitingParentInstanceIndex","parse","FromArray","setPosition","copyFromFloats","setTarget","animationIndex","parsedAnimation","internalClass","ParseAnimationRanges","autoAnimate","beginAnimation","autoAnimateFrom","autoAnimateTo","autoAnimateLoop","autoAnimateSpeed","setEnabled","_calculateHandednessMultiplier","handednessMultiplier","_getWorldMatrixDeterminant","ORTHOGRAPHIC_CAMERA","FOVMODE_HORIZONTAL_FIXED","RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL","RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED","RIG_MODE_STEREOSCOPIC_OVERUNDER","RIG_MODE_STEREOSCOPIC_INTERLACED","RIG_MODE_VR","RIG_MODE_CUSTOM","ForceAttachControlToAlwaysPreventDefault","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Cameras/camera.js"],"sourcesContent":["import { __decorate } from \"../tslib.es6.js\";\nimport { serialize, serializeAsVector3 } from \"../Misc/decorators.js\";\nimport { SmartArray } from \"../Misc/smartArray.js\";\nimport { Tools } from \"../Misc/tools.js\";\nimport { Observable } from \"../Misc/observable.js\";\nimport { Matrix, Vector3, Quaternion } from \"../Maths/math.vector.js\";\nimport { Node } from \"../node.js\";\nimport { Logger } from \"../Misc/logger.js\";\nimport { GetClass } from \"../Misc/typeStore.js\";\nimport { _WarnImport } from \"../Misc/devTools.js\";\nimport { Viewport } from \"../Maths/math.viewport.js\";\nimport { Frustum } from \"../Maths/math.frustum.js\";\n\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\n/**\n * This is the base class of all the camera used in the application.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\n */\nexport class Camera extends Node {\n /**\n * Define the current local position of the camera in the scene\n */\n get position() {\n return this._position;\n }\n set position(newPosition) {\n this._position = newPosition;\n }\n /**\n * The vector the camera should consider as up.\n * (default is Vector3(0, 1, 0) aka Vector3.Up())\n */\n set upVector(vec) {\n this._upVector = vec;\n }\n get upVector() {\n return this._upVector;\n }\n /**\n * The screen area in scene units squared\n */\n get screenArea() {\n let x = 0;\n let y = 0;\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\n if (this.fovMode === Camera.FOVMODE_VERTICAL_FIXED) {\n y = this.minZ * 2 * Math.tan(this.fov / 2);\n x = this.getEngine().getAspectRatio(this) * y;\n }\n else {\n x = this.minZ * 2 * Math.tan(this.fov / 2);\n y = x / this.getEngine().getAspectRatio(this);\n }\n }\n else {\n const halfWidth = this.getEngine().getRenderWidth() / 2.0;\n const halfHeight = this.getEngine().getRenderHeight() / 2.0;\n x = (this.orthoRight ?? halfWidth) - (this.orthoLeft ?? -halfWidth);\n y = (this.orthoTop ?? halfHeight) - (this.orthoBottom ?? -halfHeight);\n }\n return x * y;\n }\n /**\n * Define the current limit on the left side for an orthographic camera\n * In scene unit\n */\n set orthoLeft(value) {\n this._orthoLeft = value;\n for (const rigCamera of this._rigCameras) {\n rigCamera.orthoLeft = value;\n }\n }\n get orthoLeft() {\n return this._orthoLeft;\n }\n /**\n * Define the current limit on the right side for an orthographic camera\n * In scene unit\n */\n set orthoRight(value) {\n this._orthoRight = value;\n for (const rigCamera of this._rigCameras) {\n rigCamera.orthoRight = value;\n }\n }\n get orthoRight() {\n return this._orthoRight;\n }\n /**\n * Define the current limit on the bottom side for an orthographic camera\n * In scene unit\n */\n set orthoBottom(value) {\n this._orthoBottom = value;\n for (const rigCamera of this._rigCameras) {\n rigCamera.orthoBottom = value;\n }\n }\n get orthoBottom() {\n return this._orthoBottom;\n }\n /**\n * Define the current limit on the top side for an orthographic camera\n * In scene unit\n */\n set orthoTop(value) {\n this._orthoTop = value;\n for (const rigCamera of this._rigCameras) {\n rigCamera.orthoTop = value;\n }\n }\n get orthoTop() {\n return this._orthoTop;\n }\n /**\n * Define the mode of the camera (Camera.PERSPECTIVE_CAMERA or Camera.ORTHOGRAPHIC_CAMERA)\n */\n set mode(mode) {\n this._mode = mode;\n // Pass the mode down to the rig cameras\n for (const rigCamera of this._rigCameras) {\n rigCamera.mode = mode;\n }\n }\n get mode() {\n return this._mode;\n }\n /**\n * Gets a flag indicating that the camera has moved in some way since the last call to Camera.update()\n */\n get hasMoved() {\n return this._hasMoved;\n }\n /**\n * Instantiates a new camera object.\n * This should not be used directly but through the inherited cameras: ArcRotate, Free...\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\n * @param name Defines the name of the camera in the scene\n * @param position Defines the position of the camera\n * @param scene Defines the scene the camera belongs too\n * @param setActiveOnSceneIfNoneActive Defines if the camera should be set as active after creation if no other camera have been defined in the scene\n */\n constructor(name, position, scene, setActiveOnSceneIfNoneActive = true) {\n super(name, scene, false);\n /** @internal */\n this._position = Vector3.Zero();\n this._upVector = Vector3.Up();\n /**\n * Object containing oblique projection values (only used with ORTHOGRAPHIC_CAMERA)\n */\n this.oblique = null;\n this._orthoLeft = null;\n this._orthoRight = null;\n this._orthoBottom = null;\n this._orthoTop = null;\n /**\n * Field Of View is set in Radians. (default is 0.8)\n */\n this.fov = 0.8;\n /**\n * Projection plane tilt around the X axis (horizontal), set in Radians. (default is 0)\n * Can be used to make vertical lines in world space actually vertical on the screen.\n * See https://forum.babylonjs.com/t/add-vertical-shift-to-3ds-max-exporter-babylon-cameras/17480\n */\n this.projectionPlaneTilt = 0;\n /**\n * Define the minimum distance the camera can see from.\n * This is important to note that the depth buffer are not infinite and the closer it starts\n * the more your scene might encounter depth fighting issue.\n */\n this.minZ = 1;\n /**\n * Define the maximum distance the camera can see to.\n * This is important to note that the depth buffer are not infinite and the further it end\n * the more your scene might encounter depth fighting issue.\n */\n this.maxZ = 10000.0;\n /**\n * Define the default inertia of the camera.\n * This helps giving a smooth feeling to the camera movement.\n */\n this.inertia = 0.9;\n this._mode = Camera.PERSPECTIVE_CAMERA;\n /**\n * Define whether the camera is intermediate.\n * This is useful to not present the output directly to the screen in case of rig without post process for instance\n */\n this.isIntermediate = false;\n /**\n * Define the viewport of the camera.\n * This correspond to the portion of the screen the camera will render to in normalized 0 to 1 unit.\n */\n this.viewport = new Viewport(0, 0, 1.0, 1.0);\n /**\n * Restricts the camera to viewing objects with the same layerMask.\n * A camera with a layerMask of 1 will render mesh.layerMask & camera.layerMask!== 0\n */\n this.layerMask = 0x0fffffff;\n /**\n * fovMode sets the camera frustum bounds to the viewport bounds. (default is FOVMODE_VERTICAL_FIXED)\n */\n this.fovMode = Camera.FOVMODE_VERTICAL_FIXED;\n /**\n * Rig mode of the camera.\n * This is useful to create the camera with two \"eyes\" instead of one to create VR or stereoscopic scenes.\n * This is normally controlled byt the camera themselves as internal use.\n */\n this.cameraRigMode = Camera.RIG_MODE_NONE;\n /**\n * Defines the list of custom render target which are rendered to and then used as the input to this camera's render. Eg. display another camera view on a TV in the main scene\n * This is pretty helpful if you wish to make a camera render to a texture you could reuse somewhere\n * else in the scene. (Eg. security camera)\n *\n * To change the final output target of the camera, camera.outputRenderTarget should be used instead (eg. webXR renders to a render target corresponding to an HMD)\n */\n this.customRenderTargets = [];\n /**\n * When set, the camera will render to this render target instead of the default canvas\n *\n * If the desire is to use the output of a camera as a texture in the scene consider using camera.customRenderTargets instead\n */\n this.outputRenderTarget = null;\n /**\n * Observable triggered when the camera view matrix has changed.\n * Beware of reentrance! Some methods like Camera.getViewMatrix and Camera.getWorldMatrix can trigger the onViewMatrixChangedObservable\n * observable, so using them inside an observer will require additional logic to avoid a stack overflow error.\n */\n this.onViewMatrixChangedObservable = new Observable();\n /**\n * Observable triggered when the camera Projection matrix has changed.\n */\n this.onProjectionMatrixChangedObservable = new Observable();\n /**\n * Observable triggered when the inputs have been processed.\n */\n this.onAfterCheckInputsObservable = new Observable();\n /**\n * Observable triggered when reset has been called and applied to the camera.\n */\n this.onRestoreStateObservable = new Observable();\n /**\n * Is this camera a part of a rig system?\n */\n this.isRigCamera = false;\n this._hasMoved = false;\n /** @internal */\n this._rigCameras = new Array();\n /** @internal */\n this._skipRendering = false;\n /** @internal */\n this._projectionMatrix = new Matrix();\n /** @internal */\n this._postProcesses = new Array();\n /** @internal */\n this._activeMeshes = new SmartArray(256);\n this._globalPosition = Vector3.Zero();\n /** @internal */\n this._computedViewMatrix = Matrix.Identity();\n this._doNotComputeProjectionMatrix = false;\n this._transformMatrix = Matrix.Zero();\n this._refreshFrustumPlanes = true;\n this._absoluteRotation = Quaternion.Identity();\n /** @internal */\n this._isCamera = true;\n /** @internal */\n this._isLeftCamera = false;\n /** @internal */\n this._isRightCamera = false;\n this.getScene().addCamera(this);\n if (setActiveOnSceneIfNoneActive && !this.getScene().activeCamera) {\n this.getScene().activeCamera = this;\n }\n this.position = position;\n this.renderPassId = this.getScene().getEngine().createRenderPassId(`Camera ${name}`);\n }\n /**\n * Store current camera state (fov, position, etc..)\n * @returns the camera\n */\n storeState() {\n this._stateStored = true;\n this._storedFov = this.fov;\n return this;\n }\n /**\n * Returns true if a state has been stored by calling storeState method.\n * @returns true if state has been stored.\n */\n hasStateStored() {\n return !!this._stateStored;\n }\n /**\n * Restores the camera state values if it has been stored. You must call storeState() first\n * @returns true if restored and false otherwise\n */\n _restoreStateValues() {\n if (!this._stateStored) {\n return false;\n }\n this.fov = this._storedFov;\n return true;\n }\n /**\n * Restored camera state. You must call storeState() first.\n * @returns true if restored and false otherwise\n */\n restoreState() {\n if (this._restoreStateValues()) {\n this.onRestoreStateObservable.notifyObservers(this);\n return true;\n }\n return false;\n }\n /**\n * Gets the class name of the camera.\n * @returns the class name\n */\n getClassName() {\n return \"Camera\";\n }\n /**\n * Gets a string representation of the camera useful for debug purpose.\n * @param fullDetails Defines that a more verbose level of logging is required\n * @returns the string representation\n */\n toString(fullDetails) {\n let ret = \"Name: \" + this.name;\n ret += \", type: \" + this.getClassName();\n if (this.animations) {\n for (let i = 0; i < this.animations.length; i++) {\n ret += \", animation[0]: \" + this.animations[i].toString(fullDetails);\n }\n }\n return ret;\n }\n /**\n * Automatically tilts the projection plane, using `projectionPlaneTilt`, to correct the perspective effect on vertical lines.\n */\n applyVerticalCorrection() {\n const rot = this.absoluteRotation.toEulerAngles();\n this.projectionPlaneTilt = this._scene.useRightHandedSystem ? -rot.x : rot.x;\n }\n /**\n * Gets the current world space position of the camera.\n */\n get globalPosition() {\n return this._globalPosition;\n }\n /**\n * Gets the list of active meshes this frame (meshes no culled or excluded by lod s in the frame)\n * @returns the active meshe list\n */\n getActiveMeshes() {\n return this._activeMeshes;\n }\n /**\n * Check whether a mesh is part of the current active mesh list of the camera\n * @param mesh Defines the mesh to check\n * @returns true if active, false otherwise\n */\n isActiveMesh(mesh) {\n return this._activeMeshes.indexOf(mesh) !== -1;\n }\n /**\n * Is this camera ready to be used/rendered\n * @param completeCheck defines if a complete check (including post processes) has to be done (false by default)\n * @returns true if the camera is ready\n */\n isReady(completeCheck = false) {\n if (completeCheck) {\n for (const pp of this._postProcesses) {\n if (pp && !pp.isReady()) {\n return false;\n }\n }\n }\n return super.isReady(completeCheck);\n }\n /** @internal */\n _initCache() {\n super._initCache();\n this._cache.position = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n this._cache.upVector = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n this._cache.mode = undefined;\n this._cache.minZ = undefined;\n this._cache.maxZ = undefined;\n this._cache.fov = undefined;\n this._cache.fovMode = undefined;\n this._cache.aspectRatio = undefined;\n this._cache.orthoLeft = undefined;\n this._cache.orthoRight = undefined;\n this._cache.orthoBottom = undefined;\n this._cache.orthoTop = undefined;\n this._cache.obliqueAngle = undefined;\n this._cache.obliqueLength = undefined;\n this._cache.obliqueOffset = undefined;\n this._cache.renderWidth = undefined;\n this._cache.renderHeight = undefined;\n }\n /**\n * @internal\n */\n _updateCache(ignoreParentClass) {\n if (!ignoreParentClass) {\n super._updateCache();\n }\n this._cache.position.copyFrom(this.position);\n this._cache.upVector.copyFrom(this.upVector);\n }\n /** @internal */\n _isSynchronized() {\n return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();\n }\n /** @internal */\n _isSynchronizedViewMatrix() {\n if (!super._isSynchronized()) {\n return false;\n }\n return this._cache.position.equals(this.position) && this._cache.upVector.equals(this.upVector) && this.isSynchronizedWithParent();\n }\n /** @internal */\n _isSynchronizedProjectionMatrix() {\n let isSynchronized = this._cache.mode === this.mode && this._cache.minZ === this.minZ && this._cache.maxZ === this.maxZ;\n if (!isSynchronized) {\n return false;\n }\n const engine = this.getEngine();\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\n isSynchronized =\n this._cache.fov === this.fov &&\n this._cache.fovMode === this.fovMode &&\n this._cache.aspectRatio === engine.getAspectRatio(this) &&\n this._cache.projectionPlaneTilt === this.projectionPlaneTilt;\n }\n else {\n isSynchronized =\n this._cache.orthoLeft === this.orthoLeft &&\n this._cache.orthoRight === this.orthoRight &&\n this._cache.orthoBottom === this.orthoBottom &&\n this._cache.orthoTop === this.orthoTop &&\n this._cache.renderWidth === engine.getRenderWidth() &&\n this._cache.renderHeight === engine.getRenderHeight();\n if (this.oblique) {\n isSynchronized =\n isSynchronized &&\n this._cache.obliqueAngle === this.oblique.angle &&\n this._cache.obliqueLength === this.oblique.length &&\n this._cache.obliqueOffset === this.oblique.offset;\n }\n }\n return isSynchronized;\n }\n /**\n * Attach the input controls to a specific dom element to get the input from.\n * This function is here because typescript removes the typing of the last function.\n * @param _ignored defines an ignored parameter kept for backward compatibility.\n * @param _noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)\n */\n attachControl(_ignored, _noPreventDefault) { }\n /**\n * Detach the current controls from the specified dom element.\n * This function is here because typescript removes the typing of the last function.\n * @param _ignored defines an ignored parameter kept for backward compatibility.\n */\n detachControl(_ignored) { }\n /**\n * Update the camera state according to the different inputs gathered during the frame.\n */\n update() {\n this._hasMoved = false;\n this._checkInputs();\n if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\n this._updateRigCameras();\n }\n // Attempt to update the camera's view and projection matrices.\n // This call is being made because these matrices are no longer being updated\n // as a part of the picking ray process (in addition to scene.render).\n this.getViewMatrix();\n this.getProjectionMatrix();\n }\n /** @internal */\n _checkInputs() {\n this.onAfterCheckInputsObservable.notifyObservers(this);\n }\n /** @internal */\n get rigCameras() {\n return this._rigCameras;\n }\n /**\n * Gets the post process used by the rig cameras\n */\n get rigPostProcess() {\n return this._rigPostProcess;\n }\n /**\n * Internal, gets the first post process.\n * @returns the first post process to be run on this camera.\n */\n _getFirstPostProcess() {\n for (let ppIndex = 0; ppIndex < this._postProcesses.length; ppIndex++) {\n if (this._postProcesses[ppIndex] !== null) {\n return this._postProcesses[ppIndex];\n }\n }\n return null;\n }\n _cascadePostProcessesToRigCams() {\n // invalidate framebuffer\n const firstPostProcess = this._getFirstPostProcess();\n if (firstPostProcess) {\n firstPostProcess.markTextureDirty();\n }\n // glue the rigPostProcess to the end of the user postprocesses & assign to each sub-camera\n for (let i = 0, len = this._rigCameras.length; i < len; i++) {\n const cam = this._rigCameras[i];\n const rigPostProcess = cam._rigPostProcess;\n // for VR rig, there does not have to be a post process\n if (rigPostProcess) {\n const isPass = rigPostProcess.getEffectName() === \"pass\";\n if (isPass) {\n // any rig which has a PassPostProcess for rig[0], cannot be isIntermediate when there are also user postProcesses\n cam.isIntermediate = this._postProcesses.length === 0;\n }\n cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess);\n rigPostProcess.markTextureDirty();\n }\n else {\n cam._postProcesses = this._postProcesses.slice(0);\n }\n }\n }\n /**\n * Attach a post process to the camera.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess\n * @param postProcess The post process to attach to the camera\n * @param insertAt The position of the post process in case several of them are in use in the scene\n * @returns the position the post process has been inserted at\n */\n attachPostProcess(postProcess, insertAt = null) {\n if (!postProcess.isReusable() && this._postProcesses.indexOf(postProcess) > -1) {\n Logger.Error(\"You're trying to reuse a post process not defined as reusable.\");\n return 0;\n }\n if (insertAt == null || insertAt < 0) {\n this._postProcesses.push(postProcess);\n }\n else if (this._postProcesses[insertAt] === null) {\n this._postProcesses[insertAt] = postProcess;\n }\n else {\n this._postProcesses.splice(insertAt, 0, postProcess);\n }\n this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated\n // Update prePass\n if (this._scene.prePassRenderer) {\n this._scene.prePassRenderer.markAsDirty();\n }\n return this._postProcesses.indexOf(postProcess);\n }\n /**\n * Detach a post process to the camera.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess\n * @param postProcess The post process to detach from the camera\n */\n detachPostProcess(postProcess) {\n const idx = this._postProcesses.indexOf(postProcess);\n if (idx !== -1) {\n this._postProcesses[idx] = null;\n }\n // Update prePass\n if (this._scene.prePassRenderer) {\n this._scene.prePassRenderer.markAsDirty();\n }\n this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated\n }\n /**\n * Gets the current world matrix of the camera\n * @returns the world matrix\n */\n getWorldMatrix() {\n if (this._isSynchronizedViewMatrix()) {\n return this._worldMatrix;\n }\n // Getting the view matrix will also compute the world matrix.\n this.getViewMatrix();\n return this._worldMatrix;\n }\n /** @internal */\n _getViewMatrix() {\n return Matrix.Identity();\n }\n /**\n * Gets the current view matrix of the camera.\n * @param force forces the camera to recompute the matrix without looking at the cached state\n * @returns the view matrix\n */\n getViewMatrix(force) {\n if (!force && this._isSynchronizedViewMatrix()) {\n return this._computedViewMatrix;\n }\n this._hasMoved = true;\n this.updateCache();\n this._computedViewMatrix = this._getViewMatrix();\n this._currentRenderId = this.getScene().getRenderId();\n this._childUpdateId++;\n this._refreshFrustumPlanes = true;\n if (this._cameraRigParams && this._cameraRigParams.vrPreViewMatrix) {\n this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix, this._computedViewMatrix);\n }\n // Notify parent camera if rig camera is changed\n if (this.parent && this.parent.onViewMatrixChangedObservable) {\n this.parent.onViewMatrixChangedObservable.notifyObservers(this.parent);\n }\n this.onViewMatrixChangedObservable.notifyObservers(this);\n this._computedViewMatrix.invertToRef(this._worldMatrix);\n return this._computedViewMatrix;\n }\n /**\n * Freeze the projection matrix.\n * It will prevent the cache check of the camera projection compute and can speed up perf\n * if no parameter of the camera are meant to change\n * @param projection Defines manually a projection if necessary\n */\n freezeProjectionMatrix(projection) {\n this._doNotComputeProjectionMatrix = true;\n if (projection !== undefined) {\n this._projectionMatrix = projection;\n }\n }\n /**\n * Unfreeze the projection matrix if it has previously been freezed by freezeProjectionMatrix.\n */\n unfreezeProjectionMatrix() {\n this._doNotComputeProjectionMatrix = false;\n }\n /**\n * Gets the current projection matrix of the camera.\n * @param force forces the camera to recompute the matrix without looking at the cached state\n * @returns the projection matrix\n */\n getProjectionMatrix(force) {\n if (this._doNotComputeProjectionMatrix || (!force && this._isSynchronizedProjectionMatrix())) {\n return this._projectionMatrix;\n }\n // Cache\n this._cache.mode = this.mode;\n this._cache.minZ = this.minZ;\n this._cache.maxZ = this.maxZ;\n // Matrix\n this._refreshFrustumPlanes = true;\n const engine = this.getEngine();\n const scene = this.getScene();\n const reverseDepth = engine.useReverseDepthBuffer;\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\n this._cache.fov = this.fov;\n this._cache.fovMode = this.fovMode;\n this._cache.aspectRatio = engine.getAspectRatio(this);\n this._cache.projectionPlaneTilt = this.projectionPlaneTilt;\n if (this.minZ <= 0) {\n this.minZ = 0.1;\n }\n let getProjectionMatrix;\n if (scene.useRightHandedSystem) {\n getProjectionMatrix = Matrix.PerspectiveFovRHToRef;\n }\n else {\n getProjectionMatrix = Matrix.PerspectiveFovLHToRef;\n }\n getProjectionMatrix(this.fov, engine.getAspectRatio(this), reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, this.fovMode === Camera.FOVMODE_VERTICAL_FIXED, engine.isNDCHalfZRange, this.projectionPlaneTilt, reverseDepth);\n }\n else {\n const halfWidth = engine.getRenderWidth() / 2.0;\n const halfHeight = engine.getRenderHeight() / 2.0;\n if (scene.useRightHandedSystem) {\n if (this.oblique) {\n Matrix.ObliqueOffCenterRHToRef(this.orthoLeft ?? -halfWidth, this.orthoRight ?? halfWidth, this.orthoBottom ?? -halfHeight, this.orthoTop ?? halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this.oblique.length, this.oblique.angle, this._computeObliqueDistance(this.oblique.offset), this._projectionMatrix, engine.isNDCHalfZRange);\n }\n else {\n Matrix.OrthoOffCenterRHToRef(this.orthoLeft ?? -halfWidth, this.orthoRight ?? halfWidth, this.orthoBottom ?? -halfHeight, this.orthoTop ?? halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, engine.isNDCHalfZRange);\n }\n }\n else {\n if (this.oblique) {\n Matrix.ObliqueOffCenterLHToRef(this.orthoLeft ?? -halfWidth, this.orthoRight ?? halfWidth, this.orthoBottom ?? -halfHeight, this.orthoTop ?? halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this.oblique.length, this.oblique.angle, this._computeObliqueDistance(this.oblique.offset), this._projectionMatrix, engine.isNDCHalfZRange);\n }\n else {\n Matrix.OrthoOffCenterLHToRef(this.orthoLeft ?? -halfWidth, this.orthoRight ?? halfWidth, this.orthoBottom ?? -halfHeight, this.orthoTop ?? halfHeight, reverseDepth ? this.maxZ : this.minZ, reverseDepth ? this.minZ : this.maxZ, this._projectionMatrix, engine.isNDCHalfZRange);\n }\n }\n this._cache.orthoLeft = this.orthoLeft;\n this._cache.orthoRight = this.orthoRight;\n this._cache.orthoBottom = this.orthoBottom;\n this._cache.orthoTop = this.orthoTop;\n this._cache.obliqueAngle = this.oblique?.angle;\n this._cache.obliqueLength = this.oblique?.length;\n this._cache.obliqueOffset = this.oblique?.offset;\n this._cache.renderWidth = engine.getRenderWidth();\n this._cache.renderHeight = engine.getRenderHeight();\n }\n this.onProjectionMatrixChangedObservable.notifyObservers(this);\n return this._projectionMatrix;\n }\n /**\n * Gets the transformation matrix (ie. the multiplication of view by projection matrices)\n * @returns a Matrix\n */\n getTransformationMatrix() {\n this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);\n return this._transformMatrix;\n }\n _computeObliqueDistance(offset) {\n const arcRotateCamera = this;\n const targetCamera = this;\n return (arcRotateCamera.radius || (targetCamera.target ? Vector3.Distance(this.position, targetCamera.target) : this.position.length())) + offset;\n }\n /** @internal */\n _updateFrustumPlanes() {\n if (!this._refreshFrustumPlanes) {\n return;\n }\n this.getTransformationMatrix();\n if (!this._frustumPlanes) {\n this._frustumPlanes = Frustum.GetPlanes(this._transformMatrix);\n }\n else {\n Frustum.GetPlanesToRef(this._transformMatrix, this._frustumPlanes);\n }\n this._refreshFrustumPlanes = false;\n }\n /**\n * Checks if a cullable object (mesh...) is in the camera frustum\n * This checks the bounding box center. See isCompletelyInFrustum for a full bounding check\n * @param target The object to check\n * @param checkRigCameras If the rig cameras should be checked (eg. with VR camera both eyes should be checked) (Default: false)\n * @returns true if the object is in frustum otherwise false\n */\n isInFrustum(target, checkRigCameras = false) {\n this._updateFrustumPlanes();\n if (checkRigCameras && this.rigCameras.length > 0) {\n let result = false;\n this.rigCameras.forEach((cam) => {\n cam._updateFrustumPlanes();\n result = result || target.isInFrustum(cam._frustumPlanes);\n });\n return result;\n }\n else {\n return target.isInFrustum(this._frustumPlanes);\n }\n }\n /**\n * Checks if a cullable object (mesh...) is in the camera frustum\n * Unlike isInFrustum this checks the full bounding box\n * @param target The object to check\n * @returns true if the object is in frustum otherwise false\n */\n isCompletelyInFrustum(target) {\n this._updateFrustumPlanes();\n return target.isCompletelyInFrustum(this._frustumPlanes);\n }\n // eslint-disable-next-line jsdoc/require-returns-check\n /**\n * Gets a ray in the forward direction from the camera.\n * @param length Defines the length of the ray to create\n * @param transform Defines the transform to apply to the ray, by default the world matrix is used to create a workd space ray\n * @param origin Defines the start point of the ray which defaults to the camera position\n * @returns the forward ray\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getForwardRay(length = 100, transform, origin) {\n throw _WarnImport(\"Ray\");\n }\n // eslint-disable-next-line jsdoc/require-returns-check\n /**\n * Gets a ray in the forward direction from the camera.\n * @param refRay the ray to (re)use when setting the values\n * @param length Defines the length of the ray to create\n * @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray\n * @param origin Defines the start point of the ray which defaults to the camera position\n * @returns the forward ray\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getForwardRayToRef(refRay, length = 100, transform, origin) {\n throw _WarnImport(\"Ray\");\n }\n /**\n * Releases resources associated with this node.\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\n * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)\n */\n dispose(doNotRecurse, disposeMaterialAndTextures = false) {\n // Observables\n this.onViewMatrixChangedObservable.clear();\n this.onProjectionMatrixChangedObservable.clear();\n this.onAfterCheckInputsObservable.clear();\n this.onRestoreStateObservable.clear();\n // Inputs\n if (this.inputs) {\n this.inputs.clear();\n }\n // Animations\n this.getScene().stopAnimation(this);\n // Remove from scene\n this.getScene().removeCamera(this);\n while (this._rigCameras.length > 0) {\n const camera = this._rigCameras.pop();\n if (camera) {\n camera.dispose();\n }\n }\n if (this._parentContainer) {\n const index = this._parentContainer.cameras.indexOf(this);\n if (index > -1) {\n this._parentContainer.cameras.splice(index, 1);\n }\n this._parentContainer = null;\n }\n // Postprocesses\n if (this._rigPostProcess) {\n this._rigPostProcess.dispose(this);\n this._rigPostProcess = null;\n this._postProcesses.length = 0;\n }\n else if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\n this._rigPostProcess = null;\n this._postProcesses.length = 0;\n }\n else {\n let i = this._postProcesses.length;\n while (--i >= 0) {\n const postProcess = this._postProcesses[i];\n if (postProcess) {\n postProcess.dispose(this);\n }\n }\n }\n // Render targets\n let i = this.customRenderTargets.length;\n while (--i >= 0) {\n this.customRenderTargets[i].dispose();\n }\n this.customRenderTargets.length = 0;\n // Active Meshes\n this._activeMeshes.dispose();\n this.getScene().getEngine().releaseRenderPassId(this.renderPassId);\n super.dispose(doNotRecurse, disposeMaterialAndTextures);\n }\n /**\n * Gets the left camera of a rig setup in case of Rigged Camera\n */\n get isLeftCamera() {\n return this._isLeftCamera;\n }\n /**\n * Gets the right camera of a rig setup in case of Rigged Camera\n */\n get isRightCamera() {\n return this._isRightCamera;\n }\n /**\n * Gets the left camera of a rig setup in case of Rigged Camera\n */\n get leftCamera() {\n if (this._rigCameras.length < 1) {\n return null;\n }\n return this._rigCameras[0];\n }\n /**\n * Gets the right camera of a rig setup in case of Rigged Camera\n */\n get rightCamera() {\n if (this._rigCameras.length < 2) {\n return null;\n }\n return this._rigCameras[1];\n }\n /**\n * Gets the left camera target of a rig setup in case of Rigged Camera\n * @returns the target position\n */\n getLeftTarget() {\n if (this._rigCameras.length < 1) {\n return null;\n }\n return this._rigCameras[0].getTarget();\n }\n /**\n * Gets the right camera target of a rig setup in case of Rigged Camera\n * @returns the target position\n */\n getRightTarget() {\n if (this._rigCameras.length < 2) {\n return null;\n }\n return this._rigCameras[1].getTarget();\n }\n /**\n * @internal\n */\n setCameraRigMode(mode, rigParams) {\n if (this.cameraRigMode === mode) {\n return;\n }\n while (this._rigCameras.length > 0) {\n const camera = this._rigCameras.pop();\n if (camera) {\n camera.dispose();\n }\n }\n this.cameraRigMode = mode;\n this._cameraRigParams = {};\n //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target,\n //not from a given angle as it is now, but until that complete code rewriting provisional stereoHalfAngle value is introduced\n this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637;\n this._cameraRigParams.stereoHalfAngle = Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);\n // create the rig cameras, unless none\n if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\n const leftCamera = this.createRigCamera(this.name + \"_L\", 0);\n if (leftCamera) {\n leftCamera._isLeftCamera = true;\n }\n const rightCamera = this.createRigCamera(this.name + \"_R\", 1);\n if (rightCamera) {\n rightCamera._isRightCamera = true;\n }\n if (leftCamera && rightCamera) {\n this._rigCameras.push(leftCamera);\n this._rigCameras.push(rightCamera);\n }\n }\n this._setRigMode(rigParams);\n this._cascadePostProcessesToRigCams();\n this.update();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _setRigMode(rigParams) {\n // no-op\n }\n /** @internal */\n _getVRProjectionMatrix() {\n Matrix.PerspectiveFovLHToRef(this._cameraRigParams.vrMetrics.aspectRatioFov, this._cameraRigParams.vrMetrics.aspectRatio, this.minZ, this.maxZ, this._cameraRigParams.vrWorkMatrix, true, this.getEngine().isNDCHalfZRange);\n this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix);\n return this._projectionMatrix;\n }\n /**\n * @internal\n */\n setCameraRigParameter(name, value) {\n if (!this._cameraRigParams) {\n this._cameraRigParams = {};\n }\n this._cameraRigParams[name] = value;\n //provisionnally:\n if (name === \"interaxialDistance\") {\n this._cameraRigParams.stereoHalfAngle = Tools.ToRadians(value / 0.0637);\n }\n }\n /**\n * needs to be overridden by children so sub has required properties to be copied\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n createRigCamera(name, cameraIndex) {\n return null;\n }\n /**\n * May need to be overridden by children\n * @internal\n */\n _updateRigCameras() {\n for (let i = 0; i < this._rigCameras.length; i++) {\n this._rigCameras[i].minZ = this.minZ;\n this._rigCameras[i].maxZ = this.maxZ;\n this._rigCameras[i].fov = this.fov;\n this._rigCameras[i].upVector.copyFrom(this.upVector);\n }\n // only update viewport when ANAGLYPH\n if (this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH) {\n this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport;\n }\n }\n /** @internal */\n _setupInputs() { }\n /**\n * Serialiaze the camera setup to a json representation\n * @returns the JSON representation\n */\n serialize() {\n const serializationObject = SerializationHelper.Serialize(this);\n serializationObject.uniqueId = this.uniqueId;\n // Type\n serializationObject.type = this.getClassName();\n // Parent\n if (this.parent) {\n this.parent._serializeAsParent(serializationObject);\n }\n if (this.inputs) {\n this.inputs.serialize(serializationObject);\n }\n // Animations\n SerializationHelper.AppendSerializedAnimations(this, serializationObject);\n serializationObject.ranges = this.serializeAnimationRanges();\n serializationObject.isEnabled = this.isEnabled();\n return serializationObject;\n }\n /**\n * Clones the current camera.\n * @param name The cloned camera name\n * @param newParent The cloned camera's new parent (none by default)\n * @returns the cloned camera\n */\n clone(name, newParent = null) {\n const camera = SerializationHelper.Clone(Camera.GetConstructorFromName(this.getClassName(), name, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide), this);\n camera.name = name;\n camera.parent = newParent;\n this.onClonedObservable.notifyObservers(camera);\n return camera;\n }\n /**\n * Gets the direction of the camera relative to a given local axis.\n * @param localAxis Defines the reference axis to provide a relative direction.\n * @returns the direction\n */\n getDirection(localAxis) {\n const result = Vector3.Zero();\n this.getDirectionToRef(localAxis, result);\n return result;\n }\n /**\n * Returns the current camera absolute rotation\n */\n get absoluteRotation() {\n this.getWorldMatrix().decompose(undefined, this._absoluteRotation);\n return this._absoluteRotation;\n }\n /**\n * Gets the direction of the camera relative to a given local axis into a passed vector.\n * @param localAxis Defines the reference axis to provide a relative direction.\n * @param result Defines the vector to store the result in\n */\n getDirectionToRef(localAxis, result) {\n Vector3.TransformNormalToRef(localAxis, this.getWorldMatrix(), result);\n }\n /**\n * Gets a camera constructor for a given camera type\n * @param type The type of the camera to construct (should be equal to one of the camera class name)\n * @param name The name of the camera the result will be able to instantiate\n * @param scene The scene the result will construct the camera in\n * @param interaxial_distance In case of stereoscopic setup, the distance between both eyes\n * @param isStereoscopicSideBySide In case of stereoscopic setup, should the sereo be side b side\n * @returns a factory method to construct the camera\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n static GetConstructorFromName(type, name, scene, interaxial_distance = 0, isStereoscopicSideBySide = true) {\n const constructorFunc = Node.Construct(type, name, scene, {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n interaxial_distance: interaxial_distance,\n isStereoscopicSideBySide: isStereoscopicSideBySide,\n });\n if (constructorFunc) {\n return constructorFunc;\n }\n // Default to universal camera\n return () => Camera._CreateDefaultParsedCamera(name, scene);\n }\n /**\n * Compute the world matrix of the camera.\n * @returns the camera world matrix\n */\n computeWorldMatrix() {\n return this.getWorldMatrix();\n }\n /**\n * Parse a JSON and creates the camera from the parsed information\n * @param parsedCamera The JSON to parse\n * @param scene The scene to instantiate the camera in\n * @returns the newly constructed camera\n */\n static Parse(parsedCamera, scene) {\n const type = parsedCamera.type;\n const construct = Camera.GetConstructorFromName(type, parsedCamera.name, scene, parsedCamera.interaxial_distance, parsedCamera.isStereoscopicSideBySide);\n const camera = SerializationHelper.Parse(construct, parsedCamera, scene);\n // Parent\n if (parsedCamera.parentId !== undefined) {\n camera._waitingParentId = parsedCamera.parentId;\n }\n // Parent instance index\n if (parsedCamera.parentInstanceIndex !== undefined) {\n camera._waitingParentInstanceIndex = parsedCamera.parentInstanceIndex;\n }\n //If camera has an input manager, let it parse inputs settings\n if (camera.inputs) {\n camera.inputs.parse(parsedCamera);\n camera._setupInputs();\n }\n if (parsedCamera.upVector) {\n camera.upVector = Vector3.FromArray(parsedCamera.upVector); // need to force the upVector\n }\n if (camera.setPosition) {\n // need to force position\n camera.position.copyFromFloats(0, 0, 0);\n camera.setPosition(Vector3.FromArray(parsedCamera.position));\n }\n // Target\n if (parsedCamera.target) {\n if (camera.setTarget) {\n camera.setTarget(Vector3.FromArray(parsedCamera.target));\n }\n }\n // Apply 3d rig, when found\n if (parsedCamera.cameraRigMode) {\n const rigParams = parsedCamera.interaxial_distance ? { interaxialDistance: parsedCamera.interaxial_distance } : {};\n camera.setCameraRigMode(parsedCamera.cameraRigMode, rigParams);\n }\n // Animations\n if (parsedCamera.animations) {\n for (let animationIndex = 0; animationIndex < parsedCamera.animations.length; animationIndex++) {\n const parsedAnimation = parsedCamera.animations[animationIndex];\n const internalClass = GetClass(\"BABYLON.Animation\");\n if (internalClass) {\n camera.animations.push(internalClass.Parse(parsedAnimation));\n }\n }\n Node.ParseAnimationRanges(camera, parsedCamera, scene);\n }\n if (parsedCamera.autoAnimate) {\n scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, parsedCamera.autoAnimateSpeed || 1.0);\n }\n // Check if isEnabled is defined to be back compatible with prior serialized versions.\n if (parsedCamera.isEnabled !== undefined) {\n camera.setEnabled(parsedCamera.isEnabled);\n }\n return camera;\n }\n /** @internal */\n _calculateHandednessMultiplier() {\n let handednessMultiplier = this.getScene().useRightHandedSystem ? -1 : 1;\n if (this.parent && this.parent._getWorldMatrixDeterminant() < 0) {\n handednessMultiplier *= -1;\n }\n return handednessMultiplier;\n }\n}\n/**\n * @internal\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nCamera._CreateDefaultParsedCamera = (name, scene) => {\n throw _WarnImport(\"UniversalCamera\");\n};\n/**\n * This is the default projection mode used by the cameras.\n * It helps recreating a feeling of perspective and better appreciate depth.\n * This is the best way to simulate real life cameras.\n */\nCamera.PERSPECTIVE_CAMERA = 0;\n/**\n * This helps creating camera with an orthographic mode.\n * Orthographic is commonly used in engineering as a means to produce object specifications that communicate dimensions unambiguously, each line of 1 unit length (cm, meter..whatever) will appear to have the same length everywhere on the drawing. This allows the drafter to dimension only a subset of lines and let the reader know that other lines of that length on the drawing are also that length in reality. Every parallel line in the drawing is also parallel in the object.\n */\nCamera.ORTHOGRAPHIC_CAMERA = 1;\n/**\n * This is the default FOV mode for perspective cameras.\n * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.\n */\nCamera.FOVMODE_VERTICAL_FIXED = 0;\n/**\n * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.\n */\nCamera.FOVMODE_HORIZONTAL_FIXED = 1;\n/**\n * This specifies there is no need for a camera rig.\n * Basically only one eye is rendered corresponding to the camera.\n */\nCamera.RIG_MODE_NONE = 0;\n/**\n * Simulates a camera Rig with one blue eye and one red eye.\n * This can be use with 3d blue and red glasses.\n */\nCamera.RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10;\n/**\n * Defines that both eyes of the camera will be rendered side by side with a parallel target.\n */\nCamera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11;\n/**\n * Defines that both eyes of the camera will be rendered side by side with a none parallel target.\n */\nCamera.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12;\n/**\n * Defines that both eyes of the camera will be rendered over under each other.\n */\nCamera.RIG_MODE_STEREOSCOPIC_OVERUNDER = 13;\n/**\n * Defines that both eyes of the camera will be rendered on successive lines interlaced for passive 3d monitors.\n */\nCamera.RIG_MODE_STEREOSCOPIC_INTERLACED = 14;\n/**\n * Defines that both eyes of the camera should be renderered in a VR mode (carbox).\n */\nCamera.RIG_MODE_VR = 20;\n/**\n * Custom rig mode allowing rig cameras to be populated manually with any number of cameras\n */\nCamera.RIG_MODE_CUSTOM = 22;\n/**\n * Defines if by default attaching controls should prevent the default javascript event to continue.\n */\nCamera.ForceAttachControlToAlwaysPreventDefault = false;\n__decorate([\n serializeAsVector3(\"position\")\n], Camera.prototype, \"_position\", void 0);\n__decorate([\n serializeAsVector3(\"upVector\")\n], Camera.prototype, \"_upVector\", void 0);\n__decorate([\n serialize()\n], Camera.prototype, \"orthoLeft\", null);\n__decorate([\n serialize()\n], Camera.prototype, \"orthoRight\", null);\n__decorate([\n serialize()\n], Camera.prototype, \"orthoBottom\", null);\n__decorate([\n serialize()\n], Camera.prototype, \"orthoTop\", null);\n__decorate([\n serialize()\n], Camera.prototype, \"fov\", void 0);\n__decorate([\n serialize()\n], Camera.prototype, \"projectionPlaneTilt\", void 0);\n__decorate([\n serialize()\n], Camera.prototype, \"minZ\", void 0);\n__decorate([\n serialize()\n], Camera.prototype, \"maxZ\", void 0);\n__decorate([\n serialize()\n], Camera.prototype, \"inertia\", void 0);\n__decorate([\n serialize()\n], Camera.prototype, \"mode\", null);\n__decorate([\n serialize()\n], Camera.prototype, \"layerMask\", void 0);\n__decorate([\n serialize()\n], Camera.prototype, \"fovMode\", void 0);\n__decorate([\n serialize()\n], Camera.prototype, \"cameraRigMode\", void 0);\n__decorate([\n serialize()\n], Camera.prototype, \"interaxialDistance\", void 0);\n__decorate([\n serialize()\n], Camera.prototype, \"isStereoscopicSideBySide\", void 0);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,SAAS,EAAEC,kBAAkB,QAAQ,uBAAuB;AACrE,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,MAAM,EAAEC,OAAO,EAAEC,UAAU,QAAQ,yBAAyB;AACrE,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,WAAW,QAAQ,qBAAqB;AACjD,SAASC,QAAQ,QAAQ,2BAA2B;AACpD,SAASC,OAAO,QAAQ,0BAA0B;AAElD,SAASC,mBAAmB,QAAQ,qCAAqC;AACzE;AACA;AACA;AACA;AACA,OAAO,MAAMC,MAAM,SAASP,IAAI,CAAC;EAC7B;AACJ;AACA;EACI,IAAIQ,QAAQA,CAAA,EAAG;IACX,OAAO,IAAI,CAACC,SAAS;EACzB;EACA,IAAID,QAAQA,CAACE,WAAW,EAAE;IACtB,IAAI,CAACD,SAAS,GAAGC,WAAW;EAChC;EACA;AACJ;AACA;AACA;EACI,IAAIC,QAAQA,CAACC,GAAG,EAAE;IACd,IAAI,CAACC,SAAS,GAAGD,GAAG;EACxB;E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