camera.d.ts 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. import { SmartArray } from "../Misc/smartArray";
  2. import { Observable } from "../Misc/observable";
  3. import type { DeepImmutable, Nullable } from "../types";
  4. import type { CameraInputsManager } from "./cameraInputsManager";
  5. import type { Scene } from "../scene";
  6. import { Matrix, Vector3, Quaternion } from "../Maths/math.vector";
  7. import { Node } from "../node";
  8. import type { Mesh } from "../Meshes/mesh";
  9. import type { AbstractMesh } from "../Meshes/abstractMesh";
  10. import type { ICullable } from "../Culling/boundingInfo";
  11. import { Viewport } from "../Maths/math.viewport";
  12. import type { PostProcess } from "../PostProcesses/postProcess";
  13. import type { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture";
  14. import type { FreeCamera } from "./freeCamera";
  15. import type { Ray } from "../Culling/ray";
  16. /**
  17. * Oblique projection values
  18. */
  19. export interface IObliqueParams {
  20. /** The angle of the plane */
  21. angle: number;
  22. /** The length of the plane */
  23. length: number;
  24. /** The offset of the plane */
  25. offset: number;
  26. }
  27. /**
  28. * This is the base class of all the camera used in the application.
  29. * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
  30. */
  31. export declare class Camera extends Node {
  32. /**
  33. * @internal
  34. */
  35. static _CreateDefaultParsedCamera: (name: string, scene: Scene) => Camera;
  36. /**
  37. * This is the default projection mode used by the cameras.
  38. * It helps recreating a feeling of perspective and better appreciate depth.
  39. * This is the best way to simulate real life cameras.
  40. */
  41. static readonly PERSPECTIVE_CAMERA = 0;
  42. /**
  43. * This helps creating camera with an orthographic mode.
  44. * 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.
  45. */
  46. static readonly ORTHOGRAPHIC_CAMERA = 1;
  47. /**
  48. * This is the default FOV mode for perspective cameras.
  49. * This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.
  50. */
  51. static readonly FOVMODE_VERTICAL_FIXED = 0;
  52. /**
  53. * This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.
  54. */
  55. static readonly FOVMODE_HORIZONTAL_FIXED = 1;
  56. /**
  57. * This specifies there is no need for a camera rig.
  58. * Basically only one eye is rendered corresponding to the camera.
  59. */
  60. static readonly RIG_MODE_NONE = 0;
  61. /**
  62. * Simulates a camera Rig with one blue eye and one red eye.
  63. * This can be use with 3d blue and red glasses.
  64. */
  65. static readonly RIG_MODE_STEREOSCOPIC_ANAGLYPH = 10;
  66. /**
  67. * Defines that both eyes of the camera will be rendered side by side with a parallel target.
  68. */
  69. static readonly RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL = 11;
  70. /**
  71. * Defines that both eyes of the camera will be rendered side by side with a none parallel target.
  72. */
  73. static readonly RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED = 12;
  74. /**
  75. * Defines that both eyes of the camera will be rendered over under each other.
  76. */
  77. static readonly RIG_MODE_STEREOSCOPIC_OVERUNDER = 13;
  78. /**
  79. * Defines that both eyes of the camera will be rendered on successive lines interlaced for passive 3d monitors.
  80. */
  81. static readonly RIG_MODE_STEREOSCOPIC_INTERLACED = 14;
  82. /**
  83. * Defines that both eyes of the camera should be renderered in a VR mode (carbox).
  84. */
  85. static readonly RIG_MODE_VR = 20;
  86. /**
  87. * Custom rig mode allowing rig cameras to be populated manually with any number of cameras
  88. */
  89. static readonly RIG_MODE_CUSTOM = 22;
  90. /**
  91. * Defines if by default attaching controls should prevent the default javascript event to continue.
  92. */
  93. static ForceAttachControlToAlwaysPreventDefault: boolean;
  94. /**
  95. * Define the input manager associated with the camera.
  96. */
  97. inputs: CameraInputsManager<Camera>;
  98. /** @internal */
  99. _position: Vector3;
  100. /**
  101. * Define the current local position of the camera in the scene
  102. */
  103. get position(): Vector3;
  104. set position(newPosition: Vector3);
  105. protected _upVector: Vector3;
  106. /**
  107. * The vector the camera should consider as up.
  108. * (default is Vector3(0, 1, 0) aka Vector3.Up())
  109. */
  110. set upVector(vec: Vector3);
  111. get upVector(): Vector3;
  112. /**
  113. * Object containing oblique projection values (only used with ORTHOGRAPHIC_CAMERA)
  114. */
  115. oblique: Nullable<IObliqueParams>;
  116. /**
  117. * The screen area in scene units squared
  118. */
  119. get screenArea(): number;
  120. private _orthoLeft;
  121. /**
  122. * Define the current limit on the left side for an orthographic camera
  123. * In scene unit
  124. */
  125. set orthoLeft(value: Nullable<number>);
  126. get orthoLeft(): Nullable<number>;
  127. private _orthoRight;
  128. /**
  129. * Define the current limit on the right side for an orthographic camera
  130. * In scene unit
  131. */
  132. set orthoRight(value: Nullable<number>);
  133. get orthoRight(): Nullable<number>;
  134. private _orthoBottom;
  135. /**
  136. * Define the current limit on the bottom side for an orthographic camera
  137. * In scene unit
  138. */
  139. set orthoBottom(value: Nullable<number>);
  140. get orthoBottom(): Nullable<number>;
  141. private _orthoTop;
  142. /**
  143. * Define the current limit on the top side for an orthographic camera
  144. * In scene unit
  145. */
  146. set orthoTop(value: Nullable<number>);
  147. get orthoTop(): Nullable<number>;
  148. /**
  149. * Field Of View is set in Radians. (default is 0.8)
  150. */
  151. fov: number;
  152. /**
  153. * Projection plane tilt around the X axis (horizontal), set in Radians. (default is 0)
  154. * Can be used to make vertical lines in world space actually vertical on the screen.
  155. * See https://forum.babylonjs.com/t/add-vertical-shift-to-3ds-max-exporter-babylon-cameras/17480
  156. */
  157. projectionPlaneTilt: number;
  158. /**
  159. * Define the minimum distance the camera can see from.
  160. * This is important to note that the depth buffer are not infinite and the closer it starts
  161. * the more your scene might encounter depth fighting issue.
  162. */
  163. minZ: number;
  164. /**
  165. * Define the maximum distance the camera can see to.
  166. * This is important to note that the depth buffer are not infinite and the further it end
  167. * the more your scene might encounter depth fighting issue.
  168. */
  169. maxZ: number;
  170. /**
  171. * Define the default inertia of the camera.
  172. * This helps giving a smooth feeling to the camera movement.
  173. */
  174. inertia: number;
  175. private _mode;
  176. /**
  177. * Define the mode of the camera (Camera.PERSPECTIVE_CAMERA or Camera.ORTHOGRAPHIC_CAMERA)
  178. */
  179. set mode(mode: number);
  180. get mode(): number;
  181. /**
  182. * Define whether the camera is intermediate.
  183. * This is useful to not present the output directly to the screen in case of rig without post process for instance
  184. */
  185. isIntermediate: boolean;
  186. /**
  187. * Define the viewport of the camera.
  188. * This correspond to the portion of the screen the camera will render to in normalized 0 to 1 unit.
  189. */
  190. viewport: Viewport;
  191. /**
  192. * Restricts the camera to viewing objects with the same layerMask.
  193. * A camera with a layerMask of 1 will render mesh.layerMask & camera.layerMask!== 0
  194. */
  195. layerMask: number;
  196. /**
  197. * fovMode sets the camera frustum bounds to the viewport bounds. (default is FOVMODE_VERTICAL_FIXED)
  198. */
  199. fovMode: number;
  200. /**
  201. * Rig mode of the camera.
  202. * This is useful to create the camera with two "eyes" instead of one to create VR or stereoscopic scenes.
  203. * This is normally controlled byt the camera themselves as internal use.
  204. */
  205. cameraRigMode: number;
  206. /**
  207. * Defines the distance between both "eyes" in case of a RIG
  208. */
  209. interaxialDistance: number;
  210. /**
  211. * Defines if stereoscopic rendering is done side by side or over under.
  212. */
  213. isStereoscopicSideBySide: boolean;
  214. /**
  215. * 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
  216. * This is pretty helpful if you wish to make a camera render to a texture you could reuse somewhere
  217. * else in the scene. (Eg. security camera)
  218. *
  219. * 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)
  220. */
  221. customRenderTargets: RenderTargetTexture[];
  222. /**
  223. * When set, the camera will render to this render target instead of the default canvas
  224. *
  225. * If the desire is to use the output of a camera as a texture in the scene consider using camera.customRenderTargets instead
  226. */
  227. outputRenderTarget: Nullable<RenderTargetTexture>;
  228. /**
  229. * Observable triggered when the camera view matrix has changed.
  230. */
  231. onViewMatrixChangedObservable: Observable<Camera>;
  232. /**
  233. * Observable triggered when the camera Projection matrix has changed.
  234. */
  235. onProjectionMatrixChangedObservable: Observable<Camera>;
  236. /**
  237. * Observable triggered when the inputs have been processed.
  238. */
  239. onAfterCheckInputsObservable: Observable<Camera>;
  240. /**
  241. * Observable triggered when reset has been called and applied to the camera.
  242. */
  243. onRestoreStateObservable: Observable<Camera>;
  244. /**
  245. * Is this camera a part of a rig system?
  246. */
  247. isRigCamera: boolean;
  248. /**
  249. * If isRigCamera set to true this will be set with the parent camera.
  250. * The parent camera is not (!) necessarily the .parent of this camera (like in the case of XR)
  251. */
  252. rigParent?: Camera;
  253. /**
  254. * Render pass id used by the camera to render into the main framebuffer
  255. */
  256. renderPassId: number;
  257. private _hasMoved;
  258. /**
  259. * Gets a flag indicating that the camera has moved in some way since the last call to Camera.update()
  260. */
  261. get hasMoved(): boolean;
  262. /** @internal */
  263. _cameraRigParams: any;
  264. /** @internal */
  265. _rigCameras: Camera[];
  266. /** @internal */
  267. _rigPostProcess: Nullable<PostProcess>;
  268. /** @internal */
  269. _skipRendering: boolean;
  270. /** @internal */
  271. _projectionMatrix: Matrix;
  272. /** @internal */
  273. _postProcesses: Nullable<PostProcess>[];
  274. /** @internal */
  275. _activeMeshes: SmartArray<AbstractMesh>;
  276. protected _globalPosition: Vector3;
  277. /** @internal */
  278. _computedViewMatrix: Matrix;
  279. private _doNotComputeProjectionMatrix;
  280. private _transformMatrix;
  281. private _frustumPlanes;
  282. private _refreshFrustumPlanes;
  283. private _storedFov;
  284. private _stateStored;
  285. private _absoluteRotation;
  286. /**
  287. * Instantiates a new camera object.
  288. * This should not be used directly but through the inherited cameras: ArcRotate, Free...
  289. * @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
  290. * @param name Defines the name of the camera in the scene
  291. * @param position Defines the position of the camera
  292. * @param scene Defines the scene the camera belongs too
  293. * @param setActiveOnSceneIfNoneActive Defines if the camera should be set as active after creation if no other camera have been defined in the scene
  294. */
  295. constructor(name: string, position: Vector3, scene?: Scene, setActiveOnSceneIfNoneActive?: boolean);
  296. /**
  297. * Store current camera state (fov, position, etc..)
  298. * @returns the camera
  299. */
  300. storeState(): Camera;
  301. /**
  302. * Restores the camera state values if it has been stored. You must call storeState() first
  303. * @returns true if restored and false otherwise
  304. */
  305. protected _restoreStateValues(): boolean;
  306. /**
  307. * Restored camera state. You must call storeState() first.
  308. * @returns true if restored and false otherwise
  309. */
  310. restoreState(): boolean;
  311. /**
  312. * Gets the class name of the camera.
  313. * @returns the class name
  314. */
  315. getClassName(): string;
  316. /** @internal */
  317. readonly _isCamera = true;
  318. /**
  319. * Gets a string representation of the camera useful for debug purpose.
  320. * @param fullDetails Defines that a more verbose level of logging is required
  321. * @returns the string representation
  322. */
  323. toString(fullDetails?: boolean): string;
  324. /**
  325. * Automatically tilts the projection plane, using `projectionPlaneTilt`, to correct the perspective effect on vertical lines.
  326. */
  327. applyVerticalCorrection(): void;
  328. /**
  329. * Gets the current world space position of the camera.
  330. */
  331. get globalPosition(): Vector3;
  332. /**
  333. * Gets the list of active meshes this frame (meshes no culled or excluded by lod s in the frame)
  334. * @returns the active meshe list
  335. */
  336. getActiveMeshes(): SmartArray<AbstractMesh>;
  337. /**
  338. * Check whether a mesh is part of the current active mesh list of the camera
  339. * @param mesh Defines the mesh to check
  340. * @returns true if active, false otherwise
  341. */
  342. isActiveMesh(mesh: Mesh): boolean;
  343. /**
  344. * Is this camera ready to be used/rendered
  345. * @param completeCheck defines if a complete check (including post processes) has to be done (false by default)
  346. * @returns true if the camera is ready
  347. */
  348. isReady(completeCheck?: boolean): boolean;
  349. /** @internal */
  350. _initCache(): void;
  351. /**
  352. * @internal
  353. */
  354. _updateCache(ignoreParentClass?: boolean): void;
  355. /** @internal */
  356. _isSynchronized(): boolean;
  357. /** @internal */
  358. _isSynchronizedViewMatrix(): boolean;
  359. /** @internal */
  360. _isSynchronizedProjectionMatrix(): boolean;
  361. /**
  362. * Attach the input controls to a specific dom element to get the input from.
  363. * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
  364. */
  365. attachControl(noPreventDefault?: boolean): void;
  366. /**
  367. * Attach the input controls to a specific dom element to get the input from.
  368. * @param ignored defines an ignored parameter kept for backward compatibility.
  369. * @param noPreventDefault Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
  370. * BACK COMPAT SIGNATURE ONLY.
  371. */
  372. attachControl(ignored: any, noPreventDefault?: boolean): void;
  373. /**
  374. * Detach the current controls from the specified dom element.
  375. */
  376. detachControl(): void;
  377. /**
  378. * Detach the current controls from the specified dom element.
  379. * @param ignored defines an ignored parameter kept for backward compatibility.
  380. */
  381. detachControl(ignored?: any): void;
  382. /**
  383. * Update the camera state according to the different inputs gathered during the frame.
  384. */
  385. update(): void;
  386. /** @internal */
  387. _checkInputs(): void;
  388. /** @internal */
  389. get rigCameras(): Camera[];
  390. /**
  391. * Gets the post process used by the rig cameras
  392. */
  393. get rigPostProcess(): Nullable<PostProcess>;
  394. /**
  395. * Internal, gets the first post process.
  396. * @returns the first post process to be run on this camera.
  397. */
  398. _getFirstPostProcess(): Nullable<PostProcess>;
  399. private _cascadePostProcessesToRigCams;
  400. /**
  401. * Attach a post process to the camera.
  402. * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess
  403. * @param postProcess The post process to attach to the camera
  404. * @param insertAt The position of the post process in case several of them are in use in the scene
  405. * @returns the position the post process has been inserted at
  406. */
  407. attachPostProcess(postProcess: PostProcess, insertAt?: Nullable<number>): number;
  408. /**
  409. * Detach a post process to the camera.
  410. * @see https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess
  411. * @param postProcess The post process to detach from the camera
  412. */
  413. detachPostProcess(postProcess: PostProcess): void;
  414. /**
  415. * Gets the current world matrix of the camera
  416. * @returns the world matrix
  417. */
  418. getWorldMatrix(): Matrix;
  419. /** @internal */
  420. _getViewMatrix(): Matrix;
  421. /**
  422. * Gets the current view matrix of the camera.
  423. * @param force forces the camera to recompute the matrix without looking at the cached state
  424. * @returns the view matrix
  425. */
  426. getViewMatrix(force?: boolean): Matrix;
  427. /**
  428. * Freeze the projection matrix.
  429. * It will prevent the cache check of the camera projection compute and can speed up perf
  430. * if no parameter of the camera are meant to change
  431. * @param projection Defines manually a projection if necessary
  432. */
  433. freezeProjectionMatrix(projection?: Matrix): void;
  434. /**
  435. * Unfreeze the projection matrix if it has previously been freezed by freezeProjectionMatrix.
  436. */
  437. unfreezeProjectionMatrix(): void;
  438. /**
  439. * Gets the current projection matrix of the camera.
  440. * @param force forces the camera to recompute the matrix without looking at the cached state
  441. * @returns the projection matrix
  442. */
  443. getProjectionMatrix(force?: boolean): Matrix;
  444. /**
  445. * Gets the transformation matrix (ie. the multiplication of view by projection matrices)
  446. * @returns a Matrix
  447. */
  448. getTransformationMatrix(): Matrix;
  449. private _computeObliqueDistance;
  450. private _updateFrustumPlanes;
  451. /**
  452. * Checks if a cullable object (mesh...) is in the camera frustum
  453. * This checks the bounding box center. See isCompletelyInFrustum for a full bounding check
  454. * @param target The object to check
  455. * @param checkRigCameras If the rig cameras should be checked (eg. with VR camera both eyes should be checked) (Default: false)
  456. * @returns true if the object is in frustum otherwise false
  457. */
  458. isInFrustum(target: ICullable, checkRigCameras?: boolean): boolean;
  459. /**
  460. * Checks if a cullable object (mesh...) is in the camera frustum
  461. * Unlike isInFrustum this checks the full bounding box
  462. * @param target The object to check
  463. * @returns true if the object is in frustum otherwise false
  464. */
  465. isCompletelyInFrustum(target: ICullable): boolean;
  466. /**
  467. * Gets a ray in the forward direction from the camera.
  468. * @param length Defines the length of the ray to create
  469. * @param transform Defines the transform to apply to the ray, by default the world matrix is used to create a workd space ray
  470. * @param origin Defines the start point of the ray which defaults to the camera position
  471. * @returns the forward ray
  472. */
  473. getForwardRay(length?: number, transform?: Matrix, origin?: Vector3): Ray;
  474. /**
  475. * Gets a ray in the forward direction from the camera.
  476. * @param refRay the ray to (re)use when setting the values
  477. * @param length Defines the length of the ray to create
  478. * @param transform Defines the transform to apply to the ray, by default the world matrx is used to create a workd space ray
  479. * @param origin Defines the start point of the ray which defaults to the camera position
  480. * @returns the forward ray
  481. */
  482. getForwardRayToRef(refRay: Ray, length?: number, transform?: Matrix, origin?: Vector3): Ray;
  483. /**
  484. * Releases resources associated with this node.
  485. * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
  486. * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
  487. */
  488. dispose(doNotRecurse?: boolean, disposeMaterialAndTextures?: boolean): void;
  489. /** @internal */
  490. _isLeftCamera: boolean;
  491. /**
  492. * Gets the left camera of a rig setup in case of Rigged Camera
  493. */
  494. get isLeftCamera(): boolean;
  495. /** @internal */
  496. _isRightCamera: boolean;
  497. /**
  498. * Gets the right camera of a rig setup in case of Rigged Camera
  499. */
  500. get isRightCamera(): boolean;
  501. /**
  502. * Gets the left camera of a rig setup in case of Rigged Camera
  503. */
  504. get leftCamera(): Nullable<FreeCamera>;
  505. /**
  506. * Gets the right camera of a rig setup in case of Rigged Camera
  507. */
  508. get rightCamera(): Nullable<FreeCamera>;
  509. /**
  510. * Gets the left camera target of a rig setup in case of Rigged Camera
  511. * @returns the target position
  512. */
  513. getLeftTarget(): Nullable<Vector3>;
  514. /**
  515. * Gets the right camera target of a rig setup in case of Rigged Camera
  516. * @returns the target position
  517. */
  518. getRightTarget(): Nullable<Vector3>;
  519. /**
  520. * @internal
  521. */
  522. setCameraRigMode(mode: number, rigParams: any): void;
  523. protected _setRigMode(rigParams: any): void;
  524. /** @internal */
  525. _getVRProjectionMatrix(): Matrix;
  526. /**
  527. * @internal
  528. */
  529. setCameraRigParameter(name: string, value: any): void;
  530. /**
  531. * needs to be overridden by children so sub has required properties to be copied
  532. * @internal
  533. */
  534. createRigCamera(name: string, cameraIndex: number): Nullable<Camera>;
  535. /**
  536. * May need to be overridden by children
  537. * @internal
  538. */
  539. _updateRigCameras(): void;
  540. /** @internal */
  541. _setupInputs(): void;
  542. /**
  543. * Serialiaze the camera setup to a json representation
  544. * @returns the JSON representation
  545. */
  546. serialize(): any;
  547. /**
  548. * Clones the current camera.
  549. * @param name The cloned camera name
  550. * @param newParent The cloned camera's new parent (none by default)
  551. * @returns the cloned camera
  552. */
  553. clone(name: string, newParent?: Nullable<Node>): Camera;
  554. /**
  555. * Gets the direction of the camera relative to a given local axis.
  556. * @param localAxis Defines the reference axis to provide a relative direction.
  557. * @returns the direction
  558. */
  559. getDirection(localAxis: DeepImmutable<Vector3>): Vector3;
  560. /**
  561. * Returns the current camera absolute rotation
  562. */
  563. get absoluteRotation(): Quaternion;
  564. /**
  565. * Gets the direction of the camera relative to a given local axis into a passed vector.
  566. * @param localAxis Defines the reference axis to provide a relative direction.
  567. * @param result Defines the vector to store the result in
  568. */
  569. getDirectionToRef(localAxis: DeepImmutable<Vector3>, result: Vector3): void;
  570. /**
  571. * Gets a camera constructor for a given camera type
  572. * @param type The type of the camera to construct (should be equal to one of the camera class name)
  573. * @param name The name of the camera the result will be able to instantiate
  574. * @param scene The scene the result will construct the camera in
  575. * @param interaxial_distance In case of stereoscopic setup, the distance between both eyes
  576. * @param isStereoscopicSideBySide In case of stereoscopic setup, should the sereo be side b side
  577. * @returns a factory method to construct the camera
  578. */
  579. static GetConstructorFromName(type: string, name: string, scene: Scene, interaxial_distance?: number, isStereoscopicSideBySide?: boolean): () => Camera;
  580. /**
  581. * Compute the world matrix of the camera.
  582. * @returns the camera world matrix
  583. */
  584. computeWorldMatrix(): Matrix;
  585. /**
  586. * Parse a JSON and creates the camera from the parsed information
  587. * @param parsedCamera The JSON to parse
  588. * @param scene The scene to instantiate the camera in
  589. * @returns the newly constructed camera
  590. */
  591. static Parse(parsedCamera: any, scene: Scene): Camera;
  592. /** @internal */
  593. _calculateHandednessMultiplier(): number;
  594. }