API

Class ArcRotateCamera

This represents an orbital type of camera.

This camera always points towards a given target position and can be rotated around that target with the target as the centre of rotation. It can be controlled with cursors and mouse, or with touch events. Think of this camera as one orbiting its target position, or more imaginatively as a spy satellite orbiting the earth. Its position relative to the target (earth) can be set by three parameters, alpha (radians) the longitudinal rotation, beta (radians) the latitudinal rotation and radius the distance from the target position.

Hierarchy (View Summary)

Index
  • Instantiates a new ArcRotateCamera in a given scene

    Parameters

    • name: string

      Defines the name of the camera

    • alpha: number

      Defines the camera rotation along the longitudinal axis

    • beta: number

      Defines the camera rotation along the latitudinal axis

    • radius: number

      Defines the camera distance from its target

    • target: Vector3

      Defines the camera target

    • Optionalscene: Scene

      Defines the scene the camera belongs to

    • setActiveOnSceneIfNoneActive: boolean = true

      Defines whether the camera should be marked as active if not other active cameras have been defined

    Returns ArcRotateCamera

allowUpsideDown: boolean = true

Allows the camera to be completely reversed. If false the camera can not arrive upside down.

alpha: number

Defines the rotation angle of the camera along the longitudinal axis.

animations: Animation[] = []

Gets a list of Animations associated with the node

beta: number

Defines the rotation angle of the camera along the latitudinal axis.

cameraDirection: Vector3 = ...

Define the current direction the camera is moving to

cameraRigMode: number = Camera.RIG_MODE_NONE

Rig mode of the camera. This is useful to create the camera with two "eyes" instead of one to create VR or stereoscopic scenes. This is normally controlled byt the camera themselves as internal use.

cameraRotation: Vector2 = ...

Define the current rotation the camera is rotating to

checkCollisions: boolean = false

Defines whether the camera should check collision with the objects oh the scene.

collisionRadius: Vector3 = ...

Defines the collision radius of the camera. This simulates a sphere around the camera.

customRenderTargets: RenderTargetTexture[] = []

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 This is pretty helpful if you wish to make a camera render to a texture you could reuse somewhere else in the scene. (Eg. security camera)

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)

fov: number = 0.8

Field Of View is set in Radians. (default is 0.8)

fovMode: number = Camera.FOVMODE_VERTICAL_FIXED

fovMode sets the camera frustum bounds to the viewport bounds. (default is FOVMODE_VERTICAL_FIXED)

id: string

Gets or sets the id of the node

ignoreCameraMaxZ: boolean = false

Ignores camera maxZ when computing the projection matrix (ie. use 0 instead of maxZ), meaning objects won't be culled by the far plane

inertialPanningX: number = 0

Defines the current inertia value used during panning of the camera along the X axis.

inertialPanningY: number = 0

Defines the current inertia value used during panning of the camera along the Y axis.

Defines the input associated to the camera.

inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)

interaxialDistance: number

Defines the distance between both "eyes" in case of a RIG

inverseRotationSpeed: number = 0.2

Speed multiplier for inverse camera panning

invertRotation: boolean = false

Reverses mouselook direction to 'natural' panning as opposed to traditional direct panning

isIntermediate: boolean = false

Define whether the camera is intermediate. This is useful to not present the output directly to the screen in case of rig without post process for instance

isRigCamera: boolean = false

Is this camera a part of a rig system?

isStereoscopicSideBySide: boolean

Defines if stereoscopic rendering is done side by side or over under.

layerMask: number = 0x0fffffff

Restricts the camera to viewing objects with the same layerMask. A camera with a layerMask of 1 will render mesh.layerMask & camera.layerMask!== 0

lockedTarget: any = null

Define the current target of the camera as an object or a position. Please note that locking a target will disable panning.

lowerAlphaLimit: Nullable<number> = null

Minimum allowed angle on the longitudinal axis. This can help limiting how the Camera is able to move in the scene.

lowerBetaLimit: Nullable<number> = 0.01

Minimum allowed angle on the latitudinal axis. This can help limiting how the Camera is able to move in the scene.

lowerRadiusLimit: Nullable<number> = null

Minimum allowed distance of the camera to the target (The camera can not get closer). This can help limiting how the Camera is able to move in the scene.

lowerTargetYLimit: number = -Infinity

Minimum allowed vertical target position of the camera. Use this setting in combination with upperRadiusLimit to set a global limit for the Cameras vertical position.

mapPanning: boolean = false

Defines if camera will eliminate transform on y axis.

maxZ: number = 10000.0

Define the maximum distance the camera can see to. (default is 10000) This is important to note that the depth buffer are not infinite and the further it end the more your scene might encounter depth fighting issue.

metadata: any = null

Gets or sets an object used to store user defined information for the node

minZ: number = 1

Define the minimum distance the camera can see from. This is important to note that the depth buffer are not infinite and the closer it starts the more your scene might encounter depth fighting issue.

Movement controller that provides framerate-independent physics and the declarative inputMap for configuring which inputs map to which camera behaviors.

See InputMapper for the full inputMap API (e.g. setInteraction, getEntry, addEntry).

name: string

Gets or sets the name of the node

noRotationConstraint: boolean = false

Add constraint to the camera to prevent it to move freely in all directions and around all axis.

oblique: Nullable<IObliqueParams> = null

Object containing oblique projection values (only used with ORTHOGRAPHIC_CAMERA)

onAccessibilityTagChangedObservable: Observable<Nullable<IAccessibilityTag>> = ...

Observable fired when an accessibility tag is changed

onAfterCheckInputsObservable: Observable<Camera> = ...

Observable triggered when the inputs have been processed.

onCollide: (collidedMesh: AbstractMesh) => void

Event raised when the camera is colliding with a mesh.

onDisposeObservable: Observable<Node> = ...

An event triggered when the mesh is disposed

onMeshTargetChangedObservable: Observable<any> = ...

Observable triggered when the transform node target has been changed on the camera.

onProjectionMatrixChangedObservable: Observable<Camera> = ...

Observable triggered when the camera Projection matrix has changed.

onReady: Nullable<(node: Node) => void> = null

Callback raised when the node is ready to be used

onRestoreStateObservable: Observable<Camera> = ...

Observable triggered when reset has been called and applied to the camera.

onViewMatrixChangedObservable: Observable<Camera> = ...

Observable triggered when the camera view matrix has changed. Beware of reentrance! Some methods like Camera.getViewMatrix and Camera.getWorldMatrix can trigger the onViewMatrixChangedObservable observable, so using them inside an observer will require additional logic to avoid a stack overflow error.

outputRenderTarget: Nullable<RenderTargetTexture> = null

When set, the camera will render to this render target instead of the default canvas

If the desire is to use the output of a camera as a texture in the scene consider using camera.customRenderTargets instead

overrideCloneAlphaBetaRadius: Nullable<boolean>

Defines an override value to use as the parameter to setTarget. This allows the parameter to be specified when animating the target (e.g. using FramingBehavior).

panningAxis: Vector3 = ...

Defines the allowed panning axis.

panningDistanceLimit: Nullable<number> = null

Defines the maximum distance the camera can pan. This could help keeping the camera always in your scene.

panningOriginTarget: Vector3 = ...

Defines the target of the camera before panning.

pinchToPanMaxDistance: number = 20

Defines the distance used to consider the camera in pan mode vs pinch/zoom. Basically if your fingers moves away from more than this distance you will be considered in pinch mode.

projectionPlaneTilt: number = 0

Projection plane tilt around the X axis (horizontal), set in Radians. (default is 0) Can be used to make vertical lines in world space actually vertical on the screen. See https://forum.babylonjs.com/t/add-vertical-shift-to-3ds-max-exporter-babylon-cameras/17480

radius: number

Defines the radius of the camera from its target point.

renderPassId: number

Render pass id used by the camera to render into the main framebuffer

reservedDataStore: any = null

For internal use only. Please do not use.

restoreStateInterpolationFactor: number = 0

Factor for restoring information interpolation. default is 0 = off. Any value < 0 or > 1 will disable interpolation.

rigParent?: Camera

If isRigCamera set to true this will be set with the parent camera. The parent camera is not (!) necessarily the .parent of this camera (like in the case of XR)

rotation: Vector3

Define the current rotation of the camera

rotationQuaternion: Nullable<Quaternion>

Define the current rotation of the camera as a quaternion to prevent Gimbal lock

speed: number = 2.0

Define the current speed of the camera

state: string = ""

Gets or sets a string used to store user defined state for the node

targetScreenOffset: Vector2 = ...

Defines a screen offset for the camera position.

uniqueId: number

Gets or sets the unique id of the node

updateUpVectorFromRotation: boolean = false

When set, the up vector of the camera will be updated by the rotation of the camera

upperAlphaLimit: Nullable<number> = null

Maximum allowed angle on the longitudinal axis. This can help limiting how the Camera is able to move in the scene.

upperBetaLimit: Nullable<number> = ...

Maximum allowed angle on the latitudinal axis. This can help limiting how the Camera is able to move in the scene.

upperRadiusLimit: Nullable<number> = null

Maximum allowed distance of the camera to the target (The camera can not get further). This can help limiting how the Camera is able to move in the scene.

useInputToRestoreState: boolean = true

Define if double tap/click is used to restore the previously saved state of the camera.

viewport: Viewport = ...

Define the viewport of the camera. This correspond to the portion of the screen the camera will render to in normalized 0 to 1 unit.

zoomOnFactor: number = 1

Defines how much the radius should be scaled while zooming on a particular mesh (through the zoomOn function)

ForceAttachControlToAlwaysPreventDefault: boolean = false

Defines if by default attaching controls should prevent the default javascript event to continue.

FOVMODE_HORIZONTAL_FIXED: 1 = Constants.FOVMODE_HORIZONTAL_FIXED

This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.

FOVMODE_VERTICAL_FIXED: 0 = Constants.FOVMODE_VERTICAL_FIXED

This is the default FOV mode for perspective cameras. This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.

ORTHOGRAPHIC_CAMERA: 1 = Constants.ORTHOGRAPHIC_CAMERA

This helps creating camera with an orthographic mode. 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.

PERSPECTIVE_CAMERA: 0 = Constants.PERSPECTIVE_CAMERA

This is the default projection mode used by the cameras. It helps recreating a feeling of perspective and better appreciate depth. This is the best way to simulate real life cameras.

RIG_MODE_CUSTOM: 22 = Constants.RIG_MODE_CUSTOM

Custom rig mode allowing rig cameras to be populated manually with any number of cameras

RIG_MODE_NONE: 0 = Constants.RIG_MODE_NONE

This specifies there is no need for a camera rig. Basically only one eye is rendered corresponding to the camera.

RIG_MODE_STEREOSCOPIC_ANAGLYPH: 10 = Constants.RIG_MODE_STEREOSCOPIC_ANAGLYPH

Simulates a camera Rig with one blue eye and one red eye. This can be use with 3d blue and red glasses.

RIG_MODE_STEREOSCOPIC_INTERLACED: 14 = Constants.RIG_MODE_STEREOSCOPIC_INTERLACED

Defines that both eyes of the camera will be rendered on successive lines interlaced for passive 3d monitors.

RIG_MODE_STEREOSCOPIC_OVERUNDER: 13 = Constants.RIG_MODE_STEREOSCOPIC_OVERUNDER

Defines that both eyes of the camera will be rendered over under each other.

RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: 12 = Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED

Defines that both eyes of the camera will be rendered side by side with a none parallel target.

RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: 11 = Constants.RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL

Defines that both eyes of the camera will be rendered side by side with a parallel target.

RIG_MODE_VR: 20 = Constants.RIG_MODE_VR

Defines that both eyes of the camera should be renderered in a VR mode (carbox).

  • get doNotSerialize(): boolean

    Gets or sets a boolean used to define if the node must be serialized

    Returns boolean

  • set doNotSerialize(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get inertia(): number

    Defines the rotation/zoom inertia (decay coefficient applied per reference frame at 60fps). Override of Camera.inertia that automatically syncs to the movement system (rotation and zoom). Panning inertia is controlled separately via panningInertia.

    Returns number

  • set inertia(value: number): void

    Defines the inertia (decay coefficient applied per reference frame at 60fps) of the camera. This helps giving a smooth feeling to the camera movement.

    Override of Camera.inertia that writes through to the movement system so the framerate-independent pan/rotation glide stays in sync. Setting this updates the movement system immediately (matching the accessor convergence used by ArcRotateCamera).

    Backed by a local field rather than super.inertia: the shipped UMD bundle is compiled with TypeScript at target: ES5, and ES5 downleveling of super access inside a decorated accessor (the base Camera.inertia carries @serialize()) mis-compiles to undefined. That would feed NaN into the movement decay and freeze the camera. It only breaks in the ES5 UMD bundle; native-ESM dev keeps real super. See the babylonjs/no-super-in-accessor lint rule.

    Parameters

    • value: number

    Returns void

  • get inertialAlphaOffset(): number

    Current inertia value on the longitudinal axis. When nonzero, represents the per-frame angular offset (in radians) applied to alpha. Each frame, this value is multiplied by inertia (a decay coefficient where 0 = instant stop, 0.9 = smooth glide, 1 = never stops). Reading this value also reflects the rotation delta the movement system will apply this frame (decays toward 0 over the inertia tail), preserving legacy semantics for "is the camera still animating?" checks. Setting this to 0 also stops the movement system's rotation velocity for backward compatibility.

    Returns number

  • set inertialAlphaOffset(value: number): void

    Parameters

    • value: number

    Returns void

  • get inertialBetaOffset(): number

    Current inertia value on the latitudinal axis. When nonzero, represents the per-frame angular offset (in radians) applied to beta. Each frame, this value is multiplied by inertia (a decay coefficient where 0 = instant stop, 0.9 = smooth glide, 1 = never stops). Reading this value also reflects the rotation delta the movement system will apply this frame (decays toward 0 over the inertia tail), preserving legacy semantics for "is the camera still animating?" checks. Setting this to 0 also stops the movement system's rotation velocity for backward compatibility.

    Returns number

  • set inertialBetaOffset(value: number): void

    Parameters

    • value: number

    Returns void

  • get inertialRadiusOffset(): number

    Current inertia value on the radius axis. When nonzero, represents the per-frame offset (in scene units) applied to radius. Each frame, this value is multiplied by inertia (a decay coefficient where 0 = instant stop, 0.9 = smooth glide, 1 = never stops). Reading this value also reflects the zoom delta the movement system will apply this frame (decays toward 0 over the inertia tail), preserving legacy semantics for "is the camera still animating?" checks. Setting this to 0 also stops the movement system's zoom velocity for backward compatibility.

    Returns number

  • set inertialRadiusOffset(value: number): void

    Parameters

    • value: number

    Returns void

  • get inheritVisibility(): boolean

    If set to true, this node, when renderable, will only be visible if its parent(s) are also visible.

    Returns boolean

    false
    
  • set inheritVisibility(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • get isVisible(): boolean

    Gets or sets a boolean indicating whether this node is visible, either this node itself when it is renderable or its renderable child nodes when inheritVisibility is true.

    Returns boolean

    true
    
  • set isVisible(value: boolean): void

    Parameters

    • value: boolean

    Returns void

  • set onDispose(callback: () => void): void

    Sets a callback that will be raised when the node will be disposed

    Parameters

    • callback: () => void

    Returns void

  • get onEffectiveEnabledStateChangedObservable(): Observable<boolean>

    An event triggered when the effective enabled state of the node changes, i.e. whenever the value returned by isEnabled changes. Unlike onEnabledStateChangedObservable, this fires for changes caused by an ancestor's enabled state as well as this node's own state. The observable is created on first access, so no cost is incurred for nodes that never observe it.

    Returns Observable<boolean>

  • get upVector(): Vector3

    The vector the camera should consider as up. (default is Vector3(0, 1, 0) aka Vector3.Up())

    Returns Vector3

  • set upVector(vec: Vector3): void

    The vector the camera should consider as up. (default is Vector3(0, 1, 0) as returned by Vector3.Up()) Setting this will copy the given vector to the camera's upVector, and set rotation matrices to and from Y up. DO NOT set the up vector using copyFrom or copyFromFloats, as this bypasses setting the above matrices.

    Parameters

    Returns void

  • get worldMatrixFromCache(): Matrix

    Returns directly the latest state of the mesh World matrix. A Matrix is returned.

    Returns Matrix

  • Will start the animation sequence

    Parameters

    • name: string

      defines the range frames for animation sequence

    • Optionalloop: boolean

      defines if the animation should loop (false by default)

    • OptionalspeedRatio: number

      defines the speed factor in which to run the animation (1 by default)

    • OptionalonAnimationEnd: () => void

      defines a function to be executed when the animation ended (undefined by default)

    Returns Nullable<Animatable>

    the object created for this animation. If range does not exist, it will return null

  • Creates an animation range for this node

    Parameters

    • name: string

      defines the name of the range

    • from: number

      defines the starting key

    • to: number

      defines the end key

    Returns void

  • Delete a specific animation range

    Parameters

    • name: string

      defines the name of the range to delete

    • deleteFrames: boolean = true

      defines if animation frames from the range must be deleted as well

    Returns void

  • Focus on a mesh or a bounding box. This adapts the target and maxRadius if necessary but does not update the current radius. The target will be changed but the radius

    Parameters

    • meshesOrMinMaxVectorAndDistance: AbstractMesh[] | { distance: number; max: Vector3; min: Vector3 }

      Defines the mesh or bounding info to focus on

    • doNotUpdateMaxZ: boolean = false

      Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)

    Returns void

  • Get all child-meshes of this node

    Type Parameters

    Parameters

    • OptionaldirectDescendantsOnly: boolean

      defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)

    • Optionalpredicate: (node: Node) => node is T

      defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored

    Returns T[]

    an array of AbstractMesh

  • Get all child-meshes of this node

    Parameters

    • OptionaldirectDescendantsOnly: boolean

      defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: false)

    • Optionalpredicate: (node: Node) => boolean

      defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored

    Returns AbstractMesh[]

    an array of AbstractMesh

  • Get all direct children of this node

    Type Parameters

    Parameters

    • Optionalpredicate: (node: Node) => node is T

      defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored

    • OptionaldirectDescendantsOnly: boolean

      defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)

    Returns T[]

    an array of Node

  • Get all direct children of this node

    Parameters

    • Optionalpredicate: (node: Node) => boolean

      defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored

    • OptionaldirectDescendantsOnly: boolean

      defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered (Default: true)

    Returns Node[]

    an array of Node

  • Will return all nodes that have this node as ascendant

    Type Parameters

    Parameters

    • OptionaldirectDescendantsOnly: boolean

      defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered

    • Optionalpredicate: (node: Node) => node is T

      defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored

    Returns T[]

    all children nodes of all types

  • Will return all nodes that have this node as ascendant

    Parameters

    • OptionaldirectDescendantsOnly: boolean

      defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered

    • Optionalpredicate: (node: Node) => boolean

      defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored

    Returns Node[]

    all children nodes of all types

  • Gets a ray in the forward direction from the camera.

    Parameters

    • length: number = 100

      Defines the length of the ray to create

    • Optionaltransform: Matrix

      Defines the transform to apply to the ray, by default the world matrix is used to create a world space ray

    • Optionalorigin: Vector3

      Defines the start point of the ray which defaults to the camera position

    Returns Ray

    the forward ray

  • Gets a ray in the forward direction from the camera.

    Parameters

    • refRay: Ray

      the ray to (re)use when setting the values

    • length: number = 100

      Defines the length of the ray to create

    • Optionaltransform: Matrix

      Defines the transform to apply to the ray, by default the world matrix is used to create a world space ray

    • Optionalorigin: Vector3

      Defines the start point of the ray which defaults to the camera position

    Returns Ray

    the forward ray

  • Return the minimum and maximum world vectors of the entire hierarchy under current node

    Parameters

    • includeDescendants: boolean = true

      Include bounding info from descendants as well (true by default)

    • predicate: Nullable<(abstractMesh: AbstractMesh) => boolean> = null

      defines a callback function that can be customize to filter what meshes should be included in the list used to compute the bounding vectors

    Returns { max: Vector3; min: Vector3 }

    the new bounding vectors

  • Interpolates the camera to a goal state.

    Parameters

    • alpha: number = ...

      Defines the goal alpha.

    • beta: number = ...

      Defines the goal beta.

    • radius: number = ...

      Defines the goal radius.

    • target: Vector3 = ...

      Defines the goal target.

    • targetScreenOffset: Vector2 = ...

      Defines the goal target screen offset.

    • OptionalinterpolationFactor: number

      A value between 0 and 1 that determines the speed of the interpolation.

    Returns void

    Passing undefined for any of the parameters will use the current value (effectively stopping any in-progress interpolation for that parameter). Passing NaN will not start or stop any interpolation for that parameter (effectively allowing multiple interpolations of different parameters to overlap).

  • Is this node a descendant of the given node? The function will iterate up the hierarchy until the ancestor was found or no more parents defined

    Parameters

    • ancestor: Node

      defines the parent node to inspect

    Returns boolean

    a boolean indicating if this node is a descendant of the given node

  • Is this node enabled? If the node has a parent, all ancestors will be checked and false will be returned if any are false (not enabled), otherwise will return true

    Parameters

    • checkAncestors: boolean = true

      indicates if this method should check the ancestors. The default is to check the ancestors. If set to false, the method will return the value of this node without checking ancestors

    Returns boolean

    whether this node (and its parent) is enabled

    To observe changes to the value returned when calling this with checkAncestors set to true (the default, i.e. the effective enabled state), subscribe to onEffectiveEnabledStateChangedObservable. To observe changes to the value returned when calling this with checkAncestors set to false (i.e. this node's own enabled state only), subscribe to onEnabledStateChangedObservable.

  • Checks if a cullable object (mesh...) is in the camera frustum This checks the bounding box center. See isCompletelyInFrustum for a full bounding check

    Parameters

    • target: ICullable

      The object to check

    • checkRigCameras: boolean = false

      If the rig cameras should be checked (eg. with VR camera both eyes should be checked) (Default: false)

    Returns boolean

    true if the object is in frustum otherwise false

  • Is this camera ready to be used/rendered

    Parameters

    • completeCheck: boolean = false

      defines if a complete check (including post processes) has to be done (false by default)

    Returns boolean

    true if the camera is ready

  • Sets the camera's field of view in radians based on the focal length and sensor size.

    Parameters

    • value: number

      the focal length of the camera in mm.

    • sensorSize: number = 36

      the sensor width size of the camera in mm. (default is 36mm, which is a full frame sensor)

    Returns void

  • Defines the target the camera should look at. This will automatically adapt alpha beta and radius to fit within the new target. Please note that setting a target as a mesh will disable panning.

    Parameters

    • target: any

      Defines the new target as a Vector or a transform node

    • toBoundingCenter: boolean = false

      In case of a mesh target, defines whether to target the mesh position or its bounding information center

    • allowSamePosition: boolean = false

      If false, prevents reapplying the new computed position if it is identical to the current one (optim)

    • cloneAlphaBetaRadius: boolean = false

      If true, replicate the current setup (alpha, beta, radius) on the new target

    Returns void

  • Gets a string representation of the camera useful for debug purpose.

    Parameters

    • OptionalfullDetails: boolean

      Defines that a more verbose level of logging is required

    Returns string

    the string representation

  • Zooms on a mesh to be at the min distance where we could see it fully in the current viewport.

    Parameters

    • Optionalmeshes: AbstractMesh[]

      Defines the mesh to zoom on

    • doNotUpdateMaxZ: boolean = false

      Defines whether or not maxZ should be updated whilst zooming on the mesh (this can happen if the mesh is big and the maxradius pretty small for instance)

    Returns void

  • Returns a node constructor based on type name

    Parameters

    • type: string

      defines the type name

    • name: string

      defines the new node name

    • scene: Scene

      defines the hosting scene

    • Optionaloptions: any

      defines optional options to transmit to constructors

    Returns Nullable<() => Node>

    the new constructor or null

  • Gets a camera constructor for a given camera type

    Parameters

    • type: string

      The type of the camera to construct (should be equal to one of the camera class name)

    • name: string

      The name of the camera the result will be able to instantiate

    • scene: Scene

      The scene the result will construct the camera in

    • interaxial_distance: number = 0

      In case of stereoscopic setup, the distance between both eyes

    • isStereoscopicSideBySide: boolean = true

      In case of stereoscopic setup, should the sereo be side b side

    Returns () => Camera

    a factory method to construct the camera

  • Parse animation range data from a serialization object and store them into a given node

    Parameters

    • node: Node

      defines where to store the animation ranges

    • parsedNode: any

      defines the serialization object to read data from

    • _scene: Scene

      defines the hosting scene

    Returns void