@babylonjs/core 6.44.0 → 6.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/Buffers/buffer.d.ts +22 -22
  2. package/Buffers/buffer.js +16 -15
  3. package/Buffers/buffer.js.map +1 -1
  4. package/Cameras/camera.d.ts +5 -5
  5. package/Cameras/camera.js +19 -19
  6. package/Cameras/camera.js.map +1 -1
  7. package/Engines/ICanvas.d.ts +2 -1
  8. package/Engines/ICanvas.js.map +1 -1
  9. package/Engines/constants.d.ts +96 -0
  10. package/Engines/constants.js +96 -0
  11. package/Engines/constants.js.map +1 -1
  12. package/Engines/thinEngine.js +2 -2
  13. package/Engines/thinEngine.js.map +1 -1
  14. package/Gizmos/gizmo.d.ts +14 -0
  15. package/Gizmos/gizmo.js +16 -0
  16. package/Gizmos/gizmo.js.map +1 -1
  17. package/Gizmos/gizmoManager.d.ts +12 -0
  18. package/Gizmos/gizmoManager.js +26 -0
  19. package/Gizmos/gizmoManager.js.map +1 -1
  20. package/Gizmos/positionGizmo.d.ts +16 -2
  21. package/Gizmos/positionGizmo.js +12 -2
  22. package/Gizmos/positionGizmo.js.map +1 -1
  23. package/Gizmos/rotationGizmo.d.ts +8 -0
  24. package/Gizmos/rotationGizmo.js +9 -0
  25. package/Gizmos/rotationGizmo.js.map +1 -1
  26. package/Gizmos/scaleGizmo.d.ts +15 -1
  27. package/Gizmos/scaleGizmo.js +11 -1
  28. package/Gizmos/scaleGizmo.js.map +1 -1
  29. package/Layers/effectLayer.js +4 -4
  30. package/Layers/effectLayer.js.map +1 -1
  31. package/Lights/Shadows/shadowGenerator.js +5 -5
  32. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  33. package/Materials/Background/backgroundMaterial.js +16 -16
  34. package/Materials/Background/backgroundMaterial.js.map +1 -1
  35. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +8 -8
  36. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  37. package/Materials/Node/Blocks/Dual/fogBlock.js +2 -2
  38. package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
  39. package/Materials/Node/Blocks/Dual/lightBlock.js +6 -6
  40. package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
  41. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +2 -2
  42. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  43. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +7 -7
  44. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  45. package/Materials/Node/Blocks/Vertex/bonesBlock.js +3 -3
  46. package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
  47. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +3 -3
  48. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  49. package/Materials/Node/nodeMaterial.js +3 -3
  50. package/Materials/Node/nodeMaterial.js.map +1 -1
  51. package/Materials/PBR/pbrAnisotropicConfiguration.js +3 -3
  52. package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
  53. package/Materials/PBR/pbrBaseMaterial.js +41 -41
  54. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  55. package/Materials/PBR/pbrClearCoatConfiguration.js +10 -10
  56. package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
  57. package/Materials/PBR/pbrIridescenceConfiguration.js +6 -6
  58. package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
  59. package/Materials/PBR/pbrSheenConfiguration.js +6 -6
  60. package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
  61. package/Materials/PBR/pbrSubSurfaceConfiguration.js +7 -7
  62. package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
  63. package/Materials/Textures/Loaders/ktxTextureLoader.js +1 -1
  64. package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
  65. package/Materials/Textures/dynamicTexture.js +1 -1
  66. package/Materials/Textures/dynamicTexture.js.map +1 -1
  67. package/Materials/Textures/texture.js +1 -1
  68. package/Materials/Textures/texture.js.map +1 -1
  69. package/Materials/index.d.ts +1 -0
  70. package/Materials/index.js +1 -0
  71. package/Materials/index.js.map +1 -1
  72. package/Materials/material.decalMapConfiguration.js +3 -3
  73. package/Materials/material.decalMapConfiguration.js.map +1 -1
  74. package/Materials/material.detailMapConfiguration.js +3 -3
  75. package/Materials/material.detailMapConfiguration.js.map +1 -1
  76. package/Materials/material.js +2 -2
  77. package/Materials/material.js.map +1 -1
  78. package/Materials/materialHelper.d.ts +1 -4
  79. package/Materials/materialHelper.functions.d.ts +275 -0
  80. package/Materials/materialHelper.functions.js +823 -0
  81. package/Materials/materialHelper.functions.js.map +1 -0
  82. package/Materials/materialHelper.js +64 -589
  83. package/Materials/materialHelper.js.map +1 -1
  84. package/Materials/materialPluginBase.d.ts +1 -1
  85. package/Materials/materialPluginBase.js +1 -1
  86. package/Materials/materialPluginBase.js.map +1 -1
  87. package/Materials/shaderMaterial.js +8 -8
  88. package/Materials/shaderMaterial.js.map +1 -1
  89. package/Materials/standardMaterial.js +33 -33
  90. package/Materials/standardMaterial.js.map +1 -1
  91. package/Meshes/Compression/dracoCompression.d.ts +23 -2
  92. package/Meshes/Compression/dracoCompression.js +76 -236
  93. package/Meshes/Compression/dracoCompression.js.map +1 -1
  94. package/Meshes/Compression/dracoCompressionWorker.d.ts +44 -0
  95. package/Meshes/Compression/dracoCompressionWorker.js +189 -0
  96. package/Meshes/Compression/dracoCompressionWorker.js.map +1 -0
  97. package/Meshes/trailMesh.js +1 -1
  98. package/Meshes/trailMesh.js.map +1 -1
  99. package/Misc/basis.d.ts +6 -1
  100. package/Misc/basis.js +11 -231
  101. package/Misc/basis.js.map +1 -1
  102. package/Misc/basisWorker.d.ts +13 -0
  103. package/Misc/basisWorker.js +249 -0
  104. package/Misc/basisWorker.js.map +1 -0
  105. package/Misc/khronosTextureContainer2.d.ts +25 -3
  106. package/Misc/khronosTextureContainer2.js +35 -106
  107. package/Misc/khronosTextureContainer2.js.map +1 -1
  108. package/Misc/khronosTextureContainer2Worker.d.ts +12 -0
  109. package/Misc/khronosTextureContainer2Worker.js +136 -0
  110. package/Misc/khronosTextureContainer2Worker.js.map +1 -0
  111. package/Navigation/Plugins/recastJSPlugin.d.ts +1 -1
  112. package/Navigation/Plugins/recastJSPlugin.js.map +1 -1
  113. package/Particles/gpuParticleSystem.js +3 -3
  114. package/Particles/gpuParticleSystem.js.map +1 -1
  115. package/Particles/particleSystem.js +7 -3
  116. package/Particles/particleSystem.js.map +1 -1
  117. package/Physics/v2/IPhysicsEnginePlugin.d.ts +8 -0
  118. package/Physics/v2/IPhysicsEnginePlugin.js +9 -0
  119. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  120. package/Physics/v2/Plugins/havokPlugin.d.ts +7 -1
  121. package/Physics/v2/Plugins/havokPlugin.js +19 -1
  122. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  123. package/PostProcesses/volumetricLightScatteringPostProcess.js +2 -2
  124. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  125. package/Rendering/depthRenderer.js +4 -4
  126. package/Rendering/depthRenderer.js.map +1 -1
  127. package/Rendering/geometryBufferRenderer.js +5 -5
  128. package/Rendering/geometryBufferRenderer.js.map +1 -1
  129. package/Rendering/outlineRenderer.js +4 -4
  130. package/Rendering/outlineRenderer.js.map +1 -1
  131. package/package.json +1 -1
  132. package/scene.d.ts +4 -4
  133. package/scene.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"camera.js","sourceRoot":"","sources":["../../../../dev/core/src/Cameras/camera.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK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EAAE;wDAC6B","sourcesContent":["import { serialize, SerializationHelper, serializeAsVector3 } from \"../Misc/decorators\";\r\nimport { SmartArray } from \"../Misc/smartArray\";\r\nimport { Tools } from \"../Misc/tools\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { CameraInputsManager } from \"./cameraInputsManager\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Matrix, Vector3, Quaternion } from \"../Maths/math.vector\";\r\nimport { Node } from \"../node\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { ICullable } from \"../Culling/boundingInfo\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { GetClass } from \"../Misc/typeStore\";\r\nimport { _WarnImport } from \"../Misc/devTools\";\r\nimport { Viewport } from \"../Maths/math.viewport\";\r\nimport { Frustum } from \"../Maths/math.frustum\";\r\nimport type { Plane } from \"../Maths/math.plane\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport type { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport type { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { FreeCamera } from \"./freeCamera\";\r\nimport type { TargetCamera } from \"./targetCamera\";\r\nimport type { Ray } from \"../Culling/ray\";\r\nimport type { ArcRotateCamera } from \"./arcRotateCamera\";\r\n\r\n/**\r\n * Oblique projection values\r\n */\r\nexport interface IObliqueParams {\r\n /** The angle of the plane */\r\n angle: number;\r\n /** The length of the plane */\r\n length: number;\r\n /** The offset of the plane */\r\n offset: number;\r\n}\r\n\r\n/**\r\n * This is the base class of all the camera used in the application.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\r\n */\r\nexport class Camera extends Node {\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static _CreateDefaultParsedCamera = (name: string, scene: Scene): Camera => {\r\n throw _WarnImport(\"UniversalCamera\");\r\n };\r\n\r\n /**\r\n * This is the default projection mode used by the cameras.\r\n * It helps recreating a feeling of perspective and better appreciate depth.\r\n * This is the best way to simulate real life cameras.\r\n */\r\n public static readonly PERSPECTIVE_CAMERA = Constants.PERSPECTIVE_CAMERA;\r\n /**\r\n * This helps creating camera with an orthographic mode.\r\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.\r\n */\r\n public static readonly ORTHOGRAPHIC_CAMERA = Constants.ORTHOGRAPHIC_CAMERA;\r\n\r\n /**\r\n * This is the default FOV mode for perspective cameras.\r\n * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.\r\n */\r\n public static readonly FOVMODE_VERTICAL_FIXED = Constants.FOVMODE_VERTICAL_FIXED;\r\n /**\r\n * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.\r\n */\r\n public static readonly FOVMODE_HORIZONTAL_FIXED = Constants.FOVMODE_HORIZONTAL_FIXED;\r\n\r\n /**\r\n * This specifies there is no need for a camera rig.\r\n * Basically only one eye is rendered corresponding to the camera.\r\n */\r\n public static readonly RIG_MODE_NONE = Constants.RIG_MODE_NONE;\r\n /**\r\n * Simulates a camera Rig with one blue eye and one red eye.\r\n * This can be use with 3d blue and red glasses.\r\n */\r\n public static readonly RIG_MODE_STEREOSCOPIC_ANAGLYPH = Constants.RIG_MODE_STEREOSCOPIC_ANAGLYPH;\r\n /**\r\n * Defines that both eyes of the camera will be rendered side by side with a parallel target.\r\n */\r\n public static readonly RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL;\r\n /**\r\n * Defines that both eyes of the camera will be rendered side by side with a none parallel target.\r\n */\r\n public static readonly RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;\r\n /**\r\n * Defines that both eyes of the camera will be rendered over under each other.\r\n */\r\n public static readonly RIG_MODE_STEREOSCOPIC_OVERUNDER = Constants.RIG_MODE_STEREOSCOPIC_OVERUNDER;\r\n /**\r\n * Defines that both eyes of the camera will be rendered on successive lines interlaced for passive 3d monitors.\r\n */\r\n public static readonly RIG_MODE_STEREOSCOPIC_INTERLACED = Constants.RIG_MODE_STEREOSCOPIC_INTERLACED;\r\n /**\r\n * Defines that both eyes of the camera should be renderered in a VR mode (carbox).\r\n */\r\n public static readonly RIG_MODE_VR = Constants.RIG_MODE_VR;\r\n /**\r\n * Custom rig mode allowing rig cameras to be populated manually with any number of cameras\r\n */\r\n public static readonly RIG_MODE_CUSTOM = Constants.RIG_MODE_CUSTOM;\r\n\r\n /**\r\n * Defines if by default attaching controls should prevent the default javascript event to continue.\r\n */\r\n public static ForceAttachControlToAlwaysPreventDefault = false;\r\n\r\n /**\r\n * Define the input manager associated with the camera.\r\n */\r\n public inputs: CameraInputsManager<Camera>;\r\n\r\n /** @internal */\r\n @serializeAsVector3(\"position\")\r\n public _position = Vector3.Zero();\r\n\r\n /**\r\n * Define the current local position of the camera in the scene\r\n */\r\n public get position(): Vector3 {\r\n return this._position;\r\n }\r\n\r\n public set position(newPosition: Vector3) {\r\n this._position = newPosition;\r\n }\r\n\r\n @serializeAsVector3(\"upVector\")\r\n protected _upVector = Vector3.Up();\r\n\r\n /**\r\n * The vector the camera should consider as up.\r\n * (default is Vector3(0, 1, 0) aka Vector3.Up())\r\n */\r\n public set upVector(vec: Vector3) {\r\n this._upVector = vec;\r\n }\r\n\r\n public get upVector() {\r\n return this._upVector;\r\n }\r\n\r\n /**\r\n * Object containing oblique projection values (only used with ORTHOGRAPHIC_CAMERA)\r\n */\r\n public oblique: Nullable<IObliqueParams> = null;\r\n\r\n /**\r\n * The screen area in scene units squared\r\n */\r\n public get screenArea(): number {\r\n let x = 0;\r\n let y = 0;\r\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\r\n if (this.fovMode === Camera.FOVMODE_VERTICAL_FIXED) {\r\n y = this.minZ * 2 * Math.tan(this.fov / 2);\r\n x = this.getEngine().getAspectRatio(this) * y;\r\n } else {\r\n x = this.minZ * 2 * Math.tan(this.fov / 2);\r\n y = x / this.getEngine().getAspectRatio(this);\r\n }\r\n } else {\r\n const halfWidth = this.getEngine().getRenderWidth() / 2.0;\r\n const halfHeight = this.getEngine().getRenderHeight() / 2.0;\r\n\r\n x = (this.orthoRight ?? halfWidth) - (this.orthoLeft ?? -halfWidth);\r\n y = (this.orthoTop ?? halfHeight) - (this.orthoBottom ?? -halfHeight);\r\n }\r\n\r\n return x * y;\r\n }\r\n\r\n /**\r\n * Define the current limit on the left side for an orthographic camera\r\n * In scene unit\r\n */\r\n private _orthoLeft: Nullable<number> = null;\r\n\r\n public set orthoLeft(value: Nullable<number>) {\r\n this._orthoLeft = value;\r\n\r\n for (const rigCamera of this._rigCameras) {\r\n rigCamera.orthoLeft = value;\r\n }\r\n }\r\n\r\n @serialize()\r\n public get orthoLeft(): Nullable<number> {\r\n return this._orthoLeft;\r\n }\r\n\r\n /**\r\n * Define the current limit on the right side for an orthographic camera\r\n * In scene unit\r\n */\r\n private _orthoRight: Nullable<number> = null;\r\n\r\n public set orthoRight(value: Nullable<number>) {\r\n this._orthoRight = value;\r\n\r\n for (const rigCamera of this._rigCameras) {\r\n rigCamera.orthoRight = value;\r\n }\r\n }\r\n\r\n @serialize()\r\n public get orthoRight(): Nullable<number> {\r\n return this._orthoRight;\r\n }\r\n\r\n /**\r\n * Define the current limit on the bottom side for an orthographic camera\r\n * In scene unit\r\n */\r\n private _orthoBottom: Nullable<number> = null;\r\n\r\n public set orthoBottom(value: Nullable<number>) {\r\n this._orthoBottom = value;\r\n\r\n for (const rigCamera of this._rigCameras) {\r\n rigCamera.orthoBottom = value;\r\n }\r\n }\r\n\r\n @serialize()\r\n public get orthoBottom(): Nullable<number> {\r\n return this._orthoBottom;\r\n }\r\n\r\n /**\r\n * Define the current limit on the top side for an orthographic camera\r\n * In scene unit\r\n */\r\n private _orthoTop: Nullable<number> = null;\r\n\r\n public set orthoTop(value: Nullable<number>) {\r\n this._orthoTop = value;\r\n\r\n for (const rigCamera of this._rigCameras) {\r\n rigCamera.orthoTop = value;\r\n }\r\n }\r\n\r\n @serialize()\r\n public get orthoTop(): Nullable<number> {\r\n return this._orthoTop;\r\n }\r\n\r\n /**\r\n * Field Of View is set in Radians. (default is 0.8)\r\n */\r\n @serialize()\r\n public fov = 0.8;\r\n\r\n /**\r\n * Projection plane tilt around the X axis (horizontal), set in Radians. (default is 0)\r\n * Can be used to make vertical lines in world space actually vertical on the screen.\r\n * See https://forum.babylonjs.com/t/add-vertical-shift-to-3ds-max-exporter-babylon-cameras/17480\r\n */\r\n @serialize()\r\n public projectionPlaneTilt = 0;\r\n\r\n /**\r\n * Define the minimum distance the camera can see from.\r\n * This is important to note that the depth buffer are not infinite and the closer it starts\r\n * the more your scene might encounter depth fighting issue.\r\n */\r\n @serialize()\r\n public minZ = 1;\r\n\r\n /**\r\n * Define the maximum distance the camera can see to.\r\n * This is important to note that the depth buffer are not infinite and the further it end\r\n * the more your scene might encounter depth fighting issue.\r\n */\r\n @serialize()\r\n public maxZ = 10000.0;\r\n\r\n /**\r\n * Define the default inertia of the camera.\r\n * This helps giving a smooth feeling to the camera movement.\r\n */\r\n @serialize()\r\n public inertia = 0.9;\r\n\r\n /**\r\n * Define the mode of the camera (Camera.PERSPECTIVE_CAMERA or Camera.ORTHOGRAPHIC_CAMERA)\r\n */\r\n private _mode = Camera.PERSPECTIVE_CAMERA;\r\n set mode(mode: number) {\r\n this._mode = mode;\r\n\r\n // Pass the mode down to the rig cameras\r\n for (const rigCamera of this._rigCameras) {\r\n rigCamera.mode = mode;\r\n }\r\n }\r\n\r\n @serialize()\r\n get mode(): number {\r\n return this._mode;\r\n }\r\n\r\n /**\r\n * Define whether the camera is intermediate.\r\n * This is useful to not present the output directly to the screen in case of rig without post process for instance\r\n */\r\n public isIntermediate = false;\r\n\r\n /**\r\n * Define the viewport of the camera.\r\n * This correspond to the portion of the screen the camera will render to in normalized 0 to 1 unit.\r\n */\r\n public viewport = new Viewport(0, 0, 1.0, 1.0);\r\n\r\n /**\r\n * Restricts the camera to viewing objects with the same layerMask.\r\n * A camera with a layerMask of 1 will render mesh.layerMask & camera.layerMask!== 0\r\n */\r\n @serialize()\r\n public layerMask: number = 0x0fffffff;\r\n\r\n /**\r\n * fovMode sets the camera frustum bounds to the viewport bounds. (default is FOVMODE_VERTICAL_FIXED)\r\n */\r\n @serialize()\r\n public fovMode: number = Camera.FOVMODE_VERTICAL_FIXED;\r\n\r\n /**\r\n * Rig mode of the camera.\r\n * This is useful to create the camera with two \"eyes\" instead of one to create VR or stereoscopic scenes.\r\n * This is normally controlled byt the camera themselves as internal use.\r\n */\r\n @serialize()\r\n public cameraRigMode = Camera.RIG_MODE_NONE;\r\n\r\n /**\r\n * Defines the distance between both \"eyes\" in case of a RIG\r\n */\r\n @serialize()\r\n public interaxialDistance: number;\r\n\r\n /**\r\n * Defines if stereoscopic rendering is done side by side or over under.\r\n */\r\n @serialize()\r\n public isStereoscopicSideBySide: boolean;\r\n\r\n /**\r\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\r\n * This is pretty helpful if you wish to make a camera render to a texture you could reuse somewhere\r\n * else in the scene. (Eg. security camera)\r\n *\r\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)\r\n */\r\n public customRenderTargets: RenderTargetTexture[] = [];\r\n /**\r\n * When set, the camera will render to this render target instead of the default canvas\r\n *\r\n * If the desire is to use the output of a camera as a texture in the scene consider using camera.customRenderTargets instead\r\n */\r\n public outputRenderTarget: Nullable<RenderTargetTexture> = null;\r\n\r\n /**\r\n * Observable triggered when the camera view matrix has changed.\r\n */\r\n public onViewMatrixChangedObservable = new Observable<Camera>();\r\n /**\r\n * Observable triggered when the camera Projection matrix has changed.\r\n */\r\n public onProjectionMatrixChangedObservable = new Observable<Camera>();\r\n /**\r\n * Observable triggered when the inputs have been processed.\r\n */\r\n public onAfterCheckInputsObservable = new Observable<Camera>();\r\n /**\r\n * Observable triggered when reset has been called and applied to the camera.\r\n */\r\n public onRestoreStateObservable = new Observable<Camera>();\r\n\r\n /**\r\n * Is this camera a part of a rig system?\r\n */\r\n public isRigCamera: boolean = false;\r\n\r\n /**\r\n * If isRigCamera set to true this will be set with the parent camera.\r\n * The parent camera is not (!) necessarily the .parent of this camera (like in the case of XR)\r\n */\r\n public rigParent?: Camera;\r\n\r\n /**\r\n * Render pass id used by the camera to render into the main framebuffer\r\n */\r\n public renderPassId: number;\r\n\r\n private _hasMoved = false;\r\n\r\n /**\r\n * Gets a flag indicating that the camera has moved in some way since the last call to Camera.update()\r\n */\r\n public get hasMoved() {\r\n return this._hasMoved;\r\n }\r\n\r\n /** @internal */\r\n public _cameraRigParams: any;\r\n /** @internal */\r\n public _rigCameras = new Array<Camera>();\r\n /** @internal */\r\n public _rigPostProcess: Nullable<PostProcess>;\r\n\r\n /** @internal */\r\n public _skipRendering = false;\r\n\r\n /** @internal */\r\n public _projectionMatrix = new Matrix();\r\n\r\n /** @internal */\r\n public _postProcesses = new Array<Nullable<PostProcess>>();\r\n\r\n /** @internal */\r\n public _activeMeshes = new SmartArray<AbstractMesh>(256);\r\n\r\n protected _globalPosition = Vector3.Zero();\r\n\r\n /** @internal */\r\n public _computedViewMatrix = Matrix.Identity();\r\n private _doNotComputeProjectionMatrix = false;\r\n private _transformMatrix = Matrix.Zero();\r\n private _frustumPlanes: Plane[];\r\n private _refreshFrustumPlanes = true;\r\n private _storedFov: number;\r\n private _stateStored: boolean;\r\n private _absoluteRotation: Quaternion = Quaternion.Identity();\r\n\r\n /**\r\n * Instantiates a new camera object.\r\n * This should not be used directly but through the inherited cameras: ArcRotate, Free...\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\r\n * @param name Defines the name of the camera in the scene\r\n * @param position Defines the position of the camera\r\n * @param scene Defines the scene the camera belongs too\r\n * @param setActiveOnSceneIfNoneActive Defines if the camera should be set as active after creation if no other camera have been defined in the scene\r\n */\r\n constructor(name: string, position: Vector3, scene?: Scene, setActiveOnSceneIfNoneActive = true) {\r\n super(name, scene);\r\n\r\n this.getScene().addCamera(this);\r\n\r\n if (setActiveOnSceneIfNoneActive && !this.getScene().activeCamera) {\r\n this.getScene().activeCamera = this;\r\n }\r\n\r\n this.position = position;\r\n this.renderPassId = this.getScene().getEngine().createRenderPassId(`Camera ${name}`);\r\n }\r\n\r\n /**\r\n * Store current camera state (fov, position, etc..)\r\n * @returns the camera\r\n */\r\n public storeState(): Camera {\r\n this._stateStored = true;\r\n this._storedFov = this.fov;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Restores the camera state values if it has been stored. You must call storeState() first\r\n * @returns true if restored and false otherwise\r\n */\r\n protected _restoreStateValues(): boolean {\r\n if (!this._stateStored) {\r\n return false;\r\n }\r\n\r\n this.fov = this._storedFov;\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Restored camera state. You must call storeState() first.\r\n * @returns true if restored and false otherwise\r\n */\r\n public restoreState(): boolean {\r\n if (this._restoreStateValues()) {\r\n this.onRestoreStateObservable.notifyObservers(this);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets the class name of the camera.\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"Camera\";\r\n }\r\n\r\n /** @internal */\r\n public readonly _isCamera = true;\r\n\r\n /**\r\n * Gets a string representation of the camera useful for debug purpose.\r\n * @param fullDetails Defines that a more verbose level of logging is required\r\n * @returns the string representation\r\n */\r\n public toString(fullDetails?: boolean): string {\r\n let ret = \"Name: \" + this.name;\r\n ret += \", type: \" + this.getClassName();\r\n if (this.animations) {\r\n for (let i = 0; i < this.animations.length; i++) {\r\n ret += \", animation[0]: \" + this.animations[i].toString(fullDetails);\r\n }\r\n }\r\n return ret;\r\n }\r\n\r\n /**\r\n * Automatically tilts the projection plane, using `projectionPlaneTilt`, to correct the perspective effect on vertical lines.\r\n */\r\n public applyVerticalCorrection() {\r\n const rot = this.absoluteRotation.toEulerAngles();\r\n\r\n this.projectionPlaneTilt = this._scene.useRightHandedSystem ? -rot.x : rot.x;\r\n }\r\n\r\n /**\r\n * Gets the current world space position of the camera.\r\n */\r\n public get globalPosition(): Vector3 {\r\n return this._globalPosition;\r\n }\r\n\r\n /**\r\n * Gets the list of active meshes this frame (meshes no culled or excluded by lod s in the frame)\r\n * @returns the active meshe list\r\n */\r\n public getActiveMeshes(): SmartArray<AbstractMesh> {\r\n return this._activeMeshes;\r\n }\r\n\r\n /**\r\n * Check whether a mesh is part of the current active mesh list of the camera\r\n * @param mesh Defines the mesh to check\r\n * @returns true if active, false otherwise\r\n */\r\n public isActiveMesh(mesh: Mesh): boolean {\r\n return this._activeMeshes.indexOf(mesh) !== -1;\r\n }\r\n\r\n /**\r\n * Is this camera ready to be used/rendered\r\n * @param completeCheck defines if a complete check (including post processes) has to be done (false by default)\r\n * @returns true if the camera is ready\r\n */\r\n public isReady(completeCheck = false): boolean {\r\n if (completeCheck) {\r\n for (const pp of this._postProcesses) {\r\n if (pp && !pp.isReady()) {\r\n return false;\r\n }\r\n }\r\n }\r\n return super.isReady(completeCheck);\r\n }\r\n\r\n /** @internal */\r\n public _initCache() {\r\n super._initCache();\r\n\r\n this._cache.position = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n this._cache.upVector = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n\r\n this._cache.mode = undefined;\r\n this._cache.minZ = undefined;\r\n this._cache.maxZ = undefined;\r\n\r\n this._cache.fov = undefined;\r\n this._cache.fovMode = undefined;\r\n this._cache.aspectRatio = undefined;\r\n\r\n this._cache.orthoLeft = undefined;\r\n this._cache.orthoRight = undefined;\r\n this._cache.orthoBottom = undefined;\r\n this._cache.orthoTop = undefined;\r\n this._cache.obliqueAngle = undefined;\r\n this._cache.obliqueLength = undefined;\r\n this._cache.obliqueOffset = undefined;\r\n this._cache.renderWidth = undefined;\r\n this._cache.renderHeight = undefined;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateCache(ignoreParentClass?: boolean): void {\r\n if (!ignoreParentClass) {\r\n super._updateCache();\r\n }\r\n\r\n this._cache.position.copyFrom(this.position);\r\n this._cache.upVector.copyFrom(this.upVector);\r\n }\r\n\r\n /** @internal */\r\n public _isSynchronized(): boolean {\r\n return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();\r\n }\r\n\r\n /** @internal */\r\n public _isSynchronizedViewMatrix(): boolean {\r\n if (!super._isSynchronized()) {\r\n return false;\r\n }\r\n\r\n return this._cache.position.equals(this.position) && this._cache.upVector.equals(this.upVector) && this.isSynchronizedWithParent();\r\n }\r\n\r\n /** @internal */\r\n public _isSynchronizedProjectionMatrix(): boolean {\r\n let isSynchronized = this._cache.mode === this.mode && this._cache.minZ === this.minZ && this._cache.maxZ === this.maxZ;\r\n\r\n if (!isSynchronized) {\r\n return false;\r\n }\r\n\r\n const engine = this.getEngine();\r\n\r\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\r\n isSynchronized =\r\n this._cache.fov === this.fov &&\r\n this._cache.fovMode === this.fovMode &&\r\n this._cache.aspectRatio === engine.getAspectRatio(this) &&\r\n this._cache.projectionPlaneTilt === this.projectionPlaneTilt;\r\n } else {\r\n isSynchronized =\r\n this._cache.orthoLeft === this.orthoLeft &&\r\n this._cache.orthoRight === this.orthoRight &&\r\n this._cache.orthoBottom === this.orthoBottom &&\r\n this._cache.orthoTop === this.orthoTop &&\r\n this._cache.renderWidth === engine.getRenderWidth() &&\r\n this._cache.renderHeight === engine.getRenderHeight();\r\n\r\n if (this.oblique) {\r\n isSynchronized =\r\n isSynchronized &&\r\n this._cache.obliqueAngle === this.oblique.angle &&\r\n this._cache.obliqueLength === this.oblique.length &&\r\n this._cache.obliqueOffset === this.oblique.offset;\r\n }\r\n }\r\n\r\n return isSynchronized;\r\n }\r\n\r\n /**\r\n * Attach the input controls to a specific dom element to get the input from.\r\n * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)\r\n */\r\n public attachControl(noPreventDefault?: boolean): void;\r\n /**\r\n * Attach the input controls to a specific dom element to get the input from.\r\n * @param ignored defines an ignored parameter kept for backward compatibility.\r\n * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)\r\n * BACK COMPAT SIGNATURE ONLY.\r\n */\r\n public attachControl(ignored: any, noPreventDefault?: boolean): void;\r\n /**\r\n * Attach the input controls to a specific dom element to get the input from.\r\n * This function is here because typescript removes the typing of the last function.\r\n * @param _ignored defines an ignored parameter kept for backward compatibility.\r\n * @param _noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)\r\n */\r\n public attachControl(_ignored?: any, _noPreventDefault?: boolean): void {}\r\n\r\n /**\r\n * Detach the current controls from the specified dom element.\r\n */\r\n public detachControl(): void;\r\n /**\r\n * Detach the current controls from the specified dom element.\r\n * @param ignored defines an ignored parameter kept for backward compatibility.\r\n */\r\n public detachControl(ignored?: any): void;\r\n /**\r\n * Detach the current controls from the specified dom element.\r\n * This function is here because typescript removes the typing of the last function.\r\n * @param _ignored defines an ignored parameter kept for backward compatibility.\r\n */\r\n public detachControl(_ignored?: any): void {}\r\n\r\n /**\r\n * Update the camera state according to the different inputs gathered during the frame.\r\n */\r\n public update(): void {\r\n this._hasMoved = false;\r\n this._checkInputs();\r\n if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\r\n this._updateRigCameras();\r\n }\r\n\r\n // Attempt to update the camera's view and projection matrices.\r\n // This call is being made because these matrices are no longer being updated\r\n // as a part of the picking ray process (in addition to scene.render).\r\n this.getViewMatrix();\r\n this.getProjectionMatrix();\r\n }\r\n\r\n /** @internal */\r\n public _checkInputs(): void {\r\n this.onAfterCheckInputsObservable.notifyObservers(this);\r\n }\r\n\r\n /** @internal */\r\n public get rigCameras(): Camera[] {\r\n return this._rigCameras;\r\n }\r\n\r\n /**\r\n * Gets the post process used by the rig cameras\r\n */\r\n public get rigPostProcess(): Nullable<PostProcess> {\r\n return this._rigPostProcess;\r\n }\r\n\r\n /**\r\n * Internal, gets the first post process.\r\n * @returns the first post process to be run on this camera.\r\n */\r\n public _getFirstPostProcess(): Nullable<PostProcess> {\r\n for (let ppIndex = 0; ppIndex < this._postProcesses.length; ppIndex++) {\r\n if (this._postProcesses[ppIndex] !== null) {\r\n return this._postProcesses[ppIndex];\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private _cascadePostProcessesToRigCams(): void {\r\n // invalidate framebuffer\r\n const firstPostProcess = this._getFirstPostProcess();\r\n if (firstPostProcess) {\r\n firstPostProcess.markTextureDirty();\r\n }\r\n\r\n // glue the rigPostProcess to the end of the user postprocesses & assign to each sub-camera\r\n for (let i = 0, len = this._rigCameras.length; i < len; i++) {\r\n const cam = this._rigCameras[i];\r\n const rigPostProcess = cam._rigPostProcess;\r\n\r\n // for VR rig, there does not have to be a post process\r\n if (rigPostProcess) {\r\n const isPass = rigPostProcess.getEffectName() === \"pass\";\r\n if (isPass) {\r\n // any rig which has a PassPostProcess for rig[0], cannot be isIntermediate when there are also user postProcesses\r\n cam.isIntermediate = this._postProcesses.length === 0;\r\n }\r\n cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess);\r\n rigPostProcess.markTextureDirty();\r\n } else {\r\n cam._postProcesses = this._postProcesses.slice(0);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Attach a post process to the camera.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess\r\n * @param postProcess The post process to attach to the camera\r\n * @param insertAt The position of the post process in case several of them are in use in the scene\r\n * @returns the position the post process has been inserted at\r\n */\r\n public attachPostProcess(postProcess: PostProcess, insertAt: Nullable<number> = null): number {\r\n if (!postProcess.isReusable() && this._postProcesses.indexOf(postProcess) > -1) {\r\n Logger.Error(\"You're trying to reuse a post process not defined as reusable.\");\r\n return 0;\r\n }\r\n\r\n if (insertAt == null || insertAt < 0) {\r\n this._postProcesses.push(postProcess);\r\n } else if (this._postProcesses[insertAt] === null) {\r\n this._postProcesses[insertAt] = postProcess;\r\n } else {\r\n this._postProcesses.splice(insertAt, 0, postProcess);\r\n }\r\n this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated\r\n\r\n // Update prePass\r\n if (this._scene.prePassRenderer) {\r\n this._scene.prePassRenderer.markAsDirty();\r\n }\r\n\r\n return this._postProcesses.indexOf(postProcess);\r\n }\r\n\r\n /**\r\n * Detach a post process to the camera.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess\r\n * @param postProcess The post process to detach from the camera\r\n */\r\n public detachPostProcess(postProcess: PostProcess): void {\r\n const idx = this._postProcesses.indexOf(postProcess);\r\n if (idx !== -1) {\r\n this._postProcesses[idx] = null;\r\n }\r\n\r\n // Update prePass\r\n if (this._scene.prePassRenderer) {\r\n this._scene.prePassRenderer.markAsDirty();\r\n }\r\n\r\n this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated\r\n }\r\n\r\n /**\r\n * Gets the current world matrix of the camera\r\n * @returns the world matrix\r\n */\r\n public getWorldMatrix(): Matrix {\r\n if (this._isSynchronizedViewMatrix()) {\r\n return this._worldMatrix;\r\n }\r\n\r\n // Getting the view matrix will also compute the world matrix.\r\n this.getViewMatrix();\r\n\r\n return this._worldMatrix;\r\n }\r\n\r\n /** @internal */\r\n public _getViewMatrix(): Matrix {\r\n return Matrix.Identity();\r\n }\r\n\r\n /**\r\n * Gets the current view matrix of the camera.\r\n * @param force forces the camera to recompute the matrix without looking at the cached state\r\n * @returns the view matrix\r\n */\r\n public getViewMatrix(force?: boolean): Matrix {\r\n if (!force && this._isSynchronizedViewMatrix()) {\r\n return this._computedViewMatrix;\r\n }\r\n\r\n this._hasMoved = true;\r\n\r\n this.updateCache();\r\n this._computedViewMatrix = this._getViewMatrix();\r\n\r\n this._currentRenderId = this.getScene().getRenderId();\r\n this._childUpdateId++;\r\n\r\n this._refreshFrustumPlanes = true;\r\n\r\n if (this._cameraRigParams && this._cameraRigParams.vrPreViewMatrix) {\r\n this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix, this._computedViewMatrix);\r\n }\r\n\r\n // Notify parent camera if rig camera is changed\r\n if (this.parent && (this.parent as Camera).onViewMatrixChangedObservable) {\r\n (this.parent as Camera).onViewMatrixChangedObservable.notifyObservers(this.parent as Camera);\r\n }\r\n\r\n this.onViewMatrixChangedObservable.notifyObservers(this);\r\n\r\n this._computedViewMatrix.invertToRef(this._worldMatrix);\r\n\r\n return this._computedViewMatrix;\r\n }\r\n\r\n /**\r\n * Freeze the projection matrix.\r\n * It will prevent the cache check of the camera projection compute and can speed up perf\r\n * if no parameter of the camera are meant to change\r\n * @param projection Defines manually a projection if necessary\r\n */\r\n public freezeProjectionMatrix(projection?: Matrix): void {\r\n this._doNotComputeProjectionMatrix = true;\r\n if (projection !== undefined) {\r\n this._projectionMatrix = projection;\r\n }\r\n }\r\n\r\n /**\r\n * Unfreeze the projection matrix if it has previously been freezed by freezeProjectionMatrix.\r\n */\r\n public unfreezeProjectionMatrix(): void {\r\n this._doNotComputeProjectionMatrix = false;\r\n }\r\n\r\n /**\r\n * Gets the current projection matrix of the camera.\r\n * @param force forces the camera to recompute the matrix without looking at the cached state\r\n * @returns the projection matrix\r\n */\r\n public getProjectionMatrix(force?: boolean): Matrix {\r\n if (this._doNotComputeProjectionMatrix || (!force && this._isSynchronizedProjectionMatrix())) {\r\n return this._projectionMatrix;\r\n }\r\n\r\n // Cache\r\n this._cache.mode = this.mode;\r\n this._cache.minZ = this.minZ;\r\n this._cache.maxZ = this.maxZ;\r\n\r\n // Matrix\r\n this._refreshFrustumPlanes = true;\r\n\r\n const engine = this.getEngine();\r\n const scene = this.getScene();\r\n const reverseDepth = engine.useReverseDepthBuffer;\r\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\r\n this._cache.fov = this.fov;\r\n this._cache.fovMode = this.fovMode;\r\n this._cache.aspectRatio = engine.getAspectRatio(this);\r\n this._cache.projectionPlaneTilt = this.projectionPlaneTilt;\r\n\r\n if (this.minZ <= 0) {\r\n this.minZ = 0.1;\r\n }\r\n\r\n let getProjectionMatrix: (\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n result: Matrix,\r\n isVerticalFovFixed: boolean,\r\n halfZRange: boolean,\r\n projectionPlaneTilt: number,\r\n reverseDepthBufferMode: boolean\r\n ) => void;\r\n if (scene.useRightHandedSystem) {\r\n getProjectionMatrix = Matrix.PerspectiveFovRHToRef;\r\n } else {\r\n getProjectionMatrix = Matrix.PerspectiveFovLHToRef;\r\n }\r\n\r\n getProjectionMatrix(\r\n this.fov,\r\n engine.getAspectRatio(this),\r\n reverseDepth ? this.maxZ : this.minZ,\r\n reverseDepth ? this.minZ : this.maxZ,\r\n this._projectionMatrix,\r\n this.fovMode === Camera.FOVMODE_VERTICAL_FIXED,\r\n engine.isNDCHalfZRange,\r\n this.projectionPlaneTilt,\r\n reverseDepth\r\n );\r\n } else {\r\n const halfWidth = engine.getRenderWidth() / 2.0;\r\n const halfHeight = engine.getRenderHeight() / 2.0;\r\n if (scene.useRightHandedSystem) {\r\n if (this.oblique) {\r\n Matrix.ObliqueOffCenterRHToRef(\r\n this.orthoLeft ?? -halfWidth,\r\n this.orthoRight ?? halfWidth,\r\n this.orthoBottom ?? -halfHeight,\r\n this.orthoTop ?? halfHeight,\r\n reverseDepth ? this.maxZ : this.minZ,\r\n reverseDepth ? this.minZ : this.maxZ,\r\n this.oblique.length,\r\n this.oblique.angle,\r\n this._computeObliqueDistance(this.oblique.offset),\r\n this._projectionMatrix,\r\n engine.isNDCHalfZRange\r\n );\r\n } else {\r\n Matrix.OrthoOffCenterRHToRef(\r\n this.orthoLeft ?? -halfWidth,\r\n this.orthoRight ?? halfWidth,\r\n this.orthoBottom ?? -halfHeight,\r\n this.orthoTop ?? halfHeight,\r\n reverseDepth ? this.maxZ : this.minZ,\r\n reverseDepth ? this.minZ : this.maxZ,\r\n this._projectionMatrix,\r\n engine.isNDCHalfZRange\r\n );\r\n }\r\n } else {\r\n if (this.oblique) {\r\n Matrix.ObliqueOffCenterLHToRef(\r\n this.orthoLeft ?? -halfWidth,\r\n this.orthoRight ?? halfWidth,\r\n this.orthoBottom ?? -halfHeight,\r\n this.orthoTop ?? halfHeight,\r\n reverseDepth ? this.maxZ : this.minZ,\r\n reverseDepth ? this.minZ : this.maxZ,\r\n this.oblique.length,\r\n this.oblique.angle,\r\n this._computeObliqueDistance(this.oblique.offset),\r\n this._projectionMatrix,\r\n engine.isNDCHalfZRange\r\n );\r\n } else {\r\n Matrix.OrthoOffCenterLHToRef(\r\n this.orthoLeft ?? -halfWidth,\r\n this.orthoRight ?? halfWidth,\r\n this.orthoBottom ?? -halfHeight,\r\n this.orthoTop ?? halfHeight,\r\n reverseDepth ? this.maxZ : this.minZ,\r\n reverseDepth ? this.minZ : this.maxZ,\r\n this._projectionMatrix,\r\n engine.isNDCHalfZRange\r\n );\r\n }\r\n }\r\n\r\n this._cache.orthoLeft = this.orthoLeft;\r\n this._cache.orthoRight = this.orthoRight;\r\n this._cache.orthoBottom = this.orthoBottom;\r\n this._cache.orthoTop = this.orthoTop;\r\n this._cache.obliqueAngle = this.oblique?.angle;\r\n this._cache.obliqueLength = this.oblique?.length;\r\n this._cache.obliqueOffset = this.oblique?.offset;\r\n this._cache.renderWidth = engine.getRenderWidth();\r\n this._cache.renderHeight = engine.getRenderHeight();\r\n }\r\n\r\n this.onProjectionMatrixChangedObservable.notifyObservers(this);\r\n\r\n return this._projectionMatrix;\r\n }\r\n\r\n /**\r\n * Gets the transformation matrix (ie. the multiplication of view by projection matrices)\r\n * @returns a Matrix\r\n */\r\n public getTransformationMatrix(): Matrix {\r\n this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);\r\n return this._transformMatrix;\r\n }\r\n\r\n private _computeObliqueDistance(offset: number): number {\r\n const arcRotateCamera = this as Camera as ArcRotateCamera;\r\n const targetCamera = this as Camera as TargetCamera;\r\n return (arcRotateCamera.radius || (targetCamera.target ? Vector3.Distance(this.position, targetCamera.target) : this.position.length())) + offset;\r\n }\r\n\r\n private _updateFrustumPlanes(): void {\r\n if (!this._refreshFrustumPlanes) {\r\n return;\r\n }\r\n\r\n this.getTransformationMatrix();\r\n\r\n if (!this._frustumPlanes) {\r\n this._frustumPlanes = Frustum.GetPlanes(this._transformMatrix);\r\n } else {\r\n Frustum.GetPlanesToRef(this._transformMatrix, this._frustumPlanes);\r\n }\r\n\r\n this._refreshFrustumPlanes = false;\r\n }\r\n\r\n /**\r\n * Checks if a cullable object (mesh...) is in the camera frustum\r\n * This checks the bounding box center. See isCompletelyInFrustum for a full bounding check\r\n * @param target The object to check\r\n * @param checkRigCameras If the rig cameras should be checked (eg. with VR camera both eyes should be checked) (Default: false)\r\n * @returns true if the object is in frustum otherwise false\r\n */\r\n public isInFrustum(target: ICullable, checkRigCameras = false): boolean {\r\n this._updateFrustumPlanes();\r\n\r\n if (checkRigCameras && this.rigCameras.length > 0) {\r\n let result = false;\r\n this.rigCameras.forEach((cam) => {\r\n cam._updateFrustumPlanes();\r\n result = result || target.isInFrustum(cam._frustumPlanes);\r\n });\r\n return result;\r\n } else {\r\n return target.isInFrustum(this._frustumPlanes);\r\n }\r\n }\r\n\r\n /**\r\n * Checks if a cullable object (mesh...) is in the camera frustum\r\n * Unlike isInFrustum this checks the full bounding box\r\n * @param target The object to check\r\n * @returns true if the object is in frustum otherwise false\r\n */\r\n public isCompletelyInFrustum(target: ICullable): boolean {\r\n this._updateFrustumPlanes();\r\n\r\n return target.isCompletelyInFrustum(this._frustumPlanes);\r\n }\r\n\r\n // eslint-disable-next-line jsdoc/require-returns-check\r\n /**\r\n * Gets a ray in the forward direction from the camera.\r\n * @param length Defines the length of the ray to create\r\n * @param transform Defines the transform to apply to the ray, by default the world matrix is used to create a workd space ray\r\n * @param origin Defines the start point of the ray which defaults to the camera position\r\n * @returns the forward ray\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getForwardRay(length = 100, transform?: Matrix, origin?: Vector3): Ray {\r\n throw _WarnImport(\"Ray\");\r\n }\r\n\r\n // eslint-disable-next-line jsdoc/require-returns-check\r\n /**\r\n * Gets a ray in the forward direction from the camera.\r\n * @param refRay the ray to (re)use when setting the values\r\n * @param length Defines the length of the ray to create\r\n * @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray\r\n * @param origin Defines the start point of the ray which defaults to the camera position\r\n * @returns the forward ray\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getForwardRayToRef(refRay: Ray, length = 100, transform?: Matrix, origin?: Vector3): Ray {\r\n throw _WarnImport(\"Ray\");\r\n }\r\n\r\n /**\r\n * Releases resources associated with this node.\r\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\r\n * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)\r\n */\r\n public dispose(doNotRecurse?: boolean, disposeMaterialAndTextures = false): void {\r\n // Observables\r\n this.onViewMatrixChangedObservable.clear();\r\n this.onProjectionMatrixChangedObservable.clear();\r\n this.onAfterCheckInputsObservable.clear();\r\n this.onRestoreStateObservable.clear();\r\n\r\n // Inputs\r\n if (this.inputs) {\r\n this.inputs.clear();\r\n }\r\n\r\n // Animations\r\n this.getScene().stopAnimation(this);\r\n\r\n // Remove from scene\r\n this.getScene().removeCamera(this);\r\n while (this._rigCameras.length > 0) {\r\n const camera = this._rigCameras.pop();\r\n if (camera) {\r\n camera.dispose();\r\n }\r\n }\r\n\r\n if (this._parentContainer) {\r\n const index = this._parentContainer.cameras.indexOf(this);\r\n if (index > -1) {\r\n this._parentContainer.cameras.splice(index, 1);\r\n }\r\n this._parentContainer = null;\r\n }\r\n\r\n // Postprocesses\r\n if (this._rigPostProcess) {\r\n this._rigPostProcess.dispose(this);\r\n this._rigPostProcess = null;\r\n this._postProcesses.length = 0;\r\n } else if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\r\n this._rigPostProcess = null;\r\n this._postProcesses.length = 0;\r\n } else {\r\n let i = this._postProcesses.length;\r\n while (--i >= 0) {\r\n const postProcess = this._postProcesses[i];\r\n if (postProcess) {\r\n postProcess.dispose(this);\r\n }\r\n }\r\n }\r\n\r\n // Render targets\r\n let i = this.customRenderTargets.length;\r\n while (--i >= 0) {\r\n this.customRenderTargets[i].dispose();\r\n }\r\n this.customRenderTargets.length = 0;\r\n\r\n // Active Meshes\r\n this._activeMeshes.dispose();\r\n\r\n this.getScene().getEngine().releaseRenderPassId(this.renderPassId);\r\n\r\n super.dispose(doNotRecurse, disposeMaterialAndTextures);\r\n }\r\n\r\n /** @internal */\r\n public _isLeftCamera = false;\r\n /**\r\n * Gets the left camera of a rig setup in case of Rigged Camera\r\n */\r\n public get isLeftCamera(): boolean {\r\n return this._isLeftCamera;\r\n }\r\n\r\n /** @internal */\r\n public _isRightCamera = false;\r\n /**\r\n * Gets the right camera of a rig setup in case of Rigged Camera\r\n */\r\n public get isRightCamera(): boolean {\r\n return this._isRightCamera;\r\n }\r\n\r\n /**\r\n * Gets the left camera of a rig setup in case of Rigged Camera\r\n */\r\n public get leftCamera(): Nullable<FreeCamera> {\r\n if (this._rigCameras.length < 1) {\r\n return null;\r\n }\r\n return <FreeCamera>this._rigCameras[0];\r\n }\r\n\r\n /**\r\n * Gets the right camera of a rig setup in case of Rigged Camera\r\n */\r\n public get rightCamera(): Nullable<FreeCamera> {\r\n if (this._rigCameras.length < 2) {\r\n return null;\r\n }\r\n return <FreeCamera>this._rigCameras[1];\r\n }\r\n\r\n /**\r\n * Gets the left camera target of a rig setup in case of Rigged Camera\r\n * @returns the target position\r\n */\r\n public getLeftTarget(): Nullable<Vector3> {\r\n if (this._rigCameras.length < 1) {\r\n return null;\r\n }\r\n return (<TargetCamera>this._rigCameras[0]).getTarget();\r\n }\r\n\r\n /**\r\n * Gets the right camera target of a rig setup in case of Rigged Camera\r\n * @returns the target position\r\n */\r\n public getRightTarget(): Nullable<Vector3> {\r\n if (this._rigCameras.length < 2) {\r\n return null;\r\n }\r\n return (<TargetCamera>this._rigCameras[1]).getTarget();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public setCameraRigMode(mode: number, rigParams: any): void {\r\n if (this.cameraRigMode === mode) {\r\n return;\r\n }\r\n\r\n while (this._rigCameras.length > 0) {\r\n const camera = this._rigCameras.pop();\r\n\r\n if (camera) {\r\n camera.dispose();\r\n }\r\n }\r\n this.cameraRigMode = mode;\r\n this._cameraRigParams = {};\r\n //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target,\r\n //not from a given angle as it is now, but until that complete code rewriting provisional stereoHalfAngle value is introduced\r\n this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637;\r\n this._cameraRigParams.stereoHalfAngle = Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);\r\n\r\n // create the rig cameras, unless none\r\n if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\r\n const leftCamera = this.createRigCamera(this.name + \"_L\", 0);\r\n if (leftCamera) {\r\n leftCamera._isLeftCamera = true;\r\n }\r\n const rightCamera = this.createRigCamera(this.name + \"_R\", 1);\r\n if (rightCamera) {\r\n rightCamera._isRightCamera = true;\r\n }\r\n if (leftCamera && rightCamera) {\r\n this._rigCameras.push(leftCamera);\r\n this._rigCameras.push(rightCamera);\r\n }\r\n }\r\n\r\n this._setRigMode(rigParams);\r\n\r\n this._cascadePostProcessesToRigCams();\r\n this.update();\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _setRigMode(rigParams: any) {\r\n // no-op\r\n }\r\n\r\n /** @internal */\r\n public _getVRProjectionMatrix(): Matrix {\r\n Matrix.PerspectiveFovLHToRef(\r\n this._cameraRigParams.vrMetrics.aspectRatioFov,\r\n this._cameraRigParams.vrMetrics.aspectRatio,\r\n this.minZ,\r\n this.maxZ,\r\n this._cameraRigParams.vrWorkMatrix,\r\n true,\r\n this.getEngine().isNDCHalfZRange\r\n );\r\n this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix);\r\n return this._projectionMatrix;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public setCameraRigParameter(name: string, value: any) {\r\n if (!this._cameraRigParams) {\r\n this._cameraRigParams = {};\r\n }\r\n this._cameraRigParams[name] = value;\r\n //provisionnally:\r\n if (name === \"interaxialDistance\") {\r\n this._cameraRigParams.stereoHalfAngle = Tools.ToRadians(value / 0.0637);\r\n }\r\n }\r\n\r\n /**\r\n * needs to be overridden by children so sub has required properties to be copied\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public createRigCamera(name: string, cameraIndex: number): Nullable<Camera> {\r\n return null;\r\n }\r\n\r\n /**\r\n * May need to be overridden by children\r\n * @internal\r\n */\r\n public _updateRigCameras() {\r\n for (let i = 0; i < this._rigCameras.length; i++) {\r\n this._rigCameras[i].minZ = this.minZ;\r\n this._rigCameras[i].maxZ = this.maxZ;\r\n this._rigCameras[i].fov = this.fov;\r\n this._rigCameras[i].upVector.copyFrom(this.upVector);\r\n }\r\n\r\n // only update viewport when ANAGLYPH\r\n if (this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH) {\r\n this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _setupInputs() {}\r\n\r\n /**\r\n * Serialiaze the camera setup to a json representation\r\n * @returns the JSON representation\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.uniqueId = this.uniqueId;\r\n\r\n // Type\r\n serializationObject.type = this.getClassName();\r\n\r\n // Parent\r\n if (this.parent) {\r\n this.parent._serializeAsParent(serializationObject);\r\n }\r\n\r\n if (this.inputs) {\r\n this.inputs.serialize(serializationObject);\r\n }\r\n // Animations\r\n SerializationHelper.AppendSerializedAnimations(this, serializationObject);\r\n serializationObject.ranges = this.serializeAnimationRanges();\r\n\r\n serializationObject.isEnabled = this.isEnabled();\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Clones the current camera.\r\n * @param name The cloned camera name\r\n * @param newParent The cloned camera's new parent (none by default)\r\n * @returns the cloned camera\r\n */\r\n public clone(name: string, newParent: Nullable<Node> = null): Camera {\r\n const camera = SerializationHelper.Clone(\r\n Camera.GetConstructorFromName(this.getClassName(), name, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide),\r\n this\r\n );\r\n camera.name = name;\r\n camera.parent = newParent;\r\n\r\n this.onClonedObservable.notifyObservers(camera);\r\n\r\n return camera;\r\n }\r\n\r\n /**\r\n * Gets the direction of the camera relative to a given local axis.\r\n * @param localAxis Defines the reference axis to provide a relative direction.\r\n * @returns the direction\r\n */\r\n public getDirection(localAxis: Vector3): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getDirectionToRef(localAxis, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns the current camera absolute rotation\r\n */\r\n public get absoluteRotation(): Quaternion {\r\n this.getWorldMatrix().decompose(undefined, this._absoluteRotation);\r\n\r\n return this._absoluteRotation;\r\n }\r\n\r\n /**\r\n * Gets the direction of the camera relative to a given local axis into a passed vector.\r\n * @param localAxis Defines the reference axis to provide a relative direction.\r\n * @param result Defines the vector to store the result in\r\n */\r\n public getDirectionToRef(localAxis: Vector3, result: Vector3): void {\r\n Vector3.TransformNormalToRef(localAxis, this.getWorldMatrix(), result);\r\n }\r\n\r\n /**\r\n * Gets a camera constructor for a given camera type\r\n * @param type The type of the camera to construct (should be equal to one of the camera class name)\r\n * @param name The name of the camera the result will be able to instantiate\r\n * @param scene The scene the result will construct the camera in\r\n * @param interaxial_distance In case of stereoscopic setup, the distance between both eyes\r\n * @param isStereoscopicSideBySide In case of stereoscopic setup, should the sereo be side b side\r\n * @returns a factory method to construct the camera\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n static GetConstructorFromName(type: string, name: string, scene: Scene, interaxial_distance: number = 0, isStereoscopicSideBySide: boolean = true): () => Camera {\r\n const constructorFunc = Node.Construct(type, name, scene, {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n interaxial_distance: interaxial_distance,\r\n isStereoscopicSideBySide: isStereoscopicSideBySide,\r\n });\r\n\r\n if (constructorFunc) {\r\n return <() => Camera>constructorFunc;\r\n }\r\n\r\n // Default to universal camera\r\n return () => Camera._CreateDefaultParsedCamera(name, scene);\r\n }\r\n\r\n /**\r\n * Compute the world matrix of the camera.\r\n * @returns the camera world matrix\r\n */\r\n public computeWorldMatrix(): Matrix {\r\n return this.getWorldMatrix();\r\n }\r\n\r\n /**\r\n * Parse a JSON and creates the camera from the parsed information\r\n * @param parsedCamera The JSON to parse\r\n * @param scene The scene to instantiate the camera in\r\n * @returns the newly constructed camera\r\n */\r\n public static Parse(parsedCamera: any, scene: Scene): Camera {\r\n const type = parsedCamera.type;\r\n const construct = Camera.GetConstructorFromName(type, parsedCamera.name, scene, parsedCamera.interaxial_distance, parsedCamera.isStereoscopicSideBySide);\r\n\r\n const camera = SerializationHelper.Parse(construct, parsedCamera, scene);\r\n\r\n // Parent\r\n if (parsedCamera.parentId !== undefined) {\r\n camera._waitingParentId = parsedCamera.parentId;\r\n }\r\n\r\n // Parent instance index\r\n if (parsedCamera.parentInstanceIndex !== undefined) {\r\n camera._waitingParentInstanceIndex = parsedCamera.parentInstanceIndex;\r\n }\r\n\r\n //If camera has an input manager, let it parse inputs settings\r\n if (camera.inputs) {\r\n camera.inputs.parse(parsedCamera);\r\n\r\n camera._setupInputs();\r\n }\r\n\r\n if (parsedCamera.upVector) {\r\n camera.upVector = Vector3.FromArray(parsedCamera.upVector); // need to force the upVector\r\n }\r\n\r\n if ((<any>camera).setPosition) {\r\n // need to force position\r\n camera.position.copyFromFloats(0, 0, 0);\r\n (<any>camera).setPosition(Vector3.FromArray(parsedCamera.position));\r\n }\r\n\r\n // Target\r\n if (parsedCamera.target) {\r\n if ((<any>camera).setTarget) {\r\n (<any>camera).setTarget(Vector3.FromArray(parsedCamera.target));\r\n }\r\n }\r\n\r\n // Apply 3d rig, when found\r\n if (parsedCamera.cameraRigMode) {\r\n const rigParams = parsedCamera.interaxial_distance ? { interaxialDistance: parsedCamera.interaxial_distance } : {};\r\n camera.setCameraRigMode(parsedCamera.cameraRigMode, rigParams);\r\n }\r\n\r\n // Animations\r\n if (parsedCamera.animations) {\r\n for (let animationIndex = 0; animationIndex < parsedCamera.animations.length; animationIndex++) {\r\n const parsedAnimation = parsedCamera.animations[animationIndex];\r\n const internalClass = GetClass(\"BABYLON.Animation\");\r\n if (internalClass) {\r\n camera.animations.push(internalClass.Parse(parsedAnimation));\r\n }\r\n }\r\n Node.ParseAnimationRanges(camera, parsedCamera, scene);\r\n }\r\n\r\n if (parsedCamera.autoAnimate) {\r\n scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, parsedCamera.autoAnimateSpeed || 1.0);\r\n }\r\n\r\n // Check if isEnabled is defined to be back compatible with prior serialized versions.\r\n if (parsedCamera.isEnabled !== undefined) {\r\n camera.setEnabled(parsedCamera.isEnabled);\r\n }\r\n\r\n return camera;\r\n }\r\n\r\n /** @internal */\r\n public _calculateHandednessMultiplier(): number {\r\n let handednessMultiplier = this.getScene().useRightHandedSystem ? -1 : 1;\r\n if (this.parent && this.parent._getWorldMatrixDeterminant() < 0) {\r\n handednessMultiplier *= -1;\r\n }\r\n\r\n return handednessMultiplier;\r\n }\r\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AE;oCACI;AAQT;IADN,SAAS,EAAE;oCACU;AAOf;IADN,SAAS,EAAE;uCACS;AAiBrB;IADC,SAAS,EAAE;kCAGX;AAmBM;IADN,SAAS,EAAE;yCAC0B;AAM/B;IADN,SAAS,EAAE;uCAC2C;AAQhD;IADN,SAAS,EAAE;6CACgC;AAMrC;IADN,SAAS,EAAE;kDACsB;AAM3B;IADN,SAAS,EAAE;wDAC6B","sourcesContent":["import { serialize, SerializationHelper, serializeAsVector3 } from \"../Misc/decorators\";\r\nimport { SmartArray } from \"../Misc/smartArray\";\r\nimport { Tools } from \"../Misc/tools\";\r\nimport { Observable } from \"../Misc/observable\";\r\nimport type { Nullable } from \"../types\";\r\nimport type { CameraInputsManager } from \"./cameraInputsManager\";\r\nimport type { Scene } from \"../scene\";\r\nimport { Matrix, Vector3, Quaternion } from \"../Maths/math.vector\";\r\nimport { Node } from \"../node\";\r\nimport type { Mesh } from \"../Meshes/mesh\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { ICullable } from \"../Culling/boundingInfo\";\r\nimport { Logger } from \"../Misc/logger\";\r\nimport { GetClass } from \"../Misc/typeStore\";\r\nimport { _WarnImport } from \"../Misc/devTools\";\r\nimport { Viewport } from \"../Maths/math.viewport\";\r\nimport { Frustum } from \"../Maths/math.frustum\";\r\nimport type { Plane } from \"../Maths/math.plane\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport type { PostProcess } from \"../PostProcesses/postProcess\";\r\nimport type { RenderTargetTexture } from \"../Materials/Textures/renderTargetTexture\";\r\nimport type { FreeCamera } from \"./freeCamera\";\r\nimport type { TargetCamera } from \"./targetCamera\";\r\nimport type { Ray } from \"../Culling/ray\";\r\nimport type { ArcRotateCamera } from \"./arcRotateCamera\";\r\n\r\n/**\r\n * Oblique projection values\r\n */\r\nexport interface IObliqueParams {\r\n /** The angle of the plane */\r\n angle: number;\r\n /** The length of the plane */\r\n length: number;\r\n /** The offset of the plane */\r\n offset: number;\r\n}\r\n\r\n/**\r\n * This is the base class of all the camera used in the application.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\r\n */\r\nexport class Camera extends Node {\r\n /**\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public static _CreateDefaultParsedCamera = (name: string, scene: Scene): Camera => {\r\n throw _WarnImport(\"UniversalCamera\");\r\n };\r\n\r\n /**\r\n * This is the default projection mode used by the cameras.\r\n * It helps recreating a feeling of perspective and better appreciate depth.\r\n * This is the best way to simulate real life cameras.\r\n */\r\n public static readonly PERSPECTIVE_CAMERA = Constants.PERSPECTIVE_CAMERA;\r\n /**\r\n * This helps creating camera with an orthographic mode.\r\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.\r\n */\r\n public static readonly ORTHOGRAPHIC_CAMERA = Constants.ORTHOGRAPHIC_CAMERA;\r\n\r\n /**\r\n * This is the default FOV mode for perspective cameras.\r\n * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.\r\n */\r\n public static readonly FOVMODE_VERTICAL_FIXED = Constants.FOVMODE_VERTICAL_FIXED;\r\n /**\r\n * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.\r\n */\r\n public static readonly FOVMODE_HORIZONTAL_FIXED = Constants.FOVMODE_HORIZONTAL_FIXED;\r\n\r\n /**\r\n * This specifies there is no need for a camera rig.\r\n * Basically only one eye is rendered corresponding to the camera.\r\n */\r\n public static readonly RIG_MODE_NONE = Constants.RIG_MODE_NONE;\r\n /**\r\n * Simulates a camera Rig with one blue eye and one red eye.\r\n * This can be use with 3d blue and red glasses.\r\n */\r\n public static readonly RIG_MODE_STEREOSCOPIC_ANAGLYPH = Constants.RIG_MODE_STEREOSCOPIC_ANAGLYPH;\r\n /**\r\n * Defines that both eyes of the camera will be rendered side by side with a parallel target.\r\n */\r\n public static readonly RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL;\r\n /**\r\n * Defines that both eyes of the camera will be rendered side by side with a none parallel target.\r\n */\r\n public static readonly RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED;\r\n /**\r\n * Defines that both eyes of the camera will be rendered over under each other.\r\n */\r\n public static readonly RIG_MODE_STEREOSCOPIC_OVERUNDER = Constants.RIG_MODE_STEREOSCOPIC_OVERUNDER;\r\n /**\r\n * Defines that both eyes of the camera will be rendered on successive lines interlaced for passive 3d monitors.\r\n */\r\n public static readonly RIG_MODE_STEREOSCOPIC_INTERLACED = Constants.RIG_MODE_STEREOSCOPIC_INTERLACED;\r\n /**\r\n * Defines that both eyes of the camera should be renderered in a VR mode (carbox).\r\n */\r\n public static readonly RIG_MODE_VR = Constants.RIG_MODE_VR;\r\n /**\r\n * Custom rig mode allowing rig cameras to be populated manually with any number of cameras\r\n */\r\n public static readonly RIG_MODE_CUSTOM = Constants.RIG_MODE_CUSTOM;\r\n\r\n /**\r\n * Defines if by default attaching controls should prevent the default javascript event to continue.\r\n */\r\n public static ForceAttachControlToAlwaysPreventDefault = false;\r\n\r\n /**\r\n * Define the input manager associated with the camera.\r\n */\r\n public inputs: CameraInputsManager<Camera>;\r\n\r\n /** @internal */\r\n @serializeAsVector3(\"position\")\r\n public _position = Vector3.Zero();\r\n\r\n /**\r\n * Define the current local position of the camera in the scene\r\n */\r\n public get position(): Vector3 {\r\n return this._position;\r\n }\r\n\r\n public set position(newPosition: Vector3) {\r\n this._position = newPosition;\r\n }\r\n\r\n @serializeAsVector3(\"upVector\")\r\n protected _upVector = Vector3.Up();\r\n\r\n /**\r\n * The vector the camera should consider as up.\r\n * (default is Vector3(0, 1, 0) aka Vector3.Up())\r\n */\r\n public set upVector(vec: Vector3) {\r\n this._upVector = vec;\r\n }\r\n\r\n public get upVector() {\r\n return this._upVector;\r\n }\r\n\r\n /**\r\n * Object containing oblique projection values (only used with ORTHOGRAPHIC_CAMERA)\r\n */\r\n public oblique: Nullable<IObliqueParams> = null;\r\n\r\n /**\r\n * The screen area in scene units squared\r\n */\r\n public get screenArea(): number {\r\n let x = 0;\r\n let y = 0;\r\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\r\n if (this.fovMode === Camera.FOVMODE_VERTICAL_FIXED) {\r\n y = this.minZ * 2 * Math.tan(this.fov / 2);\r\n x = this.getEngine().getAspectRatio(this) * y;\r\n } else {\r\n x = this.minZ * 2 * Math.tan(this.fov / 2);\r\n y = x / this.getEngine().getAspectRatio(this);\r\n }\r\n } else {\r\n const halfWidth = this.getEngine().getRenderWidth() / 2.0;\r\n const halfHeight = this.getEngine().getRenderHeight() / 2.0;\r\n\r\n x = (this.orthoRight ?? halfWidth) - (this.orthoLeft ?? -halfWidth);\r\n y = (this.orthoTop ?? halfHeight) - (this.orthoBottom ?? -halfHeight);\r\n }\r\n\r\n return x * y;\r\n }\r\n\r\n private _orthoLeft: Nullable<number> = null;\r\n\r\n /**\r\n * Define the current limit on the left side for an orthographic camera\r\n * In scene unit\r\n */\r\n public set orthoLeft(value: Nullable<number>) {\r\n this._orthoLeft = value;\r\n\r\n for (const rigCamera of this._rigCameras) {\r\n rigCamera.orthoLeft = value;\r\n }\r\n }\r\n\r\n @serialize()\r\n public get orthoLeft(): Nullable<number> {\r\n return this._orthoLeft;\r\n }\r\n\r\n private _orthoRight: Nullable<number> = null;\r\n\r\n /**\r\n * Define the current limit on the right side for an orthographic camera\r\n * In scene unit\r\n */\r\n public set orthoRight(value: Nullable<number>) {\r\n this._orthoRight = value;\r\n\r\n for (const rigCamera of this._rigCameras) {\r\n rigCamera.orthoRight = value;\r\n }\r\n }\r\n\r\n @serialize()\r\n public get orthoRight(): Nullable<number> {\r\n return this._orthoRight;\r\n }\r\n\r\n private _orthoBottom: Nullable<number> = null;\r\n\r\n /**\r\n * Define the current limit on the bottom side for an orthographic camera\r\n * In scene unit\r\n */\r\n public set orthoBottom(value: Nullable<number>) {\r\n this._orthoBottom = value;\r\n\r\n for (const rigCamera of this._rigCameras) {\r\n rigCamera.orthoBottom = value;\r\n }\r\n }\r\n\r\n @serialize()\r\n public get orthoBottom(): Nullable<number> {\r\n return this._orthoBottom;\r\n }\r\n\r\n private _orthoTop: Nullable<number> = null;\r\n\r\n /**\r\n * Define the current limit on the top side for an orthographic camera\r\n * In scene unit\r\n */\r\n public set orthoTop(value: Nullable<number>) {\r\n this._orthoTop = value;\r\n\r\n for (const rigCamera of this._rigCameras) {\r\n rigCamera.orthoTop = value;\r\n }\r\n }\r\n\r\n @serialize()\r\n public get orthoTop(): Nullable<number> {\r\n return this._orthoTop;\r\n }\r\n\r\n /**\r\n * Field Of View is set in Radians. (default is 0.8)\r\n */\r\n @serialize()\r\n public fov = 0.8;\r\n\r\n /**\r\n * Projection plane tilt around the X axis (horizontal), set in Radians. (default is 0)\r\n * Can be used to make vertical lines in world space actually vertical on the screen.\r\n * See https://forum.babylonjs.com/t/add-vertical-shift-to-3ds-max-exporter-babylon-cameras/17480\r\n */\r\n @serialize()\r\n public projectionPlaneTilt = 0;\r\n\r\n /**\r\n * Define the minimum distance the camera can see from.\r\n * This is important to note that the depth buffer are not infinite and the closer it starts\r\n * the more your scene might encounter depth fighting issue.\r\n */\r\n @serialize()\r\n public minZ = 1;\r\n\r\n /**\r\n * Define the maximum distance the camera can see to.\r\n * This is important to note that the depth buffer are not infinite and the further it end\r\n * the more your scene might encounter depth fighting issue.\r\n */\r\n @serialize()\r\n public maxZ = 10000.0;\r\n\r\n /**\r\n * Define the default inertia of the camera.\r\n * This helps giving a smooth feeling to the camera movement.\r\n */\r\n @serialize()\r\n public inertia = 0.9;\r\n\r\n private _mode = Camera.PERSPECTIVE_CAMERA;\r\n\r\n /**\r\n * Define the mode of the camera (Camera.PERSPECTIVE_CAMERA or Camera.ORTHOGRAPHIC_CAMERA)\r\n */\r\n set mode(mode: number) {\r\n this._mode = mode;\r\n\r\n // Pass the mode down to the rig cameras\r\n for (const rigCamera of this._rigCameras) {\r\n rigCamera.mode = mode;\r\n }\r\n }\r\n\r\n @serialize()\r\n get mode(): number {\r\n return this._mode;\r\n }\r\n\r\n /**\r\n * Define whether the camera is intermediate.\r\n * This is useful to not present the output directly to the screen in case of rig without post process for instance\r\n */\r\n public isIntermediate = false;\r\n\r\n /**\r\n * Define the viewport of the camera.\r\n * This correspond to the portion of the screen the camera will render to in normalized 0 to 1 unit.\r\n */\r\n public viewport = new Viewport(0, 0, 1.0, 1.0);\r\n\r\n /**\r\n * Restricts the camera to viewing objects with the same layerMask.\r\n * A camera with a layerMask of 1 will render mesh.layerMask & camera.layerMask!== 0\r\n */\r\n @serialize()\r\n public layerMask: number = 0x0fffffff;\r\n\r\n /**\r\n * fovMode sets the camera frustum bounds to the viewport bounds. (default is FOVMODE_VERTICAL_FIXED)\r\n */\r\n @serialize()\r\n public fovMode: number = Camera.FOVMODE_VERTICAL_FIXED;\r\n\r\n /**\r\n * Rig mode of the camera.\r\n * This is useful to create the camera with two \"eyes\" instead of one to create VR or stereoscopic scenes.\r\n * This is normally controlled byt the camera themselves as internal use.\r\n */\r\n @serialize()\r\n public cameraRigMode = Camera.RIG_MODE_NONE;\r\n\r\n /**\r\n * Defines the distance between both \"eyes\" in case of a RIG\r\n */\r\n @serialize()\r\n public interaxialDistance: number;\r\n\r\n /**\r\n * Defines if stereoscopic rendering is done side by side or over under.\r\n */\r\n @serialize()\r\n public isStereoscopicSideBySide: boolean;\r\n\r\n /**\r\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\r\n * This is pretty helpful if you wish to make a camera render to a texture you could reuse somewhere\r\n * else in the scene. (Eg. security camera)\r\n *\r\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)\r\n */\r\n public customRenderTargets: RenderTargetTexture[] = [];\r\n /**\r\n * When set, the camera will render to this render target instead of the default canvas\r\n *\r\n * If the desire is to use the output of a camera as a texture in the scene consider using camera.customRenderTargets instead\r\n */\r\n public outputRenderTarget: Nullable<RenderTargetTexture> = null;\r\n\r\n /**\r\n * Observable triggered when the camera view matrix has changed.\r\n */\r\n public onViewMatrixChangedObservable = new Observable<Camera>();\r\n /**\r\n * Observable triggered when the camera Projection matrix has changed.\r\n */\r\n public onProjectionMatrixChangedObservable = new Observable<Camera>();\r\n /**\r\n * Observable triggered when the inputs have been processed.\r\n */\r\n public onAfterCheckInputsObservable = new Observable<Camera>();\r\n /**\r\n * Observable triggered when reset has been called and applied to the camera.\r\n */\r\n public onRestoreStateObservable = new Observable<Camera>();\r\n\r\n /**\r\n * Is this camera a part of a rig system?\r\n */\r\n public isRigCamera: boolean = false;\r\n\r\n /**\r\n * If isRigCamera set to true this will be set with the parent camera.\r\n * The parent camera is not (!) necessarily the .parent of this camera (like in the case of XR)\r\n */\r\n public rigParent?: Camera;\r\n\r\n /**\r\n * Render pass id used by the camera to render into the main framebuffer\r\n */\r\n public renderPassId: number;\r\n\r\n private _hasMoved = false;\r\n\r\n /**\r\n * Gets a flag indicating that the camera has moved in some way since the last call to Camera.update()\r\n */\r\n public get hasMoved() {\r\n return this._hasMoved;\r\n }\r\n\r\n /** @internal */\r\n public _cameraRigParams: any;\r\n /** @internal */\r\n public _rigCameras = new Array<Camera>();\r\n /** @internal */\r\n public _rigPostProcess: Nullable<PostProcess>;\r\n\r\n /** @internal */\r\n public _skipRendering = false;\r\n\r\n /** @internal */\r\n public _projectionMatrix = new Matrix();\r\n\r\n /** @internal */\r\n public _postProcesses = new Array<Nullable<PostProcess>>();\r\n\r\n /** @internal */\r\n public _activeMeshes = new SmartArray<AbstractMesh>(256);\r\n\r\n protected _globalPosition = Vector3.Zero();\r\n\r\n /** @internal */\r\n public _computedViewMatrix = Matrix.Identity();\r\n private _doNotComputeProjectionMatrix = false;\r\n private _transformMatrix = Matrix.Zero();\r\n private _frustumPlanes: Plane[];\r\n private _refreshFrustumPlanes = true;\r\n private _storedFov: number;\r\n private _stateStored: boolean;\r\n private _absoluteRotation: Quaternion = Quaternion.Identity();\r\n\r\n /**\r\n * Instantiates a new camera object.\r\n * This should not be used directly but through the inherited cameras: ArcRotate, Free...\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras\r\n * @param name Defines the name of the camera in the scene\r\n * @param position Defines the position of the camera\r\n * @param scene Defines the scene the camera belongs too\r\n * @param setActiveOnSceneIfNoneActive Defines if the camera should be set as active after creation if no other camera have been defined in the scene\r\n */\r\n constructor(name: string, position: Vector3, scene?: Scene, setActiveOnSceneIfNoneActive = true) {\r\n super(name, scene);\r\n\r\n this.getScene().addCamera(this);\r\n\r\n if (setActiveOnSceneIfNoneActive && !this.getScene().activeCamera) {\r\n this.getScene().activeCamera = this;\r\n }\r\n\r\n this.position = position;\r\n this.renderPassId = this.getScene().getEngine().createRenderPassId(`Camera ${name}`);\r\n }\r\n\r\n /**\r\n * Store current camera state (fov, position, etc..)\r\n * @returns the camera\r\n */\r\n public storeState(): Camera {\r\n this._stateStored = true;\r\n this._storedFov = this.fov;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Restores the camera state values if it has been stored. You must call storeState() first\r\n * @returns true if restored and false otherwise\r\n */\r\n protected _restoreStateValues(): boolean {\r\n if (!this._stateStored) {\r\n return false;\r\n }\r\n\r\n this.fov = this._storedFov;\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Restored camera state. You must call storeState() first.\r\n * @returns true if restored and false otherwise\r\n */\r\n public restoreState(): boolean {\r\n if (this._restoreStateValues()) {\r\n this.onRestoreStateObservable.notifyObservers(this);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets the class name of the camera.\r\n * @returns the class name\r\n */\r\n public getClassName(): string {\r\n return \"Camera\";\r\n }\r\n\r\n /** @internal */\r\n public readonly _isCamera = true;\r\n\r\n /**\r\n * Gets a string representation of the camera useful for debug purpose.\r\n * @param fullDetails Defines that a more verbose level of logging is required\r\n * @returns the string representation\r\n */\r\n public toString(fullDetails?: boolean): string {\r\n let ret = \"Name: \" + this.name;\r\n ret += \", type: \" + this.getClassName();\r\n if (this.animations) {\r\n for (let i = 0; i < this.animations.length; i++) {\r\n ret += \", animation[0]: \" + this.animations[i].toString(fullDetails);\r\n }\r\n }\r\n return ret;\r\n }\r\n\r\n /**\r\n * Automatically tilts the projection plane, using `projectionPlaneTilt`, to correct the perspective effect on vertical lines.\r\n */\r\n public applyVerticalCorrection() {\r\n const rot = this.absoluteRotation.toEulerAngles();\r\n\r\n this.projectionPlaneTilt = this._scene.useRightHandedSystem ? -rot.x : rot.x;\r\n }\r\n\r\n /**\r\n * Gets the current world space position of the camera.\r\n */\r\n public get globalPosition(): Vector3 {\r\n return this._globalPosition;\r\n }\r\n\r\n /**\r\n * Gets the list of active meshes this frame (meshes no culled or excluded by lod s in the frame)\r\n * @returns the active meshe list\r\n */\r\n public getActiveMeshes(): SmartArray<AbstractMesh> {\r\n return this._activeMeshes;\r\n }\r\n\r\n /**\r\n * Check whether a mesh is part of the current active mesh list of the camera\r\n * @param mesh Defines the mesh to check\r\n * @returns true if active, false otherwise\r\n */\r\n public isActiveMesh(mesh: Mesh): boolean {\r\n return this._activeMeshes.indexOf(mesh) !== -1;\r\n }\r\n\r\n /**\r\n * Is this camera ready to be used/rendered\r\n * @param completeCheck defines if a complete check (including post processes) has to be done (false by default)\r\n * @returns true if the camera is ready\r\n */\r\n public isReady(completeCheck = false): boolean {\r\n if (completeCheck) {\r\n for (const pp of this._postProcesses) {\r\n if (pp && !pp.isReady()) {\r\n return false;\r\n }\r\n }\r\n }\r\n return super.isReady(completeCheck);\r\n }\r\n\r\n /** @internal */\r\n public _initCache() {\r\n super._initCache();\r\n\r\n this._cache.position = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n this._cache.upVector = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n\r\n this._cache.mode = undefined;\r\n this._cache.minZ = undefined;\r\n this._cache.maxZ = undefined;\r\n\r\n this._cache.fov = undefined;\r\n this._cache.fovMode = undefined;\r\n this._cache.aspectRatio = undefined;\r\n\r\n this._cache.orthoLeft = undefined;\r\n this._cache.orthoRight = undefined;\r\n this._cache.orthoBottom = undefined;\r\n this._cache.orthoTop = undefined;\r\n this._cache.obliqueAngle = undefined;\r\n this._cache.obliqueLength = undefined;\r\n this._cache.obliqueOffset = undefined;\r\n this._cache.renderWidth = undefined;\r\n this._cache.renderHeight = undefined;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _updateCache(ignoreParentClass?: boolean): void {\r\n if (!ignoreParentClass) {\r\n super._updateCache();\r\n }\r\n\r\n this._cache.position.copyFrom(this.position);\r\n this._cache.upVector.copyFrom(this.upVector);\r\n }\r\n\r\n /** @internal */\r\n public _isSynchronized(): boolean {\r\n return this._isSynchronizedViewMatrix() && this._isSynchronizedProjectionMatrix();\r\n }\r\n\r\n /** @internal */\r\n public _isSynchronizedViewMatrix(): boolean {\r\n if (!super._isSynchronized()) {\r\n return false;\r\n }\r\n\r\n return this._cache.position.equals(this.position) && this._cache.upVector.equals(this.upVector) && this.isSynchronizedWithParent();\r\n }\r\n\r\n /** @internal */\r\n public _isSynchronizedProjectionMatrix(): boolean {\r\n let isSynchronized = this._cache.mode === this.mode && this._cache.minZ === this.minZ && this._cache.maxZ === this.maxZ;\r\n\r\n if (!isSynchronized) {\r\n return false;\r\n }\r\n\r\n const engine = this.getEngine();\r\n\r\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\r\n isSynchronized =\r\n this._cache.fov === this.fov &&\r\n this._cache.fovMode === this.fovMode &&\r\n this._cache.aspectRatio === engine.getAspectRatio(this) &&\r\n this._cache.projectionPlaneTilt === this.projectionPlaneTilt;\r\n } else {\r\n isSynchronized =\r\n this._cache.orthoLeft === this.orthoLeft &&\r\n this._cache.orthoRight === this.orthoRight &&\r\n this._cache.orthoBottom === this.orthoBottom &&\r\n this._cache.orthoTop === this.orthoTop &&\r\n this._cache.renderWidth === engine.getRenderWidth() &&\r\n this._cache.renderHeight === engine.getRenderHeight();\r\n\r\n if (this.oblique) {\r\n isSynchronized =\r\n isSynchronized &&\r\n this._cache.obliqueAngle === this.oblique.angle &&\r\n this._cache.obliqueLength === this.oblique.length &&\r\n this._cache.obliqueOffset === this.oblique.offset;\r\n }\r\n }\r\n\r\n return isSynchronized;\r\n }\r\n\r\n /**\r\n * Attach the input controls to a specific dom element to get the input from.\r\n * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)\r\n */\r\n public attachControl(noPreventDefault?: boolean): void;\r\n /**\r\n * Attach the input controls to a specific dom element to get the input from.\r\n * @param ignored defines an ignored parameter kept for backward compatibility.\r\n * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)\r\n * BACK COMPAT SIGNATURE ONLY.\r\n */\r\n public attachControl(ignored: any, noPreventDefault?: boolean): void;\r\n /**\r\n * Attach the input controls to a specific dom element to get the input from.\r\n * This function is here because typescript removes the typing of the last function.\r\n * @param _ignored defines an ignored parameter kept for backward compatibility.\r\n * @param _noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)\r\n */\r\n public attachControl(_ignored?: any, _noPreventDefault?: boolean): void {}\r\n\r\n /**\r\n * Detach the current controls from the specified dom element.\r\n */\r\n public detachControl(): void;\r\n /**\r\n * Detach the current controls from the specified dom element.\r\n * @param ignored defines an ignored parameter kept for backward compatibility.\r\n */\r\n public detachControl(ignored?: any): void;\r\n /**\r\n * Detach the current controls from the specified dom element.\r\n * This function is here because typescript removes the typing of the last function.\r\n * @param _ignored defines an ignored parameter kept for backward compatibility.\r\n */\r\n public detachControl(_ignored?: any): void {}\r\n\r\n /**\r\n * Update the camera state according to the different inputs gathered during the frame.\r\n */\r\n public update(): void {\r\n this._hasMoved = false;\r\n this._checkInputs();\r\n if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\r\n this._updateRigCameras();\r\n }\r\n\r\n // Attempt to update the camera's view and projection matrices.\r\n // This call is being made because these matrices are no longer being updated\r\n // as a part of the picking ray process (in addition to scene.render).\r\n this.getViewMatrix();\r\n this.getProjectionMatrix();\r\n }\r\n\r\n /** @internal */\r\n public _checkInputs(): void {\r\n this.onAfterCheckInputsObservable.notifyObservers(this);\r\n }\r\n\r\n /** @internal */\r\n public get rigCameras(): Camera[] {\r\n return this._rigCameras;\r\n }\r\n\r\n /**\r\n * Gets the post process used by the rig cameras\r\n */\r\n public get rigPostProcess(): Nullable<PostProcess> {\r\n return this._rigPostProcess;\r\n }\r\n\r\n /**\r\n * Internal, gets the first post process.\r\n * @returns the first post process to be run on this camera.\r\n */\r\n public _getFirstPostProcess(): Nullable<PostProcess> {\r\n for (let ppIndex = 0; ppIndex < this._postProcesses.length; ppIndex++) {\r\n if (this._postProcesses[ppIndex] !== null) {\r\n return this._postProcesses[ppIndex];\r\n }\r\n }\r\n return null;\r\n }\r\n\r\n private _cascadePostProcessesToRigCams(): void {\r\n // invalidate framebuffer\r\n const firstPostProcess = this._getFirstPostProcess();\r\n if (firstPostProcess) {\r\n firstPostProcess.markTextureDirty();\r\n }\r\n\r\n // glue the rigPostProcess to the end of the user postprocesses & assign to each sub-camera\r\n for (let i = 0, len = this._rigCameras.length; i < len; i++) {\r\n const cam = this._rigCameras[i];\r\n const rigPostProcess = cam._rigPostProcess;\r\n\r\n // for VR rig, there does not have to be a post process\r\n if (rigPostProcess) {\r\n const isPass = rigPostProcess.getEffectName() === \"pass\";\r\n if (isPass) {\r\n // any rig which has a PassPostProcess for rig[0], cannot be isIntermediate when there are also user postProcesses\r\n cam.isIntermediate = this._postProcesses.length === 0;\r\n }\r\n cam._postProcesses = this._postProcesses.slice(0).concat(rigPostProcess);\r\n rigPostProcess.markTextureDirty();\r\n } else {\r\n cam._postProcesses = this._postProcesses.slice(0);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Attach a post process to the camera.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess\r\n * @param postProcess The post process to attach to the camera\r\n * @param insertAt The position of the post process in case several of them are in use in the scene\r\n * @returns the position the post process has been inserted at\r\n */\r\n public attachPostProcess(postProcess: PostProcess, insertAt: Nullable<number> = null): number {\r\n if (!postProcess.isReusable() && this._postProcesses.indexOf(postProcess) > -1) {\r\n Logger.Error(\"You're trying to reuse a post process not defined as reusable.\");\r\n return 0;\r\n }\r\n\r\n if (insertAt == null || insertAt < 0) {\r\n this._postProcesses.push(postProcess);\r\n } else if (this._postProcesses[insertAt] === null) {\r\n this._postProcesses[insertAt] = postProcess;\r\n } else {\r\n this._postProcesses.splice(insertAt, 0, postProcess);\r\n }\r\n this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated\r\n\r\n // Update prePass\r\n if (this._scene.prePassRenderer) {\r\n this._scene.prePassRenderer.markAsDirty();\r\n }\r\n\r\n return this._postProcesses.indexOf(postProcess);\r\n }\r\n\r\n /**\r\n * Detach a post process to the camera.\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess\r\n * @param postProcess The post process to detach from the camera\r\n */\r\n public detachPostProcess(postProcess: PostProcess): void {\r\n const idx = this._postProcesses.indexOf(postProcess);\r\n if (idx !== -1) {\r\n this._postProcesses[idx] = null;\r\n }\r\n\r\n // Update prePass\r\n if (this._scene.prePassRenderer) {\r\n this._scene.prePassRenderer.markAsDirty();\r\n }\r\n\r\n this._cascadePostProcessesToRigCams(); // also ensures framebuffer invalidated\r\n }\r\n\r\n /**\r\n * Gets the current world matrix of the camera\r\n * @returns the world matrix\r\n */\r\n public getWorldMatrix(): Matrix {\r\n if (this._isSynchronizedViewMatrix()) {\r\n return this._worldMatrix;\r\n }\r\n\r\n // Getting the view matrix will also compute the world matrix.\r\n this.getViewMatrix();\r\n\r\n return this._worldMatrix;\r\n }\r\n\r\n /** @internal */\r\n public _getViewMatrix(): Matrix {\r\n return Matrix.Identity();\r\n }\r\n\r\n /**\r\n * Gets the current view matrix of the camera.\r\n * @param force forces the camera to recompute the matrix without looking at the cached state\r\n * @returns the view matrix\r\n */\r\n public getViewMatrix(force?: boolean): Matrix {\r\n if (!force && this._isSynchronizedViewMatrix()) {\r\n return this._computedViewMatrix;\r\n }\r\n\r\n this._hasMoved = true;\r\n\r\n this.updateCache();\r\n this._computedViewMatrix = this._getViewMatrix();\r\n\r\n this._currentRenderId = this.getScene().getRenderId();\r\n this._childUpdateId++;\r\n\r\n this._refreshFrustumPlanes = true;\r\n\r\n if (this._cameraRigParams && this._cameraRigParams.vrPreViewMatrix) {\r\n this._computedViewMatrix.multiplyToRef(this._cameraRigParams.vrPreViewMatrix, this._computedViewMatrix);\r\n }\r\n\r\n // Notify parent camera if rig camera is changed\r\n if (this.parent && (this.parent as Camera).onViewMatrixChangedObservable) {\r\n (this.parent as Camera).onViewMatrixChangedObservable.notifyObservers(this.parent as Camera);\r\n }\r\n\r\n this.onViewMatrixChangedObservable.notifyObservers(this);\r\n\r\n this._computedViewMatrix.invertToRef(this._worldMatrix);\r\n\r\n return this._computedViewMatrix;\r\n }\r\n\r\n /**\r\n * Freeze the projection matrix.\r\n * It will prevent the cache check of the camera projection compute and can speed up perf\r\n * if no parameter of the camera are meant to change\r\n * @param projection Defines manually a projection if necessary\r\n */\r\n public freezeProjectionMatrix(projection?: Matrix): void {\r\n this._doNotComputeProjectionMatrix = true;\r\n if (projection !== undefined) {\r\n this._projectionMatrix = projection;\r\n }\r\n }\r\n\r\n /**\r\n * Unfreeze the projection matrix if it has previously been freezed by freezeProjectionMatrix.\r\n */\r\n public unfreezeProjectionMatrix(): void {\r\n this._doNotComputeProjectionMatrix = false;\r\n }\r\n\r\n /**\r\n * Gets the current projection matrix of the camera.\r\n * @param force forces the camera to recompute the matrix without looking at the cached state\r\n * @returns the projection matrix\r\n */\r\n public getProjectionMatrix(force?: boolean): Matrix {\r\n if (this._doNotComputeProjectionMatrix || (!force && this._isSynchronizedProjectionMatrix())) {\r\n return this._projectionMatrix;\r\n }\r\n\r\n // Cache\r\n this._cache.mode = this.mode;\r\n this._cache.minZ = this.minZ;\r\n this._cache.maxZ = this.maxZ;\r\n\r\n // Matrix\r\n this._refreshFrustumPlanes = true;\r\n\r\n const engine = this.getEngine();\r\n const scene = this.getScene();\r\n const reverseDepth = engine.useReverseDepthBuffer;\r\n if (this.mode === Camera.PERSPECTIVE_CAMERA) {\r\n this._cache.fov = this.fov;\r\n this._cache.fovMode = this.fovMode;\r\n this._cache.aspectRatio = engine.getAspectRatio(this);\r\n this._cache.projectionPlaneTilt = this.projectionPlaneTilt;\r\n\r\n if (this.minZ <= 0) {\r\n this.minZ = 0.1;\r\n }\r\n\r\n let getProjectionMatrix: (\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n result: Matrix,\r\n isVerticalFovFixed: boolean,\r\n halfZRange: boolean,\r\n projectionPlaneTilt: number,\r\n reverseDepthBufferMode: boolean\r\n ) => void;\r\n if (scene.useRightHandedSystem) {\r\n getProjectionMatrix = Matrix.PerspectiveFovRHToRef;\r\n } else {\r\n getProjectionMatrix = Matrix.PerspectiveFovLHToRef;\r\n }\r\n\r\n getProjectionMatrix(\r\n this.fov,\r\n engine.getAspectRatio(this),\r\n reverseDepth ? this.maxZ : this.minZ,\r\n reverseDepth ? this.minZ : this.maxZ,\r\n this._projectionMatrix,\r\n this.fovMode === Camera.FOVMODE_VERTICAL_FIXED,\r\n engine.isNDCHalfZRange,\r\n this.projectionPlaneTilt,\r\n reverseDepth\r\n );\r\n } else {\r\n const halfWidth = engine.getRenderWidth() / 2.0;\r\n const halfHeight = engine.getRenderHeight() / 2.0;\r\n if (scene.useRightHandedSystem) {\r\n if (this.oblique) {\r\n Matrix.ObliqueOffCenterRHToRef(\r\n this.orthoLeft ?? -halfWidth,\r\n this.orthoRight ?? halfWidth,\r\n this.orthoBottom ?? -halfHeight,\r\n this.orthoTop ?? halfHeight,\r\n reverseDepth ? this.maxZ : this.minZ,\r\n reverseDepth ? this.minZ : this.maxZ,\r\n this.oblique.length,\r\n this.oblique.angle,\r\n this._computeObliqueDistance(this.oblique.offset),\r\n this._projectionMatrix,\r\n engine.isNDCHalfZRange\r\n );\r\n } else {\r\n Matrix.OrthoOffCenterRHToRef(\r\n this.orthoLeft ?? -halfWidth,\r\n this.orthoRight ?? halfWidth,\r\n this.orthoBottom ?? -halfHeight,\r\n this.orthoTop ?? halfHeight,\r\n reverseDepth ? this.maxZ : this.minZ,\r\n reverseDepth ? this.minZ : this.maxZ,\r\n this._projectionMatrix,\r\n engine.isNDCHalfZRange\r\n );\r\n }\r\n } else {\r\n if (this.oblique) {\r\n Matrix.ObliqueOffCenterLHToRef(\r\n this.orthoLeft ?? -halfWidth,\r\n this.orthoRight ?? halfWidth,\r\n this.orthoBottom ?? -halfHeight,\r\n this.orthoTop ?? halfHeight,\r\n reverseDepth ? this.maxZ : this.minZ,\r\n reverseDepth ? this.minZ : this.maxZ,\r\n this.oblique.length,\r\n this.oblique.angle,\r\n this._computeObliqueDistance(this.oblique.offset),\r\n this._projectionMatrix,\r\n engine.isNDCHalfZRange\r\n );\r\n } else {\r\n Matrix.OrthoOffCenterLHToRef(\r\n this.orthoLeft ?? -halfWidth,\r\n this.orthoRight ?? halfWidth,\r\n this.orthoBottom ?? -halfHeight,\r\n this.orthoTop ?? halfHeight,\r\n reverseDepth ? this.maxZ : this.minZ,\r\n reverseDepth ? this.minZ : this.maxZ,\r\n this._projectionMatrix,\r\n engine.isNDCHalfZRange\r\n );\r\n }\r\n }\r\n\r\n this._cache.orthoLeft = this.orthoLeft;\r\n this._cache.orthoRight = this.orthoRight;\r\n this._cache.orthoBottom = this.orthoBottom;\r\n this._cache.orthoTop = this.orthoTop;\r\n this._cache.obliqueAngle = this.oblique?.angle;\r\n this._cache.obliqueLength = this.oblique?.length;\r\n this._cache.obliqueOffset = this.oblique?.offset;\r\n this._cache.renderWidth = engine.getRenderWidth();\r\n this._cache.renderHeight = engine.getRenderHeight();\r\n }\r\n\r\n this.onProjectionMatrixChangedObservable.notifyObservers(this);\r\n\r\n return this._projectionMatrix;\r\n }\r\n\r\n /**\r\n * Gets the transformation matrix (ie. the multiplication of view by projection matrices)\r\n * @returns a Matrix\r\n */\r\n public getTransformationMatrix(): Matrix {\r\n this._computedViewMatrix.multiplyToRef(this._projectionMatrix, this._transformMatrix);\r\n return this._transformMatrix;\r\n }\r\n\r\n private _computeObliqueDistance(offset: number): number {\r\n const arcRotateCamera = this as Camera as ArcRotateCamera;\r\n const targetCamera = this as Camera as TargetCamera;\r\n return (arcRotateCamera.radius || (targetCamera.target ? Vector3.Distance(this.position, targetCamera.target) : this.position.length())) + offset;\r\n }\r\n\r\n private _updateFrustumPlanes(): void {\r\n if (!this._refreshFrustumPlanes) {\r\n return;\r\n }\r\n\r\n this.getTransformationMatrix();\r\n\r\n if (!this._frustumPlanes) {\r\n this._frustumPlanes = Frustum.GetPlanes(this._transformMatrix);\r\n } else {\r\n Frustum.GetPlanesToRef(this._transformMatrix, this._frustumPlanes);\r\n }\r\n\r\n this._refreshFrustumPlanes = false;\r\n }\r\n\r\n /**\r\n * Checks if a cullable object (mesh...) is in the camera frustum\r\n * This checks the bounding box center. See isCompletelyInFrustum for a full bounding check\r\n * @param target The object to check\r\n * @param checkRigCameras If the rig cameras should be checked (eg. with VR camera both eyes should be checked) (Default: false)\r\n * @returns true if the object is in frustum otherwise false\r\n */\r\n public isInFrustum(target: ICullable, checkRigCameras = false): boolean {\r\n this._updateFrustumPlanes();\r\n\r\n if (checkRigCameras && this.rigCameras.length > 0) {\r\n let result = false;\r\n this.rigCameras.forEach((cam) => {\r\n cam._updateFrustumPlanes();\r\n result = result || target.isInFrustum(cam._frustumPlanes);\r\n });\r\n return result;\r\n } else {\r\n return target.isInFrustum(this._frustumPlanes);\r\n }\r\n }\r\n\r\n /**\r\n * Checks if a cullable object (mesh...) is in the camera frustum\r\n * Unlike isInFrustum this checks the full bounding box\r\n * @param target The object to check\r\n * @returns true if the object is in frustum otherwise false\r\n */\r\n public isCompletelyInFrustum(target: ICullable): boolean {\r\n this._updateFrustumPlanes();\r\n\r\n return target.isCompletelyInFrustum(this._frustumPlanes);\r\n }\r\n\r\n // eslint-disable-next-line jsdoc/require-returns-check\r\n /**\r\n * Gets a ray in the forward direction from the camera.\r\n * @param length Defines the length of the ray to create\r\n * @param transform Defines the transform to apply to the ray, by default the world matrix is used to create a workd space ray\r\n * @param origin Defines the start point of the ray which defaults to the camera position\r\n * @returns the forward ray\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getForwardRay(length = 100, transform?: Matrix, origin?: Vector3): Ray {\r\n throw _WarnImport(\"Ray\");\r\n }\r\n\r\n // eslint-disable-next-line jsdoc/require-returns-check\r\n /**\r\n * Gets a ray in the forward direction from the camera.\r\n * @param refRay the ray to (re)use when setting the values\r\n * @param length Defines the length of the ray to create\r\n * @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray\r\n * @param origin Defines the start point of the ray which defaults to the camera position\r\n * @returns the forward ray\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getForwardRayToRef(refRay: Ray, length = 100, transform?: Matrix, origin?: Vector3): Ray {\r\n throw _WarnImport(\"Ray\");\r\n }\r\n\r\n /**\r\n * Releases resources associated with this node.\r\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\r\n * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)\r\n */\r\n public dispose(doNotRecurse?: boolean, disposeMaterialAndTextures = false): void {\r\n // Observables\r\n this.onViewMatrixChangedObservable.clear();\r\n this.onProjectionMatrixChangedObservable.clear();\r\n this.onAfterCheckInputsObservable.clear();\r\n this.onRestoreStateObservable.clear();\r\n\r\n // Inputs\r\n if (this.inputs) {\r\n this.inputs.clear();\r\n }\r\n\r\n // Animations\r\n this.getScene().stopAnimation(this);\r\n\r\n // Remove from scene\r\n this.getScene().removeCamera(this);\r\n while (this._rigCameras.length > 0) {\r\n const camera = this._rigCameras.pop();\r\n if (camera) {\r\n camera.dispose();\r\n }\r\n }\r\n\r\n if (this._parentContainer) {\r\n const index = this._parentContainer.cameras.indexOf(this);\r\n if (index > -1) {\r\n this._parentContainer.cameras.splice(index, 1);\r\n }\r\n this._parentContainer = null;\r\n }\r\n\r\n // Postprocesses\r\n if (this._rigPostProcess) {\r\n this._rigPostProcess.dispose(this);\r\n this._rigPostProcess = null;\r\n this._postProcesses.length = 0;\r\n } else if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\r\n this._rigPostProcess = null;\r\n this._postProcesses.length = 0;\r\n } else {\r\n let i = this._postProcesses.length;\r\n while (--i >= 0) {\r\n const postProcess = this._postProcesses[i];\r\n if (postProcess) {\r\n postProcess.dispose(this);\r\n }\r\n }\r\n }\r\n\r\n // Render targets\r\n let i = this.customRenderTargets.length;\r\n while (--i >= 0) {\r\n this.customRenderTargets[i].dispose();\r\n }\r\n this.customRenderTargets.length = 0;\r\n\r\n // Active Meshes\r\n this._activeMeshes.dispose();\r\n\r\n this.getScene().getEngine().releaseRenderPassId(this.renderPassId);\r\n\r\n super.dispose(doNotRecurse, disposeMaterialAndTextures);\r\n }\r\n\r\n /** @internal */\r\n public _isLeftCamera = false;\r\n /**\r\n * Gets the left camera of a rig setup in case of Rigged Camera\r\n */\r\n public get isLeftCamera(): boolean {\r\n return this._isLeftCamera;\r\n }\r\n\r\n /** @internal */\r\n public _isRightCamera = false;\r\n /**\r\n * Gets the right camera of a rig setup in case of Rigged Camera\r\n */\r\n public get isRightCamera(): boolean {\r\n return this._isRightCamera;\r\n }\r\n\r\n /**\r\n * Gets the left camera of a rig setup in case of Rigged Camera\r\n */\r\n public get leftCamera(): Nullable<FreeCamera> {\r\n if (this._rigCameras.length < 1) {\r\n return null;\r\n }\r\n return <FreeCamera>this._rigCameras[0];\r\n }\r\n\r\n /**\r\n * Gets the right camera of a rig setup in case of Rigged Camera\r\n */\r\n public get rightCamera(): Nullable<FreeCamera> {\r\n if (this._rigCameras.length < 2) {\r\n return null;\r\n }\r\n return <FreeCamera>this._rigCameras[1];\r\n }\r\n\r\n /**\r\n * Gets the left camera target of a rig setup in case of Rigged Camera\r\n * @returns the target position\r\n */\r\n public getLeftTarget(): Nullable<Vector3> {\r\n if (this._rigCameras.length < 1) {\r\n return null;\r\n }\r\n return (<TargetCamera>this._rigCameras[0]).getTarget();\r\n }\r\n\r\n /**\r\n * Gets the right camera target of a rig setup in case of Rigged Camera\r\n * @returns the target position\r\n */\r\n public getRightTarget(): Nullable<Vector3> {\r\n if (this._rigCameras.length < 2) {\r\n return null;\r\n }\r\n return (<TargetCamera>this._rigCameras[1]).getTarget();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public setCameraRigMode(mode: number, rigParams: any): void {\r\n if (this.cameraRigMode === mode) {\r\n return;\r\n }\r\n\r\n while (this._rigCameras.length > 0) {\r\n const camera = this._rigCameras.pop();\r\n\r\n if (camera) {\r\n camera.dispose();\r\n }\r\n }\r\n this.cameraRigMode = mode;\r\n this._cameraRigParams = {};\r\n //we have to implement stereo camera calcultating left and right viewpoints from interaxialDistance and target,\r\n //not from a given angle as it is now, but until that complete code rewriting provisional stereoHalfAngle value is introduced\r\n this._cameraRigParams.interaxialDistance = rigParams.interaxialDistance || 0.0637;\r\n this._cameraRigParams.stereoHalfAngle = Tools.ToRadians(this._cameraRigParams.interaxialDistance / 0.0637);\r\n\r\n // create the rig cameras, unless none\r\n if (this.cameraRigMode !== Camera.RIG_MODE_NONE) {\r\n const leftCamera = this.createRigCamera(this.name + \"_L\", 0);\r\n if (leftCamera) {\r\n leftCamera._isLeftCamera = true;\r\n }\r\n const rightCamera = this.createRigCamera(this.name + \"_R\", 1);\r\n if (rightCamera) {\r\n rightCamera._isRightCamera = true;\r\n }\r\n if (leftCamera && rightCamera) {\r\n this._rigCameras.push(leftCamera);\r\n this._rigCameras.push(rightCamera);\r\n }\r\n }\r\n\r\n this._setRigMode(rigParams);\r\n\r\n this._cascadePostProcessesToRigCams();\r\n this.update();\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n protected _setRigMode(rigParams: any) {\r\n // no-op\r\n }\r\n\r\n /** @internal */\r\n public _getVRProjectionMatrix(): Matrix {\r\n Matrix.PerspectiveFovLHToRef(\r\n this._cameraRigParams.vrMetrics.aspectRatioFov,\r\n this._cameraRigParams.vrMetrics.aspectRatio,\r\n this.minZ,\r\n this.maxZ,\r\n this._cameraRigParams.vrWorkMatrix,\r\n true,\r\n this.getEngine().isNDCHalfZRange\r\n );\r\n this._cameraRigParams.vrWorkMatrix.multiplyToRef(this._cameraRigParams.vrHMatrix, this._projectionMatrix);\r\n return this._projectionMatrix;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public setCameraRigParameter(name: string, value: any) {\r\n if (!this._cameraRigParams) {\r\n this._cameraRigParams = {};\r\n }\r\n this._cameraRigParams[name] = value;\r\n //provisionnally:\r\n if (name === \"interaxialDistance\") {\r\n this._cameraRigParams.stereoHalfAngle = Tools.ToRadians(value / 0.0637);\r\n }\r\n }\r\n\r\n /**\r\n * needs to be overridden by children so sub has required properties to be copied\r\n * @internal\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public createRigCamera(name: string, cameraIndex: number): Nullable<Camera> {\r\n return null;\r\n }\r\n\r\n /**\r\n * May need to be overridden by children\r\n * @internal\r\n */\r\n public _updateRigCameras() {\r\n for (let i = 0; i < this._rigCameras.length; i++) {\r\n this._rigCameras[i].minZ = this.minZ;\r\n this._rigCameras[i].maxZ = this.maxZ;\r\n this._rigCameras[i].fov = this.fov;\r\n this._rigCameras[i].upVector.copyFrom(this.upVector);\r\n }\r\n\r\n // only update viewport when ANAGLYPH\r\n if (this.cameraRigMode === Camera.RIG_MODE_STEREOSCOPIC_ANAGLYPH) {\r\n this._rigCameras[0].viewport = this._rigCameras[1].viewport = this.viewport;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _setupInputs() {}\r\n\r\n /**\r\n * Serialiaze the camera setup to a json representation\r\n * @returns the JSON representation\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this);\r\n serializationObject.uniqueId = this.uniqueId;\r\n\r\n // Type\r\n serializationObject.type = this.getClassName();\r\n\r\n // Parent\r\n if (this.parent) {\r\n this.parent._serializeAsParent(serializationObject);\r\n }\r\n\r\n if (this.inputs) {\r\n this.inputs.serialize(serializationObject);\r\n }\r\n // Animations\r\n SerializationHelper.AppendSerializedAnimations(this, serializationObject);\r\n serializationObject.ranges = this.serializeAnimationRanges();\r\n\r\n serializationObject.isEnabled = this.isEnabled();\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Clones the current camera.\r\n * @param name The cloned camera name\r\n * @param newParent The cloned camera's new parent (none by default)\r\n * @returns the cloned camera\r\n */\r\n public clone(name: string, newParent: Nullable<Node> = null): Camera {\r\n const camera = SerializationHelper.Clone(\r\n Camera.GetConstructorFromName(this.getClassName(), name, this.getScene(), this.interaxialDistance, this.isStereoscopicSideBySide),\r\n this\r\n );\r\n camera.name = name;\r\n camera.parent = newParent;\r\n\r\n this.onClonedObservable.notifyObservers(camera);\r\n\r\n return camera;\r\n }\r\n\r\n /**\r\n * Gets the direction of the camera relative to a given local axis.\r\n * @param localAxis Defines the reference axis to provide a relative direction.\r\n * @returns the direction\r\n */\r\n public getDirection(localAxis: Vector3): Vector3 {\r\n const result = Vector3.Zero();\r\n\r\n this.getDirectionToRef(localAxis, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns the current camera absolute rotation\r\n */\r\n public get absoluteRotation(): Quaternion {\r\n this.getWorldMatrix().decompose(undefined, this._absoluteRotation);\r\n\r\n return this._absoluteRotation;\r\n }\r\n\r\n /**\r\n * Gets the direction of the camera relative to a given local axis into a passed vector.\r\n * @param localAxis Defines the reference axis to provide a relative direction.\r\n * @param result Defines the vector to store the result in\r\n */\r\n public getDirectionToRef(localAxis: Vector3, result: Vector3): void {\r\n Vector3.TransformNormalToRef(localAxis, this.getWorldMatrix(), result);\r\n }\r\n\r\n /**\r\n * Gets a camera constructor for a given camera type\r\n * @param type The type of the camera to construct (should be equal to one of the camera class name)\r\n * @param name The name of the camera the result will be able to instantiate\r\n * @param scene The scene the result will construct the camera in\r\n * @param interaxial_distance In case of stereoscopic setup, the distance between both eyes\r\n * @param isStereoscopicSideBySide In case of stereoscopic setup, should the sereo be side b side\r\n * @returns a factory method to construct the camera\r\n */\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n static GetConstructorFromName(type: string, name: string, scene: Scene, interaxial_distance: number = 0, isStereoscopicSideBySide: boolean = true): () => Camera {\r\n const constructorFunc = Node.Construct(type, name, scene, {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n interaxial_distance: interaxial_distance,\r\n isStereoscopicSideBySide: isStereoscopicSideBySide,\r\n });\r\n\r\n if (constructorFunc) {\r\n return <() => Camera>constructorFunc;\r\n }\r\n\r\n // Default to universal camera\r\n return () => Camera._CreateDefaultParsedCamera(name, scene);\r\n }\r\n\r\n /**\r\n * Compute the world matrix of the camera.\r\n * @returns the camera world matrix\r\n */\r\n public computeWorldMatrix(): Matrix {\r\n return this.getWorldMatrix();\r\n }\r\n\r\n /**\r\n * Parse a JSON and creates the camera from the parsed information\r\n * @param parsedCamera The JSON to parse\r\n * @param scene The scene to instantiate the camera in\r\n * @returns the newly constructed camera\r\n */\r\n public static Parse(parsedCamera: any, scene: Scene): Camera {\r\n const type = parsedCamera.type;\r\n const construct = Camera.GetConstructorFromName(type, parsedCamera.name, scene, parsedCamera.interaxial_distance, parsedCamera.isStereoscopicSideBySide);\r\n\r\n const camera = SerializationHelper.Parse(construct, parsedCamera, scene);\r\n\r\n // Parent\r\n if (parsedCamera.parentId !== undefined) {\r\n camera._waitingParentId = parsedCamera.parentId;\r\n }\r\n\r\n // Parent instance index\r\n if (parsedCamera.parentInstanceIndex !== undefined) {\r\n camera._waitingParentInstanceIndex = parsedCamera.parentInstanceIndex;\r\n }\r\n\r\n //If camera has an input manager, let it parse inputs settings\r\n if (camera.inputs) {\r\n camera.inputs.parse(parsedCamera);\r\n\r\n camera._setupInputs();\r\n }\r\n\r\n if (parsedCamera.upVector) {\r\n camera.upVector = Vector3.FromArray(parsedCamera.upVector); // need to force the upVector\r\n }\r\n\r\n if ((<any>camera).setPosition) {\r\n // need to force position\r\n camera.position.copyFromFloats(0, 0, 0);\r\n (<any>camera).setPosition(Vector3.FromArray(parsedCamera.position));\r\n }\r\n\r\n // Target\r\n if (parsedCamera.target) {\r\n if ((<any>camera).setTarget) {\r\n (<any>camera).setTarget(Vector3.FromArray(parsedCamera.target));\r\n }\r\n }\r\n\r\n // Apply 3d rig, when found\r\n if (parsedCamera.cameraRigMode) {\r\n const rigParams = parsedCamera.interaxial_distance ? { interaxialDistance: parsedCamera.interaxial_distance } : {};\r\n camera.setCameraRigMode(parsedCamera.cameraRigMode, rigParams);\r\n }\r\n\r\n // Animations\r\n if (parsedCamera.animations) {\r\n for (let animationIndex = 0; animationIndex < parsedCamera.animations.length; animationIndex++) {\r\n const parsedAnimation = parsedCamera.animations[animationIndex];\r\n const internalClass = GetClass(\"BABYLON.Animation\");\r\n if (internalClass) {\r\n camera.animations.push(internalClass.Parse(parsedAnimation));\r\n }\r\n }\r\n Node.ParseAnimationRanges(camera, parsedCamera, scene);\r\n }\r\n\r\n if (parsedCamera.autoAnimate) {\r\n scene.beginAnimation(camera, parsedCamera.autoAnimateFrom, parsedCamera.autoAnimateTo, parsedCamera.autoAnimateLoop, parsedCamera.autoAnimateSpeed || 1.0);\r\n }\r\n\r\n // Check if isEnabled is defined to be back compatible with prior serialized versions.\r\n if (parsedCamera.isEnabled !== undefined) {\r\n camera.setEnabled(parsedCamera.isEnabled);\r\n }\r\n\r\n return camera;\r\n }\r\n\r\n /** @internal */\r\n public _calculateHandednessMultiplier(): number {\r\n let handednessMultiplier = this.getScene().useRightHandedSystem ? -1 : 1;\r\n if (this.parent && this.parent._getWorldMatrixDeterminant() < 0) {\r\n handednessMultiplier *= -1;\r\n }\r\n\r\n return handednessMultiplier;\r\n }\r\n}\r\n"]}
@@ -25,8 +25,9 @@ export interface ICanvas {
25
25
  toDataURL(mime: string): string;
26
26
  /**
27
27
  * Removes the canvas from the document.
28
+ * Offscreen canvases don't have the remove function, so we need to make it optional.
28
29
  */
29
- remove(): void;
30
+ remove?(): void;
30
31
  }
31
32
  /**
32
33
  * Class used to abstract am image to use with the canvas and its context
@@ -1 +1 @@
1
- {"version":3,"file":"ICanvas.js","sourceRoot":"","sources":["../../../../dev/core/src/Engines/ICanvas.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Class used to abstract a canvas\r\n */\r\nexport interface ICanvas {\r\n /**\r\n * Canvas width.\r\n */\r\n width: number;\r\n\r\n /**\r\n * Canvas height.\r\n */\r\n height: number;\r\n\r\n /**\r\n * returns a drawing context on the canvas.\r\n * @param contextType context identifier.\r\n * @param contextAttributes context attributes.\r\n * @returns ICanvasRenderingContext object.\r\n */\r\n getContext(contextType: string, contextAttributes?: any): ICanvasRenderingContext;\r\n\r\n /**\r\n * returns a data URI containing a representation of the image in the format specified by the type parameter.\r\n * @param mime the image format.\r\n * @returns string containing the requested data URI.\r\n */\r\n toDataURL(mime: string): string;\r\n\r\n /**\r\n * Removes the canvas from the document.\r\n */\r\n remove(): void;\r\n}\r\n\r\n/**\r\n * Class used to abstract am image to use with the canvas and its context\r\n */\r\nexport interface IImage {\r\n /**\r\n * onload callback.\r\n */\r\n onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;\r\n\r\n /**\r\n * Error callback.\r\n */\r\n onerror: ((this: GlobalEventHandlers, ev: Event) => any) | null;\r\n\r\n /**\r\n * Image source.\r\n */\r\n src: string;\r\n\r\n /**\r\n * Image width.\r\n */\r\n readonly width: number;\r\n\r\n /**\r\n * Image height.\r\n */\r\n readonly height: number;\r\n\r\n /**\r\n * The original height of the image resource before sizing.\r\n */\r\n readonly naturalHeight: number;\r\n\r\n /**\r\n * The original width of the image resource before sizing.\r\n */\r\n readonly naturalWidth: number;\r\n\r\n /**\r\n * provides support for CORS, defining how the element handles crossorigin requests,\r\n * thereby enabling the configuration of the CORS requests for the element's fetched data.\r\n */\r\n crossOrigin: string | null;\r\n\r\n /**\r\n * provides support for referrer policy on xhr load request,\r\n * it is used to control the request header.\r\n */\r\n referrerPolicy: string;\r\n}\r\n\r\n/**\r\n * Class used to abstract a canvas gradient\r\n */\r\nexport interface ICanvasGradient {\r\n /**\r\n * adds a new color stop, defined by an offset and a color, to a given canvas gradient.\r\n * @param offset A number between 0 and 1, inclusive, representing the position of the color stop. 0 represents the start of the gradient and 1 represents the end.\r\n * @param color value representing the color of the stop.\r\n */\r\n addColorStop(offset: number, color: string): void;\r\n}\r\n\r\n/**\r\n * Class used to abstract a text measurement\r\n */\r\nexport interface ITextMetrics {\r\n /**\r\n * Text width.\r\n */\r\n readonly width: number;\r\n /**\r\n * distance (in pixels) parallel to the baseline from the alignment point given by the CanvasRenderingContext2D.textAlign\r\n * property to the left side of the bounding rectangle of the given text\r\n */\r\n readonly actualBoundingBoxLeft: number;\r\n /**\r\n * distance (in pixels) parallel to the baseline from the alignment point given by the CanvasRenderingContext2D.textAlign\r\n * property to the right side of the bounding rectangle of the given text\r\n */\r\n readonly actualBoundingBoxRight: number;\r\n}\r\n\r\n/**\r\n * Class used to abstract a matrix\r\n */\r\nexport interface DOMMatrix {\r\n /**\r\n * A Boolean flag whose value is true if the matrix was initialized as a 2D matrix. If false, the matrix is 3D.\r\n */\r\n is2D: boolean;\r\n /**\r\n * A Boolean whose value is true if the matrix is the identity matrix. The identity matrix is one in which every value is 0 except those on the main diagonal from top-left to bottom-right corner (in other words, where the offsets in each direction are equal).\r\n */\r\n isIdentity: boolean;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n a: number;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n b: number;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n c: number;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n d: number;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n e: number;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n f: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m11: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m12: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m13: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m14: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m21: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m22: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m23: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m24: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m31: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m32: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m33: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m34: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m41: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m42: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m43: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m44: number;\r\n}\r\n\r\n/**\r\n * Class used to abstract canvas rendering\r\n */\r\nexport interface ICanvasRenderingContext {\r\n /**\r\n * Defines the type of corners where two lines meet. Possible values: round, bevel, miter (default).\r\n */\r\n lineJoin: string;\r\n\r\n /**\r\n * Miter limit ratio. Default 10.\r\n */\r\n miterLimit: number;\r\n\r\n /**\r\n * Font setting. Default value 10px sans-serif.\r\n */\r\n font: string;\r\n\r\n /**\r\n * Color or style to use for the lines around shapes. Default #000 (black).\r\n */\r\n strokeStyle: string | ICanvasGradient;\r\n\r\n /**\r\n * Color or style to use inside shapes. Default #000 (black).\r\n */\r\n fillStyle: string | ICanvasGradient;\r\n\r\n /**\r\n * Alpha value that is applied to shapes and images before they are composited onto the canvas. Default 1.0 (opaque).\r\n */\r\n globalAlpha: number;\r\n\r\n /**\r\n * Color of the shadow. Default: fully-transparent black.\r\n */\r\n shadowColor: string;\r\n\r\n /**\r\n * Specifies the blurring effect. Default: 0.\r\n */\r\n shadowBlur: number;\r\n\r\n /**\r\n * Horizontal distance the shadow will be offset. Default: 0.\r\n */\r\n shadowOffsetX: number;\r\n\r\n /**\r\n * Vertical distance the shadow will be offset. Default: 0.\r\n */\r\n shadowOffsetY: number;\r\n\r\n /**\r\n * Width of lines. Default 1.0.\r\n */\r\n lineWidth: number;\r\n\r\n /**\r\n * canvas is a read-only reference to ICanvas.\r\n */\r\n readonly canvas: ICanvas;\r\n\r\n /**\r\n * Sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black, erasing any previously drawn content.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n clearRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Saves the current drawing style state using a stack so you can revert any change you make to it using restore().\r\n */\r\n save(): void;\r\n\r\n /**\r\n * Restores the drawing style state to the last element on the 'state stack' saved by save().\r\n */\r\n restore(): void;\r\n\r\n /**\r\n * Draws a filled rectangle at (x, y) position whose size is determined by width and height.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n fillRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Adds a scaling transformation to the canvas units by x horizontally and by y vertically.\r\n * @param x Scaling factor in the horizontal direction. A negative value flips pixels across the vertical axis. A value of 1 results in no horizontal scaling.\r\n * @param y Scaling factor in the vertical direction. A negative value flips pixels across the horizontal axis. A value of 1 results in no vertical scaling.\r\n */\r\n scale(x: number, y: number): void;\r\n\r\n /**\r\n * Adds a rotation to the transformation matrix. The angle argument represents a clockwise rotation angle and is expressed in radians.\r\n * @param angle The rotation angle, clockwise in radians. You can use degree * Math.PI / 180 to calculate a radian from a degree.\r\n */\r\n rotate(angle: number): void;\r\n\r\n /**\r\n * Adds a translation transformation by moving the canvas and its origin x horizontally and y vertically on the grid.\r\n * @param x Distance to move in the horizontal direction. Positive values are to the right, and negative to the left.\r\n * @param y Distance to move in the vertical direction. Positive values are down, and negative are up.\r\n */\r\n translate(x: number, y: number): void;\r\n\r\n /**\r\n * Paints a rectangle which has a starting point at (x, y) and has a w width and an h height onto the canvas, using the current stroke style.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n strokeRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Creates a path for a rectangle at position (x, y) with a size that is determined by width and height.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n rect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Creates a clipping path from the current sub-paths. Everything drawn after clip() is called appears inside the clipping path only.\r\n */\r\n clip(): void;\r\n\r\n /**\r\n * Paints data from the given ImageData object onto the bitmap. If a dirty rectangle is provided, only the pixels from that rectangle are painted.\r\n * @param imageData An ImageData object containing the array of pixel values.\r\n * @param dx Horizontal position (x coordinate) at which to place the image data in the destination canvas.\r\n * @param dy Vertical position (y coordinate) at which to place the image data in the destination canvas.\r\n */\r\n putImageData(imageData: ImageData, dx: number, dy: number): void;\r\n\r\n /**\r\n * Adds a circular arc to the current path.\r\n * @param x The horizontal coordinate of the arc's center.\r\n * @param y The vertical coordinate of the arc's center.\r\n * @param radius The arc's radius. Must be positive.\r\n * @param startAngle The angle at which the arc starts in radians, measured from the positive x-axis.\r\n * @param endAngle The angle at which the arc ends in radians, measured from the positive x-axis.\r\n * @param anticlockwise An optional Boolean. If true, draws the arc counter-clockwise between the start and end angles. The default is false (clockwise).\r\n */\r\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\r\n\r\n /**\r\n * Starts a new path by emptying the list of sub-paths. Call this method when you want to create a new path.\r\n */\r\n beginPath(): void;\r\n\r\n /**\r\n * Causes the point of the pen to move back to the start of the current sub-path. It tries to draw a straight line from the current point to the start.\r\n * If the shape has already been closed or has only one point, this function does nothing.\r\n */\r\n closePath(): void;\r\n\r\n /**\r\n * Moves the starting point of a new sub-path to the (x, y) coordinates.\r\n * @param x The x-axis (horizontal) coordinate of the point.\r\n * @param y The y-axis (vertical) coordinate of the point.\r\n */\r\n moveTo(x: number, y: number): void;\r\n\r\n /**\r\n * Connects the last point in the current sub-path to the specified (x, y) coordinates with a straight line.\r\n * @param x The x-axis coordinate of the line's end point.\r\n * @param y The y-axis coordinate of the line's end point.\r\n */\r\n lineTo(x: number, y: number): void;\r\n\r\n /**\r\n * Adds a quadratic Bézier curve to the current path.\r\n * @param cpx The x-axis coordinate of the control point.\r\n * @param cpy The y-axis coordinate of the control point.\r\n * @param x The x-axis coordinate of the end point.\r\n * @param y The y-axis coordinate of the end point.\r\n */\r\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;\r\n\r\n /**\r\n * Returns a TextMetrics object.\r\n * @param text The text String to measure.\r\n * @returns ITextMetrics A ITextMetrics object.\r\n */\r\n measureText(text: string): ITextMetrics;\r\n\r\n /**\r\n * Strokes the current sub-paths with the current stroke style.\r\n */\r\n stroke(): void;\r\n\r\n /**\r\n * Fills the current sub-paths with the current fill style.\r\n */\r\n fill(): void;\r\n\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param sx The x-axis coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.\r\n * @param sy The y-axis coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.\r\n * @param sWidth The width of the sub-rectangle of the source image to draw into the destination context. If not specified, the entire rectangle from the coordinates specified by sx and sy to the bottom-right corner of the image is used.\r\n * @param sHeight The height of the sub-rectangle of the source image to draw into the destination context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dWidth The width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.\r\n * @param dHeight The height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.\r\n */\r\n\r\n drawImage(image: any, sx: number, sy: number, sWidth: number, sHeight: number, dx: number, dy: number, dWidth: number, dHeight: number): void;\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dWidth The width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.\r\n * @param dHeight The height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.\r\n */\r\n drawImage(image: any, dx: number, dy: number, dWidth: number, dHeight: number): void;\r\n\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n */\r\n drawImage(image: any, dx: number, dy: number): void;\r\n\r\n /**\r\n * Returns an ImageData object representing the underlying pixel data for the area of the canvas denoted by the rectangle which starts at (sx, sy) and has an sw width and sh height.\r\n * @param sx The x-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted.\r\n * @param sy The y-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted.\r\n * @param sw The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left.\r\n * @param sh The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up.\r\n * @returns ImageData An ImageData object containing the image data for the rectangle of the canvas specified.\r\n */\r\n getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;\r\n\r\n /**\r\n * Sets the current line dash pattern.\r\n * @param segments An Array of numbers that specify distances to alternately draw a line and a gap (in coordinate space units).\r\n */\r\n setLineDash(segments: Array<number>): void;\r\n\r\n /**\r\n * Draws (fills) a given text at the given (x, y) position.\r\n * @param text A String specifying the text string to render into the context. The text is rendered using the settings specified by font, textAlign, textBaseline, and direction.\r\n * @param x The x-axis coordinate of the point at which to begin drawing the text, in pixels.\r\n * @param y The y-axis coordinate of the baseline on which to begin drawing the text, in pixels.\r\n * @param maxWidth The maximum number of pixels wide the text may be once rendered. If not specified, there is no limit to the width of the text.\r\n */\r\n fillText(text: string, x: number, y: number, maxWidth?: number): void;\r\n\r\n /**\r\n * Draws (strokes) a given text at the given (x, y) position.\r\n * @param text A String specifying the text string to render into the context. The text is rendered using the settings specified by font, textAlign, textBaseline, and direction.\r\n * @param x The x-axis coordinate of the point at which to begin drawing the text, in pixels.\r\n * @param y The y-axis coordinate of the baseline on which to begin drawing the text, in pixels.\r\n * @param maxWidth The maximum number of pixels wide the text may be once rendered. If not specified, there is no limit to the width of the text.\r\n */\r\n strokeText(text: string, x: number, y: number, maxWidth?: number): void;\r\n\r\n /**\r\n * Creates a linear gradient along the line given by the coordinates represented by the parameters.\r\n * @param x0 The x-axis coordinate of the start point.\r\n * @param y0 The y-axis coordinate of the start point.\r\n * @param x1 The x-axis coordinate of the end point.\r\n * @param y1 The y-axis coordinate of the end point.\r\n * @returns ICanvasGradient A linear ICanvasGradient initialized with the specified line.\r\n */\r\n createLinearGradient(x0: number, y0: number, x1: number, y1: number): ICanvasGradient;\r\n\r\n /**\r\n * Creates a linear gradient along the line given by the coordinates represented by the parameters.\r\n * @param x0 The x-axis coordinate of the start circle.\r\n * @param y0 The y-axis coordinate of the start circle.\r\n * @param r0 The radius of the start circle. Must be non-negative and finite.\r\n * @param x1 The x-axis coordinate of the end point.\r\n * @param y1 The y-axis coordinate of the end point.\r\n * @param r1 The radius of the end circle. Must be non-negative and finite.\r\n * @returns ICanvasGradient A linear ICanvasGradient initialized with the two specified circles.\r\n */\r\n createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): ICanvasGradient;\r\n\r\n /**\r\n * Resets the current transform to matrix composed with a, b, c, d, e, f.\r\n * @param a Horizontal scaling. A value of 1 results in no scaling.\r\n * @param b Vertical skewing.\r\n * @param c Horizontal skewing.\r\n * @param d Vertical scaling. A value of 1 results in no scaling.\r\n * @param e Horizontal translation (moving).\r\n * @param f Vertical translation (moving).\r\n */\r\n setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;\r\n\r\n /**\r\n * Retrieves the current transformation matrix being applied to the context.\r\n */\r\n getTransform(): DOMMatrix;\r\n}\r\n"]}
1
+ {"version":3,"file":"ICanvas.js","sourceRoot":"","sources":["../../../../dev/core/src/Engines/ICanvas.ts"],"names":[],"mappings":"","sourcesContent":["/**\r\n * Class used to abstract a canvas\r\n */\r\nexport interface ICanvas {\r\n /**\r\n * Canvas width.\r\n */\r\n width: number;\r\n\r\n /**\r\n * Canvas height.\r\n */\r\n height: number;\r\n\r\n /**\r\n * returns a drawing context on the canvas.\r\n * @param contextType context identifier.\r\n * @param contextAttributes context attributes.\r\n * @returns ICanvasRenderingContext object.\r\n */\r\n getContext(contextType: string, contextAttributes?: any): ICanvasRenderingContext;\r\n\r\n /**\r\n * returns a data URI containing a representation of the image in the format specified by the type parameter.\r\n * @param mime the image format.\r\n * @returns string containing the requested data URI.\r\n */\r\n toDataURL(mime: string): string;\r\n\r\n /**\r\n * Removes the canvas from the document.\r\n * Offscreen canvases don't have the remove function, so we need to make it optional.\r\n */\r\n remove?(): void;\r\n}\r\n\r\n/**\r\n * Class used to abstract am image to use with the canvas and its context\r\n */\r\nexport interface IImage {\r\n /**\r\n * onload callback.\r\n */\r\n onload: ((this: GlobalEventHandlers, ev: Event) => any) | null;\r\n\r\n /**\r\n * Error callback.\r\n */\r\n onerror: ((this: GlobalEventHandlers, ev: Event) => any) | null;\r\n\r\n /**\r\n * Image source.\r\n */\r\n src: string;\r\n\r\n /**\r\n * Image width.\r\n */\r\n readonly width: number;\r\n\r\n /**\r\n * Image height.\r\n */\r\n readonly height: number;\r\n\r\n /**\r\n * The original height of the image resource before sizing.\r\n */\r\n readonly naturalHeight: number;\r\n\r\n /**\r\n * The original width of the image resource before sizing.\r\n */\r\n readonly naturalWidth: number;\r\n\r\n /**\r\n * provides support for CORS, defining how the element handles crossorigin requests,\r\n * thereby enabling the configuration of the CORS requests for the element's fetched data.\r\n */\r\n crossOrigin: string | null;\r\n\r\n /**\r\n * provides support for referrer policy on xhr load request,\r\n * it is used to control the request header.\r\n */\r\n referrerPolicy: string;\r\n}\r\n\r\n/**\r\n * Class used to abstract a canvas gradient\r\n */\r\nexport interface ICanvasGradient {\r\n /**\r\n * adds a new color stop, defined by an offset and a color, to a given canvas gradient.\r\n * @param offset A number between 0 and 1, inclusive, representing the position of the color stop. 0 represents the start of the gradient and 1 represents the end.\r\n * @param color value representing the color of the stop.\r\n */\r\n addColorStop(offset: number, color: string): void;\r\n}\r\n\r\n/**\r\n * Class used to abstract a text measurement\r\n */\r\nexport interface ITextMetrics {\r\n /**\r\n * Text width.\r\n */\r\n readonly width: number;\r\n /**\r\n * distance (in pixels) parallel to the baseline from the alignment point given by the CanvasRenderingContext2D.textAlign\r\n * property to the left side of the bounding rectangle of the given text\r\n */\r\n readonly actualBoundingBoxLeft: number;\r\n /**\r\n * distance (in pixels) parallel to the baseline from the alignment point given by the CanvasRenderingContext2D.textAlign\r\n * property to the right side of the bounding rectangle of the given text\r\n */\r\n readonly actualBoundingBoxRight: number;\r\n}\r\n\r\n/**\r\n * Class used to abstract a matrix\r\n */\r\nexport interface DOMMatrix {\r\n /**\r\n * A Boolean flag whose value is true if the matrix was initialized as a 2D matrix. If false, the matrix is 3D.\r\n */\r\n is2D: boolean;\r\n /**\r\n * A Boolean whose value is true if the matrix is the identity matrix. The identity matrix is one in which every value is 0 except those on the main diagonal from top-left to bottom-right corner (in other words, where the offsets in each direction are equal).\r\n */\r\n isIdentity: boolean;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n a: number;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n b: number;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n c: number;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n d: number;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n e: number;\r\n /**\r\n * The following double-precision floating-point values represent the components of a matrix which are required in order to perform 2D rotations and translations.\r\n */\r\n f: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m11: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m12: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m13: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m14: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m21: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m22: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m23: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m24: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m31: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m32: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m33: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m34: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m41: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m42: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m43: number;\r\n /**\r\n * The following are double-precision floating-point values representing each component of a 4×4 matrix, where m11 through m14 are the first column, m21 through m24 are the second column, and so forth.\r\n */\r\n m44: number;\r\n}\r\n\r\n/**\r\n * Class used to abstract canvas rendering\r\n */\r\nexport interface ICanvasRenderingContext {\r\n /**\r\n * Defines the type of corners where two lines meet. Possible values: round, bevel, miter (default).\r\n */\r\n lineJoin: string;\r\n\r\n /**\r\n * Miter limit ratio. Default 10.\r\n */\r\n miterLimit: number;\r\n\r\n /**\r\n * Font setting. Default value 10px sans-serif.\r\n */\r\n font: string;\r\n\r\n /**\r\n * Color or style to use for the lines around shapes. Default #000 (black).\r\n */\r\n strokeStyle: string | ICanvasGradient;\r\n\r\n /**\r\n * Color or style to use inside shapes. Default #000 (black).\r\n */\r\n fillStyle: string | ICanvasGradient;\r\n\r\n /**\r\n * Alpha value that is applied to shapes and images before they are composited onto the canvas. Default 1.0 (opaque).\r\n */\r\n globalAlpha: number;\r\n\r\n /**\r\n * Color of the shadow. Default: fully-transparent black.\r\n */\r\n shadowColor: string;\r\n\r\n /**\r\n * Specifies the blurring effect. Default: 0.\r\n */\r\n shadowBlur: number;\r\n\r\n /**\r\n * Horizontal distance the shadow will be offset. Default: 0.\r\n */\r\n shadowOffsetX: number;\r\n\r\n /**\r\n * Vertical distance the shadow will be offset. Default: 0.\r\n */\r\n shadowOffsetY: number;\r\n\r\n /**\r\n * Width of lines. Default 1.0.\r\n */\r\n lineWidth: number;\r\n\r\n /**\r\n * canvas is a read-only reference to ICanvas.\r\n */\r\n readonly canvas: ICanvas;\r\n\r\n /**\r\n * Sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black, erasing any previously drawn content.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n clearRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Saves the current drawing style state using a stack so you can revert any change you make to it using restore().\r\n */\r\n save(): void;\r\n\r\n /**\r\n * Restores the drawing style state to the last element on the 'state stack' saved by save().\r\n */\r\n restore(): void;\r\n\r\n /**\r\n * Draws a filled rectangle at (x, y) position whose size is determined by width and height.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n fillRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Adds a scaling transformation to the canvas units by x horizontally and by y vertically.\r\n * @param x Scaling factor in the horizontal direction. A negative value flips pixels across the vertical axis. A value of 1 results in no horizontal scaling.\r\n * @param y Scaling factor in the vertical direction. A negative value flips pixels across the horizontal axis. A value of 1 results in no vertical scaling.\r\n */\r\n scale(x: number, y: number): void;\r\n\r\n /**\r\n * Adds a rotation to the transformation matrix. The angle argument represents a clockwise rotation angle and is expressed in radians.\r\n * @param angle The rotation angle, clockwise in radians. You can use degree * Math.PI / 180 to calculate a radian from a degree.\r\n */\r\n rotate(angle: number): void;\r\n\r\n /**\r\n * Adds a translation transformation by moving the canvas and its origin x horizontally and y vertically on the grid.\r\n * @param x Distance to move in the horizontal direction. Positive values are to the right, and negative to the left.\r\n * @param y Distance to move in the vertical direction. Positive values are down, and negative are up.\r\n */\r\n translate(x: number, y: number): void;\r\n\r\n /**\r\n * Paints a rectangle which has a starting point at (x, y) and has a w width and an h height onto the canvas, using the current stroke style.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n strokeRect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Creates a path for a rectangle at position (x, y) with a size that is determined by width and height.\r\n * @param x The x-axis coordinate of the rectangle's starting point.\r\n * @param y The y-axis coordinate of the rectangle's starting point.\r\n * @param width The rectangle's width. Positive values are to the right, and negative to the left.\r\n * @param height The rectangle's height. Positive values are down, and negative are up.\r\n */\r\n rect(x: number, y: number, width: number, height: number): void;\r\n\r\n /**\r\n * Creates a clipping path from the current sub-paths. Everything drawn after clip() is called appears inside the clipping path only.\r\n */\r\n clip(): void;\r\n\r\n /**\r\n * Paints data from the given ImageData object onto the bitmap. If a dirty rectangle is provided, only the pixels from that rectangle are painted.\r\n * @param imageData An ImageData object containing the array of pixel values.\r\n * @param dx Horizontal position (x coordinate) at which to place the image data in the destination canvas.\r\n * @param dy Vertical position (y coordinate) at which to place the image data in the destination canvas.\r\n */\r\n putImageData(imageData: ImageData, dx: number, dy: number): void;\r\n\r\n /**\r\n * Adds a circular arc to the current path.\r\n * @param x The horizontal coordinate of the arc's center.\r\n * @param y The vertical coordinate of the arc's center.\r\n * @param radius The arc's radius. Must be positive.\r\n * @param startAngle The angle at which the arc starts in radians, measured from the positive x-axis.\r\n * @param endAngle The angle at which the arc ends in radians, measured from the positive x-axis.\r\n * @param anticlockwise An optional Boolean. If true, draws the arc counter-clockwise between the start and end angles. The default is false (clockwise).\r\n */\r\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\r\n\r\n /**\r\n * Starts a new path by emptying the list of sub-paths. Call this method when you want to create a new path.\r\n */\r\n beginPath(): void;\r\n\r\n /**\r\n * Causes the point of the pen to move back to the start of the current sub-path. It tries to draw a straight line from the current point to the start.\r\n * If the shape has already been closed or has only one point, this function does nothing.\r\n */\r\n closePath(): void;\r\n\r\n /**\r\n * Moves the starting point of a new sub-path to the (x, y) coordinates.\r\n * @param x The x-axis (horizontal) coordinate of the point.\r\n * @param y The y-axis (vertical) coordinate of the point.\r\n */\r\n moveTo(x: number, y: number): void;\r\n\r\n /**\r\n * Connects the last point in the current sub-path to the specified (x, y) coordinates with a straight line.\r\n * @param x The x-axis coordinate of the line's end point.\r\n * @param y The y-axis coordinate of the line's end point.\r\n */\r\n lineTo(x: number, y: number): void;\r\n\r\n /**\r\n * Adds a quadratic Bézier curve to the current path.\r\n * @param cpx The x-axis coordinate of the control point.\r\n * @param cpy The y-axis coordinate of the control point.\r\n * @param x The x-axis coordinate of the end point.\r\n * @param y The y-axis coordinate of the end point.\r\n */\r\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;\r\n\r\n /**\r\n * Returns a TextMetrics object.\r\n * @param text The text String to measure.\r\n * @returns ITextMetrics A ITextMetrics object.\r\n */\r\n measureText(text: string): ITextMetrics;\r\n\r\n /**\r\n * Strokes the current sub-paths with the current stroke style.\r\n */\r\n stroke(): void;\r\n\r\n /**\r\n * Fills the current sub-paths with the current fill style.\r\n */\r\n fill(): void;\r\n\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param sx The x-axis coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.\r\n * @param sy The y-axis coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.\r\n * @param sWidth The width of the sub-rectangle of the source image to draw into the destination context. If not specified, the entire rectangle from the coordinates specified by sx and sy to the bottom-right corner of the image is used.\r\n * @param sHeight The height of the sub-rectangle of the source image to draw into the destination context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dWidth The width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.\r\n * @param dHeight The height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.\r\n */\r\n\r\n drawImage(image: any, sx: number, sy: number, sWidth: number, sHeight: number, dx: number, dy: number, dWidth: number, dHeight: number): void;\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dWidth The width to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.\r\n * @param dHeight The height to draw the image in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.\r\n */\r\n drawImage(image: any, dx: number, dy: number, dWidth: number, dHeight: number): void;\r\n\r\n /**\r\n * Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.\r\n * @param image An element to draw into the context.\r\n * @param dx The x-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n * @param dy The y-axis coordinate in the destination canvas at which to place the top-left corner of the source image.\r\n */\r\n drawImage(image: any, dx: number, dy: number): void;\r\n\r\n /**\r\n * Returns an ImageData object representing the underlying pixel data for the area of the canvas denoted by the rectangle which starts at (sx, sy) and has an sw width and sh height.\r\n * @param sx The x-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted.\r\n * @param sy The y-axis coordinate of the top-left corner of the rectangle from which the ImageData will be extracted.\r\n * @param sw The width of the rectangle from which the ImageData will be extracted. Positive values are to the right, and negative to the left.\r\n * @param sh The height of the rectangle from which the ImageData will be extracted. Positive values are down, and negative are up.\r\n * @returns ImageData An ImageData object containing the image data for the rectangle of the canvas specified.\r\n */\r\n getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;\r\n\r\n /**\r\n * Sets the current line dash pattern.\r\n * @param segments An Array of numbers that specify distances to alternately draw a line and a gap (in coordinate space units).\r\n */\r\n setLineDash(segments: Array<number>): void;\r\n\r\n /**\r\n * Draws (fills) a given text at the given (x, y) position.\r\n * @param text A String specifying the text string to render into the context. The text is rendered using the settings specified by font, textAlign, textBaseline, and direction.\r\n * @param x The x-axis coordinate of the point at which to begin drawing the text, in pixels.\r\n * @param y The y-axis coordinate of the baseline on which to begin drawing the text, in pixels.\r\n * @param maxWidth The maximum number of pixels wide the text may be once rendered. If not specified, there is no limit to the width of the text.\r\n */\r\n fillText(text: string, x: number, y: number, maxWidth?: number): void;\r\n\r\n /**\r\n * Draws (strokes) a given text at the given (x, y) position.\r\n * @param text A String specifying the text string to render into the context. The text is rendered using the settings specified by font, textAlign, textBaseline, and direction.\r\n * @param x The x-axis coordinate of the point at which to begin drawing the text, in pixels.\r\n * @param y The y-axis coordinate of the baseline on which to begin drawing the text, in pixels.\r\n * @param maxWidth The maximum number of pixels wide the text may be once rendered. If not specified, there is no limit to the width of the text.\r\n */\r\n strokeText(text: string, x: number, y: number, maxWidth?: number): void;\r\n\r\n /**\r\n * Creates a linear gradient along the line given by the coordinates represented by the parameters.\r\n * @param x0 The x-axis coordinate of the start point.\r\n * @param y0 The y-axis coordinate of the start point.\r\n * @param x1 The x-axis coordinate of the end point.\r\n * @param y1 The y-axis coordinate of the end point.\r\n * @returns ICanvasGradient A linear ICanvasGradient initialized with the specified line.\r\n */\r\n createLinearGradient(x0: number, y0: number, x1: number, y1: number): ICanvasGradient;\r\n\r\n /**\r\n * Creates a linear gradient along the line given by the coordinates represented by the parameters.\r\n * @param x0 The x-axis coordinate of the start circle.\r\n * @param y0 The y-axis coordinate of the start circle.\r\n * @param r0 The radius of the start circle. Must be non-negative and finite.\r\n * @param x1 The x-axis coordinate of the end point.\r\n * @param y1 The y-axis coordinate of the end point.\r\n * @param r1 The radius of the end circle. Must be non-negative and finite.\r\n * @returns ICanvasGradient A linear ICanvasGradient initialized with the two specified circles.\r\n */\r\n createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): ICanvasGradient;\r\n\r\n /**\r\n * Resets the current transform to matrix composed with a, b, c, d, e, f.\r\n * @param a Horizontal scaling. A value of 1 results in no scaling.\r\n * @param b Vertical skewing.\r\n * @param c Horizontal skewing.\r\n * @param d Vertical scaling. A value of 1 results in no scaling.\r\n * @param e Horizontal translation (moving).\r\n * @param f Vertical translation (moving).\r\n */\r\n setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void;\r\n\r\n /**\r\n * Retrieves the current transformation matrix being applied to the context.\r\n */\r\n getTransform(): DOMMatrix;\r\n}\r\n"]}