1 |
- {"ast":null,"code":"import { __decorate } from \"../../tslib.es6.js\";\nimport { serialize } from \"../../Misc/decorators.js\";\nimport { CameraInputTypes } from \"../../Cameras/cameraInputsManager.js\";\nimport { BaseCameraMouseWheelInput } from \"../../Cameras/Inputs/BaseCameraMouseWheelInput.js\";\nimport { Matrix, Vector3 } from \"../../Maths/math.vector.js\";\n// eslint-disable-next-line @typescript-eslint/naming-convention\nvar _CameraProperty;\n(function (_CameraProperty) {\n _CameraProperty[_CameraProperty[\"MoveRelative\"] = 0] = \"MoveRelative\";\n _CameraProperty[_CameraProperty[\"RotateRelative\"] = 1] = \"RotateRelative\";\n _CameraProperty[_CameraProperty[\"MoveScene\"] = 2] = \"MoveScene\";\n})(_CameraProperty || (_CameraProperty = {}));\n/**\n * Manage the mouse wheel inputs to control a free camera.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs\n */\nexport class FreeCameraMouseWheelInput extends BaseCameraMouseWheelInput {\n constructor() {\n super(...arguments);\n this._moveRelative = Vector3.Zero();\n this._rotateRelative = Vector3.Zero();\n this._moveScene = Vector3.Zero();\n /**\n * These are set to the desired default behaviour.\n */\n this._wheelXAction = _CameraProperty.MoveRelative;\n this._wheelXActionCoordinate = 0 /* Coordinate.X */;\n this._wheelYAction = _CameraProperty.MoveRelative;\n this._wheelYActionCoordinate = 2 /* Coordinate.Z */;\n this._wheelZAction = null;\n this._wheelZActionCoordinate = null;\n }\n /**\n * Gets the class name of the current input.\n * @returns the class name\n */\n getClassName() {\n return \"FreeCameraMouseWheelInput\";\n }\n /**\n * Set which movement axis (relative to camera's orientation) the mouse\n * wheel's X axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelXMoveRelative(axis) {\n if (axis === null && this._wheelXAction !== _CameraProperty.MoveRelative) {\n // Attempting to clear different _wheelXAction.\n return;\n }\n this._wheelXAction = _CameraProperty.MoveRelative;\n this._wheelXActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to camera's orientation) the\n * mouse wheel's X axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelXMoveRelative() {\n if (this._wheelXAction !== _CameraProperty.MoveRelative) {\n return null;\n }\n return this._wheelXActionCoordinate;\n }\n /**\n * Set which movement axis (relative to camera's orientation) the mouse\n * wheel's Y axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelYMoveRelative(axis) {\n if (axis === null && this._wheelYAction !== _CameraProperty.MoveRelative) {\n // Attempting to clear different _wheelYAction.\n return;\n }\n this._wheelYAction = _CameraProperty.MoveRelative;\n this._wheelYActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to camera's orientation) the\n * mouse wheel's Y axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelYMoveRelative() {\n if (this._wheelYAction !== _CameraProperty.MoveRelative) {\n return null;\n }\n return this._wheelYActionCoordinate;\n }\n /**\n * Set which movement axis (relative to camera's orientation) the mouse\n * wheel's Z axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelZMoveRelative(axis) {\n if (axis === null && this._wheelZAction !== _CameraProperty.MoveRelative) {\n // Attempting to clear different _wheelZAction.\n return;\n }\n this._wheelZAction = _CameraProperty.MoveRelative;\n this._wheelZActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to camera's orientation) the\n * mouse wheel's Z axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelZMoveRelative() {\n if (this._wheelZAction !== _CameraProperty.MoveRelative) {\n return null;\n }\n return this._wheelZActionCoordinate;\n }\n /**\n * Set which rotation axis (relative to camera's orientation) the mouse\n * wheel's X axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelXRotateRelative(axis) {\n if (axis === null && this._wheelXAction !== _CameraProperty.RotateRelative) {\n // Attempting to clear different _wheelXAction.\n return;\n }\n this._wheelXAction = _CameraProperty.RotateRelative;\n this._wheelXActionCoordinate = axis;\n }\n /**\n * Get the configured rotation axis (relative to camera's orientation) the\n * mouse wheel's X axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelXRotateRelative() {\n if (this._wheelXAction !== _CameraProperty.RotateRelative) {\n return null;\n }\n return this._wheelXActionCoordinate;\n }\n /**\n * Set which rotation axis (relative to camera's orientation) the mouse\n * wheel's Y axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelYRotateRelative(axis) {\n if (axis === null && this._wheelYAction !== _CameraProperty.RotateRelative) {\n // Attempting to clear different _wheelYAction.\n return;\n }\n this._wheelYAction = _CameraProperty.RotateRelative;\n this._wheelYActionCoordinate = axis;\n }\n /**\n * Get the configured rotation axis (relative to camera's orientation) the\n * mouse wheel's Y axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelYRotateRelative() {\n if (this._wheelYAction !== _CameraProperty.RotateRelative) {\n return null;\n }\n return this._wheelYActionCoordinate;\n }\n /**\n * Set which rotation axis (relative to camera's orientation) the mouse\n * wheel's Z axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelZRotateRelative(axis) {\n if (axis === null && this._wheelZAction !== _CameraProperty.RotateRelative) {\n // Attempting to clear different _wheelZAction.\n return;\n }\n this._wheelZAction = _CameraProperty.RotateRelative;\n this._wheelZActionCoordinate = axis;\n }\n /**\n * Get the configured rotation axis (relative to camera's orientation) the\n * mouse wheel's Z axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelZRotateRelative() {\n if (this._wheelZAction !== _CameraProperty.RotateRelative) {\n return null;\n }\n return this._wheelZActionCoordinate;\n }\n /**\n * Set which movement axis (relative to the scene) the mouse wheel's X axis\n * controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelXMoveScene(axis) {\n if (axis === null && this._wheelXAction !== _CameraProperty.MoveScene) {\n // Attempting to clear different _wheelXAction.\n return;\n }\n this._wheelXAction = _CameraProperty.MoveScene;\n this._wheelXActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to the scene) the mouse wheel's\n * X axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelXMoveScene() {\n if (this._wheelXAction !== _CameraProperty.MoveScene) {\n return null;\n }\n return this._wheelXActionCoordinate;\n }\n /**\n * Set which movement axis (relative to the scene) the mouse wheel's Y axis\n * controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelYMoveScene(axis) {\n if (axis === null && this._wheelYAction !== _CameraProperty.MoveScene) {\n // Attempting to clear different _wheelYAction.\n return;\n }\n this._wheelYAction = _CameraProperty.MoveScene;\n this._wheelYActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to the scene) the mouse wheel's\n * Y axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelYMoveScene() {\n if (this._wheelYAction !== _CameraProperty.MoveScene) {\n return null;\n }\n return this._wheelYActionCoordinate;\n }\n /**\n * Set which movement axis (relative to the scene) the mouse wheel's Z axis\n * controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelZMoveScene(axis) {\n if (axis === null && this._wheelZAction !== _CameraProperty.MoveScene) {\n // Attempting to clear different _wheelZAction.\n return;\n }\n this._wheelZAction = _CameraProperty.MoveScene;\n this._wheelZActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to the scene) the mouse wheel's\n * Z axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelZMoveScene() {\n if (this._wheelZAction !== _CameraProperty.MoveScene) {\n return null;\n }\n return this._wheelZActionCoordinate;\n }\n /**\n * Called for each rendered frame.\n */\n checkInputs() {\n if (this._wheelDeltaX === 0 && this._wheelDeltaY === 0 && this._wheelDeltaZ == 0) {\n return;\n }\n // Clear the camera properties that we might be updating.\n this._moveRelative.setAll(0);\n this._rotateRelative.setAll(0);\n this._moveScene.setAll(0);\n // Set the camera properties that are to be updated.\n this._updateCamera();\n if (this.camera.getScene().useRightHandedSystem) {\n // TODO: Does this need done for worldUpdate too?\n this._moveRelative.z *= -1;\n }\n // Convert updates relative to camera to world position update.\n const cameraTransformMatrix = Matrix.Zero();\n this.camera.getViewMatrix().invertToRef(cameraTransformMatrix);\n const transformedDirection = Vector3.Zero();\n Vector3.TransformNormalToRef(this._moveRelative, cameraTransformMatrix, transformedDirection);\n // Apply updates to camera position.\n this.camera.cameraRotation.x += this._rotateRelative.x / 200;\n this.camera.cameraRotation.y += this._rotateRelative.y / 200;\n this.camera.cameraDirection.addInPlace(transformedDirection);\n this.camera.cameraDirection.addInPlace(this._moveScene);\n // Call the base class implementation to handle observers and do cleanup.\n super.checkInputs();\n }\n /**\n * Update the camera according to any configured properties for the 3\n * mouse-wheel axis.\n */\n _updateCamera() {\n // Do the camera updates for each of the 3 touch-wheel axis.\n this._updateCameraProperty(this._wheelDeltaX, this._wheelXAction, this._wheelXActionCoordinate);\n this._updateCameraProperty(this._wheelDeltaY, this._wheelYAction, this._wheelYActionCoordinate);\n this._updateCameraProperty(this._wheelDeltaZ, this._wheelZAction, this._wheelZActionCoordinate);\n }\n /**\n * Update one property of the camera.\n * @param value\n * @param cameraProperty\n * @param coordinate\n */\n _updateCameraProperty( /* Mouse-wheel delta. */\n value, /* Camera property to be changed. */\n cameraProperty, /* Axis of Camera property to be changed. */\n coordinate) {\n if (value === 0) {\n // Mouse wheel has not moved.\n return;\n }\n if (cameraProperty === null || coordinate === null) {\n // Mouse wheel axis not configured.\n return;\n }\n let action = null;\n switch (cameraProperty) {\n case _CameraProperty.MoveRelative:\n action = this._moveRelative;\n break;\n case _CameraProperty.RotateRelative:\n action = this._rotateRelative;\n break;\n case _CameraProperty.MoveScene:\n action = this._moveScene;\n break;\n }\n switch (coordinate) {\n case 0 /* Coordinate.X */:\n action.set(value, 0, 0);\n break;\n case 1 /* Coordinate.Y */:\n action.set(0, value, 0);\n break;\n case 2 /* Coordinate.Z */:\n action.set(0, 0, value);\n break;\n }\n }\n}\n__decorate([serialize()], FreeCameraMouseWheelInput.prototype, \"wheelXMoveRelative\", null);\n__decorate([serialize()], FreeCameraMouseWheelInput.prototype, \"wheelYMoveRelative\", null);\n__decorate([serialize()], FreeCameraMouseWheelInput.prototype, \"wheelZMoveRelative\", null);\n__decorate([serialize()], FreeCameraMouseWheelInput.prototype, \"wheelXRotateRelative\", null);\n__decorate([serialize()], FreeCameraMouseWheelInput.prototype, \"wheelYRotateRelative\", null);\n__decorate([serialize()], FreeCameraMouseWheelInput.prototype, \"wheelZRotateRelative\", null);\n__decorate([serialize()], FreeCameraMouseWheelInput.prototype, \"wheelXMoveScene\", null);\n__decorate([serialize()], FreeCameraMouseWheelInput.prototype, \"wheelYMoveScene\", null);\n__decorate([serialize()], FreeCameraMouseWheelInput.prototype, \"wheelZMoveScene\", null);\nCameraInputTypes[\"FreeCameraMouseWheelInput\"] = FreeCameraMouseWheelInput;","map":{"version":3,"names":["__decorate","serialize","CameraInputTypes","BaseCameraMouseWheelInput","Matrix","Vector3","_CameraProperty","FreeCameraMouseWheelInput","constructor","arguments","_moveRelative","Zero","_rotateRelative","_moveScene","_wheelXAction","MoveRelative","_wheelXActionCoordinate","_wheelYAction","_wheelYActionCoordinate","_wheelZAction","_wheelZActionCoordinate","getClassName","wheelXMoveRelative","axis","wheelYMoveRelative","wheelZMoveRelative","wheelXRotateRelative","RotateRelative","wheelYRotateRelative","wheelZRotateRelative","wheelXMoveScene","MoveScene","wheelYMoveScene","wheelZMoveScene","checkInputs","_wheelDeltaX","_wheelDeltaY","_wheelDeltaZ","setAll","_updateCamera","camera","getScene","useRightHandedSystem","z","cameraTransformMatrix","getViewMatrix","invertToRef","transformedDirection","TransformNormalToRef","cameraRotation","x","y","cameraDirection","addInPlace","_updateCameraProperty","value","cameraProperty","coordinate","action","set","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Cameras/Inputs/freeCameraMouseWheelInput.js"],"sourcesContent":["import { __decorate } from \"../../tslib.es6.js\";\nimport { serialize } from \"../../Misc/decorators.js\";\nimport { CameraInputTypes } from \"../../Cameras/cameraInputsManager.js\";\nimport { BaseCameraMouseWheelInput } from \"../../Cameras/Inputs/BaseCameraMouseWheelInput.js\";\nimport { Matrix, Vector3 } from \"../../Maths/math.vector.js\";\n// eslint-disable-next-line @typescript-eslint/naming-convention\nvar _CameraProperty;\n(function (_CameraProperty) {\n _CameraProperty[_CameraProperty[\"MoveRelative\"] = 0] = \"MoveRelative\";\n _CameraProperty[_CameraProperty[\"RotateRelative\"] = 1] = \"RotateRelative\";\n _CameraProperty[_CameraProperty[\"MoveScene\"] = 2] = \"MoveScene\";\n})(_CameraProperty || (_CameraProperty = {}));\n/**\n * Manage the mouse wheel inputs to control a free camera.\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras/customizingCameraInputs\n */\nexport class FreeCameraMouseWheelInput extends BaseCameraMouseWheelInput {\n constructor() {\n super(...arguments);\n this._moveRelative = Vector3.Zero();\n this._rotateRelative = Vector3.Zero();\n this._moveScene = Vector3.Zero();\n /**\n * These are set to the desired default behaviour.\n */\n this._wheelXAction = _CameraProperty.MoveRelative;\n this._wheelXActionCoordinate = 0 /* Coordinate.X */;\n this._wheelYAction = _CameraProperty.MoveRelative;\n this._wheelYActionCoordinate = 2 /* Coordinate.Z */;\n this._wheelZAction = null;\n this._wheelZActionCoordinate = null;\n }\n /**\n * Gets the class name of the current input.\n * @returns the class name\n */\n getClassName() {\n return \"FreeCameraMouseWheelInput\";\n }\n /**\n * Set which movement axis (relative to camera's orientation) the mouse\n * wheel's X axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelXMoveRelative(axis) {\n if (axis === null && this._wheelXAction !== _CameraProperty.MoveRelative) {\n // Attempting to clear different _wheelXAction.\n return;\n }\n this._wheelXAction = _CameraProperty.MoveRelative;\n this._wheelXActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to camera's orientation) the\n * mouse wheel's X axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelXMoveRelative() {\n if (this._wheelXAction !== _CameraProperty.MoveRelative) {\n return null;\n }\n return this._wheelXActionCoordinate;\n }\n /**\n * Set which movement axis (relative to camera's orientation) the mouse\n * wheel's Y axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelYMoveRelative(axis) {\n if (axis === null && this._wheelYAction !== _CameraProperty.MoveRelative) {\n // Attempting to clear different _wheelYAction.\n return;\n }\n this._wheelYAction = _CameraProperty.MoveRelative;\n this._wheelYActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to camera's orientation) the\n * mouse wheel's Y axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelYMoveRelative() {\n if (this._wheelYAction !== _CameraProperty.MoveRelative) {\n return null;\n }\n return this._wheelYActionCoordinate;\n }\n /**\n * Set which movement axis (relative to camera's orientation) the mouse\n * wheel's Z axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelZMoveRelative(axis) {\n if (axis === null && this._wheelZAction !== _CameraProperty.MoveRelative) {\n // Attempting to clear different _wheelZAction.\n return;\n }\n this._wheelZAction = _CameraProperty.MoveRelative;\n this._wheelZActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to camera's orientation) the\n * mouse wheel's Z axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelZMoveRelative() {\n if (this._wheelZAction !== _CameraProperty.MoveRelative) {\n return null;\n }\n return this._wheelZActionCoordinate;\n }\n /**\n * Set which rotation axis (relative to camera's orientation) the mouse\n * wheel's X axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelXRotateRelative(axis) {\n if (axis === null && this._wheelXAction !== _CameraProperty.RotateRelative) {\n // Attempting to clear different _wheelXAction.\n return;\n }\n this._wheelXAction = _CameraProperty.RotateRelative;\n this._wheelXActionCoordinate = axis;\n }\n /**\n * Get the configured rotation axis (relative to camera's orientation) the\n * mouse wheel's X axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelXRotateRelative() {\n if (this._wheelXAction !== _CameraProperty.RotateRelative) {\n return null;\n }\n return this._wheelXActionCoordinate;\n }\n /**\n * Set which rotation axis (relative to camera's orientation) the mouse\n * wheel's Y axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelYRotateRelative(axis) {\n if (axis === null && this._wheelYAction !== _CameraProperty.RotateRelative) {\n // Attempting to clear different _wheelYAction.\n return;\n }\n this._wheelYAction = _CameraProperty.RotateRelative;\n this._wheelYActionCoordinate = axis;\n }\n /**\n * Get the configured rotation axis (relative to camera's orientation) the\n * mouse wheel's Y axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelYRotateRelative() {\n if (this._wheelYAction !== _CameraProperty.RotateRelative) {\n return null;\n }\n return this._wheelYActionCoordinate;\n }\n /**\n * Set which rotation axis (relative to camera's orientation) the mouse\n * wheel's Z axis controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelZRotateRelative(axis) {\n if (axis === null && this._wheelZAction !== _CameraProperty.RotateRelative) {\n // Attempting to clear different _wheelZAction.\n return;\n }\n this._wheelZAction = _CameraProperty.RotateRelative;\n this._wheelZActionCoordinate = axis;\n }\n /**\n * Get the configured rotation axis (relative to camera's orientation) the\n * mouse wheel's Z axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelZRotateRelative() {\n if (this._wheelZAction !== _CameraProperty.RotateRelative) {\n return null;\n }\n return this._wheelZActionCoordinate;\n }\n /**\n * Set which movement axis (relative to the scene) the mouse wheel's X axis\n * controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelXMoveScene(axis) {\n if (axis === null && this._wheelXAction !== _CameraProperty.MoveScene) {\n // Attempting to clear different _wheelXAction.\n return;\n }\n this._wheelXAction = _CameraProperty.MoveScene;\n this._wheelXActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to the scene) the mouse wheel's\n * X axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelXMoveScene() {\n if (this._wheelXAction !== _CameraProperty.MoveScene) {\n return null;\n }\n return this._wheelXActionCoordinate;\n }\n /**\n * Set which movement axis (relative to the scene) the mouse wheel's Y axis\n * controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelYMoveScene(axis) {\n if (axis === null && this._wheelYAction !== _CameraProperty.MoveScene) {\n // Attempting to clear different _wheelYAction.\n return;\n }\n this._wheelYAction = _CameraProperty.MoveScene;\n this._wheelYActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to the scene) the mouse wheel's\n * Y axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelYMoveScene() {\n if (this._wheelYAction !== _CameraProperty.MoveScene) {\n return null;\n }\n return this._wheelYActionCoordinate;\n }\n /**\n * Set which movement axis (relative to the scene) the mouse wheel's Z axis\n * controls.\n * @param axis The axis to be moved. Set null to clear.\n */\n set wheelZMoveScene(axis) {\n if (axis === null && this._wheelZAction !== _CameraProperty.MoveScene) {\n // Attempting to clear different _wheelZAction.\n return;\n }\n this._wheelZAction = _CameraProperty.MoveScene;\n this._wheelZActionCoordinate = axis;\n }\n /**\n * Get the configured movement axis (relative to the scene) the mouse wheel's\n * Z axis controls.\n * @returns The configured axis or null if none.\n */\n get wheelZMoveScene() {\n if (this._wheelZAction !== _CameraProperty.MoveScene) {\n return null;\n }\n return this._wheelZActionCoordinate;\n }\n /**\n * Called for each rendered frame.\n */\n checkInputs() {\n if (this._wheelDeltaX === 0 && this._wheelDeltaY === 0 && this._wheelDeltaZ == 0) {\n return;\n }\n // Clear the camera properties that we might be updating.\n this._moveRelative.setAll(0);\n this._rotateRelative.setAll(0);\n this._moveScene.setAll(0);\n // Set the camera properties that are to be updated.\n this._updateCamera();\n if (this.camera.getScene().useRightHandedSystem) {\n // TODO: Does this need done for worldUpdate too?\n this._moveRelative.z *= -1;\n }\n // Convert updates relative to camera to world position update.\n const cameraTransformMatrix = Matrix.Zero();\n this.camera.getViewMatrix().invertToRef(cameraTransformMatrix);\n const transformedDirection = Vector3.Zero();\n Vector3.TransformNormalToRef(this._moveRelative, cameraTransformMatrix, transformedDirection);\n // Apply updates to camera position.\n this.camera.cameraRotation.x += this._rotateRelative.x / 200;\n this.camera.cameraRotation.y += this._rotateRelative.y / 200;\n this.camera.cameraDirection.addInPlace(transformedDirection);\n this.camera.cameraDirection.addInPlace(this._moveScene);\n // Call the base class implementation to handle observers and do cleanup.\n super.checkInputs();\n }\n /**\n * Update the camera according to any configured properties for the 3\n * mouse-wheel axis.\n */\n _updateCamera() {\n // Do the camera updates for each of the 3 touch-wheel axis.\n this._updateCameraProperty(this._wheelDeltaX, this._wheelXAction, this._wheelXActionCoordinate);\n this._updateCameraProperty(this._wheelDeltaY, this._wheelYAction, this._wheelYActionCoordinate);\n this._updateCameraProperty(this._wheelDeltaZ, this._wheelZAction, this._wheelZActionCoordinate);\n }\n /**\n * Update one property of the camera.\n * @param value\n * @param cameraProperty\n * @param coordinate\n */\n _updateCameraProperty(\n /* Mouse-wheel delta. */\n value, \n /* Camera property to be changed. */\n cameraProperty, \n /* Axis of Camera property to be changed. */\n coordinate) {\n if (value === 0) {\n // Mouse wheel has not moved.\n return;\n }\n if (cameraProperty === null || coordinate === null) {\n // Mouse wheel axis not configured.\n return;\n }\n let action = null;\n switch (cameraProperty) {\n case _CameraProperty.MoveRelative:\n action = this._moveRelative;\n break;\n case _CameraProperty.RotateRelative:\n action = this._rotateRelative;\n break;\n case _CameraProperty.MoveScene:\n action = this._moveScene;\n break;\n }\n switch (coordinate) {\n case 0 /* Coordinate.X */:\n action.set(value, 0, 0);\n break;\n case 1 /* Coordinate.Y */:\n action.set(0, value, 0);\n break;\n case 2 /* Coordinate.Z */:\n action.set(0, 0, value);\n break;\n }\n }\n}\n__decorate([\n serialize()\n], FreeCameraMouseWheelInput.prototype, \"wheelXMoveRelative\", null);\n__decorate([\n serialize()\n], FreeCameraMouseWheelInput.prototype, \"wheelYMoveRelative\", null);\n__decorate([\n serialize()\n], FreeCameraMouseWheelInput.prototype, \"wheelZMoveRelative\", null);\n__decorate([\n serialize()\n], FreeCameraMouseWheelInput.prototype, \"wheelXRotateRelative\", null);\n__decorate([\n serialize()\n], FreeCameraMouseWheelInput.prototype, \"wheelYRotateRelative\", null);\n__decorate([\n serialize()\n], FreeCameraMouseWheelInput.prototype, \"wheelZRotateRelative\", null);\n__decorate([\n serialize()\n], FreeCameraMouseWheelInput.prototype, \"wheelXMoveScene\", null);\n__decorate([\n serialize()\n], FreeCameraMouseWheelInput.prototype, \"wheelYMoveScene\", null);\n__decorate([\n serialize()\n], FreeCameraMouseWheelInput.prototype, \"wheelZMoveScene\", null);\nCameraInputTypes[\"FreeCameraMouseWheelInput\"] = FreeCameraMouseWheelInput;\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,SAAS,QAAQ,0BAA0B;AACpD,SAASC,gBAAgB,QAAQ,sCAAsC;AACvE,SAASC,yBAAyB,QAAQ,mDAAmD;AAC7F,SAASC,MAAM,EAAEC,OAAO,QAAQ,4BAA4B;AAC5D;AACA,IAAIC,eAAe;AACnB,CAAC,UAAUA,eAAe,EAAE;EACxBA,eAAe,CAACA,eAAe,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,cAAc;EACrEA,eAAe,CAACA,eAAe,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,GAAG,gBAAgB;EACzEA,eAAe,CAACA,eAAe,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW;AACnE,CAAC,EAAEA,eAAe,KAAKA,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC;AAC7C;AACA;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,SAASJ,yBAAyB,CAAC;EACrEK,WAAWA,CAAA,EAAG;IACV,KAAK,CAAC,GAAGC,SAAS,CAAC;IACnB,IAAI,CAACC,aAAa,GAAGL,OAAO,CAACM,IAAI,CAAC,CAAC;IACnC,IAAI,CAACC,eAAe,GAAGP,OAAO,CAACM,IAAI,CAAC,CAAC;IACrC,IAAI,CAACE,UAAU,GAAGR,OAAO,CAACM,IAAI,CAAC,CAAC;IAChC;AACR;AACA;IACQ,IAAI,CAACG,aAAa,GAAGR,eAAe,CAACS,YAAY;IACjD,IAAI,CAACC,uBAAuB,GAAG,CAAC,CAAC;IACjC,IAAI,CAACC,aAAa,GAAGX,eAAe,CAACS,YAAY;IACjD,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