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.

See

https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#arc-rotate-camera

Hierarchy

  • TargetCamera
    • ArcRotateCamera

Constructors

Properties

allowUpsideDown alpha animations beta cameraDirection cameraRigMode cameraRotation checkCollisions collisionRadius customRenderTargets fov fovMode id ignoreParentScaling inertia inertialAlphaOffset inertialBetaOffset inertialPanningX inertialPanningY inertialRadiusOffset inputs inspectableCustomProperties interaxialDistance inverseRotationSpeed invertRotation isIntermediate isRigCamera isStereoscopicSideBySide layerMask lockedTarget lowerAlphaLimit lowerBetaLimit lowerRadiusLimit mapPanning maxZ metadata minZ name noRotationConstraint oblique onAccessibilityTagChangedObservable onAfterCheckInputsObservable onCollide onDisposeObservable onMeshTargetChangedObservable onProjectionMatrixChangedObservable onReady onRestoreStateObservable onViewMatrixChangedObservable outputRenderTarget overrideCloneAlphaBetaRadius panningAxis panningDistanceLimit panningInertia panningOriginTarget pinchToPanMaxDistance projectionPlaneTilt radius renderPassId reservedDataStore rigParent? rotation rotationQuaternion speed state targetScreenOffset uniqueId updateUpVectorFromRotation upperAlphaLimit upperBetaLimit upperRadiusLimit useInputToRestoreState viewport zoomOnFactor FOVMODE_HORIZONTAL_FIXED FOVMODE_VERTICAL_FIXED ForceAttachControlToAlwaysPreventDefault ORTHOGRAPHIC_CAMERA PERSPECTIVE_CAMERA RIG_MODE_CUSTOM RIG_MODE_NONE RIG_MODE_STEREOSCOPIC_ANAGLYPH RIG_MODE_STEREOSCOPIC_INTERLACED RIG_MODE_STEREOSCOPIC_OVERUNDER RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL RIG_MODE_VR

Accessors

Methods

Constructors

  • 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

    • Optional scene: Scene

      Defines the scene the camera belongs to

    • Optional setActiveOnSceneIfNoneActive: boolean

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

    Returns ArcRotateCamera

Properties

allowUpsideDown: boolean

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: BabylonAnimation[]

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

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

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

See

https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions#how-can-i-do-this-

collisionRadius: Vector3

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

See

https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_collisions#arcrotatecamera

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

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

fovMode: number

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

ignoreParentScaling: boolean

Gets or sets a boolean indicating that the scaling of the parent hierarchy will not be taken in account by the camera

inertia: number

Define the default inertia of the camera. This helps giving a smooth feeling to the camera movement.

inertialAlphaOffset: number

Current inertia value on the longitudinal axis. The bigger this number the longer it will take for the camera to stop.

inertialBetaOffset: number

Current inertia value on the latitudinal axis. The bigger this number the longer it will take for the camera to stop.

inertialPanningX: number

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

inertialPanningY: number

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

inertialRadiusOffset: number

Current inertia value on the radius axis. The bigger this number the longer it will take for the camera to stop.

inputs: ArcRotateCameraInputsManager

Defines the input associated to the camera.

inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)

See

https://doc.babylonjs.com/toolsAndResources/inspector#extensibility

interaxialDistance: number

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

inverseRotationSpeed: number

Speed multiplier for inverse camera panning

invertRotation: boolean

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

isIntermediate: boolean

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

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

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

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>

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

lowerBetaLimit: Nullable<number>

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

lowerRadiusLimit: Nullable<number>

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.

mapPanning: boolean

Defines if camera will eliminate transform on y axis.

maxZ: number

Define the maximum distance the camera can see to. 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

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

minZ: number

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.

name: string

Gets or sets the name of the node

noRotationConstraint: boolean

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

oblique: Nullable<IObliqueParams>

Object containing oblique projection values (only used with ORTHOGRAPHIC_CAMERA)

onAccessibilityTagChangedObservable: Observable<Nullable<IAccessibilityTag>>
onAfterCheckInputsObservable: Observable<Camera>

Observable triggered when the inputs have been processed.

onCollide: ((collidedMesh: AbstractMesh) => void)

Type declaration

    • (collidedMesh: AbstractMesh): void
    • Event raised when the camera is colliding with a mesh.

      Parameters

      Returns void

onDisposeObservable: Observable<Node>

An event triggered when the mesh is disposed

onMeshTargetChangedObservable: Observable<Nullable<AbstractMesh>>

Observable triggered when the mesh target has been changed on the camera.

onProjectionMatrixChangedObservable: Observable<Camera>

Observable triggered when the camera Projection matrix has changed.

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

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.

outputRenderTarget: Nullable<RenderTargetTexture>

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>

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

panningInertia: number

Defines the value of the inertia used during panning. 0 would mean stop inertia and one would mean no deceleration at all.

panningOriginTarget: Vector3

Defines the target of the camera before panning.

pinchToPanMaxDistance: number

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

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 it s target point.

renderPassId: number

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

reservedDataStore: any

For internal use only. Please do not use.

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: Quaternion

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

speed: number

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

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

upperAlphaLimit: Nullable<number>

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>

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

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

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

FOVMODE_HORIZONTAL_FIXED: 1 = 1

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 = 0

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.

ForceAttachControlToAlwaysPreventDefault: boolean

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

ORTHOGRAPHIC_CAMERA: 1 = 1

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 = 0

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 = 22

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

RIG_MODE_NONE: 0 = 0

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 = 10

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 = 14

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

RIG_MODE_STEREOSCOPIC_OVERUNDER: 13 = 13

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

RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED: 12 = 12

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

RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL: 11 = 11

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

RIG_MODE_VR: 20 = 20

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

Accessors

  • get absoluteRotation(): Quaternion
  • Returns the current camera absolute rotation

    Returns Quaternion

  • get accessibilityTag(): Nullable<IAccessibilityTag>
  • Returns Nullable<IAccessibilityTag>

  • set accessibilityTag(value: Nullable<IAccessibilityTag>): void
  • Gets or sets the accessibility tag to describe the node for accessibility purpose.

    Parameters

    • value: Nullable<IAccessibilityTag>

    Returns void

  • get angularSensibilityX(): number
  • Gets or Set the pointer angular sensibility along the X axis or how fast is the camera rotating.

    Returns number

  • set angularSensibilityX(value: number): void
  • Parameters

    • value: number

    Returns void

  • get angularSensibilityY(): number
  • Gets or Set the pointer angular sensibility along the Y axis or how fast is the camera rotating.

    Returns number

  • set angularSensibilityY(value: number): void
  • Parameters

    • value: number

    Returns void

  • get animationPropertiesOverride(): Nullable<AnimationPropertiesOverride>
  • Gets or sets the animation properties override

    Returns Nullable<AnimationPropertiesOverride>

  • set animationPropertiesOverride(value: Nullable<AnimationPropertiesOverride>): void
  • Parameters

    • value: Nullable<AnimationPropertiesOverride>

    Returns void

  • 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 globalPosition(): Vector3
  • Gets the current world space position of the camera.

    Returns Vector3

  • get isLeftCamera(): boolean
  • Gets the left camera of a rig setup in case of Rigged Camera

    Returns boolean

  • get isRightCamera(): boolean
  • Gets the right camera of a rig setup in case of Rigged Camera

    Returns boolean

  • get keysDown(): number[]
  • Gets or Set the list of keyboard keys used to control beta angle in a negative direction.

    Returns number[]

  • set keysDown(value: number[]): void
  • Parameters

    • value: number[]

    Returns void

  • get keysLeft(): number[]
  • Gets or Set the list of keyboard keys used to control alpha angle in a negative direction.

    Returns number[]

  • set keysLeft(value: number[]): void
  • Parameters

    • value: number[]

    Returns void

  • get keysRight(): number[]
  • Gets or Set the list of keyboard keys used to control alpha angle in a positive direction.

    Returns number[]

  • set keysRight(value: number[]): void
  • Parameters

    • value: number[]

    Returns void

  • get keysUp(): number[]
  • Gets or Set the list of keyboard keys used to control beta angle in a positive direction.

    Returns number[]

  • set keysUp(value: number[]): void
  • Parameters

    • value: number[]

    Returns void

  • get leftCamera(): Nullable<FreeCamera>
  • Gets the left camera of a rig setup in case of Rigged Camera

    Returns Nullable<FreeCamera>

  • get mode(): number
  • Returns number

  • set mode(mode: number): void
  • Parameters

    • mode: number

    Returns void

  • get onClonedObservable(): Observable<Node>
  • An event triggered when the node is cloned

    Returns Observable<Node>

  • set onDispose(callback: (() => void)): void
  • Sets a callback that will be raised when the node will be disposed

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • get onEnabledStateChangedObservable(): Observable<boolean>
  • An event triggered when the enabled state of the node changes

    Returns Observable<boolean>

  • get orthoBottom(): Nullable<number>
  • Returns Nullable<number>

  • set orthoBottom(value: Nullable<number>): void
  • Parameters

    • value: Nullable<number>

    Returns void

  • get orthoLeft(): Nullable<number>
  • Returns Nullable<number>

  • set orthoLeft(value: Nullable<number>): void
  • Parameters

    • value: Nullable<number>

    Returns void

  • get orthoRight(): Nullable<number>
  • Returns Nullable<number>

  • set orthoRight(value: Nullable<number>): void
  • Parameters

    • value: Nullable<number>

    Returns void

  • get orthoTop(): Nullable<number>
  • Returns Nullable<number>

  • set orthoTop(value: Nullable<number>): void
  • Parameters

    • value: Nullable<number>

    Returns void

  • get panningSensibility(): number
  • Gets or Set the pointer panning sensibility or how fast is the camera moving.

    Returns number

  • set panningSensibility(value: number): void
  • Parameters

    • value: number

    Returns void

  • get pinchDeltaPercentage(): number
  • Gets or Set the pointer pinch delta percentage or how fast is the camera zooming. It will be used instead of pinchDeltaPrecision if different from 0. It defines the percentage of current camera.radius to use as delta when pinch zoom is used.

    Returns number

  • set pinchDeltaPercentage(value: number): void
  • Parameters

    • value: number

    Returns void

  • get pinchPrecision(): number
  • Gets or Set the pointer pinch precision or how fast is the camera zooming.

    Returns number

  • set pinchPrecision(value: number): void
  • Parameters

    • value: number

    Returns void

  • get position(): Vector3
  • Define the current local position of the camera in the scene

    Returns Vector3

  • set position(newPosition: Vector3): void
  • Parameters

    Returns void

  • get rigPostProcess(): Nullable<PostProcess>
  • Gets the post process used by the rig cameras

    Returns Nullable<PostProcess>

  • get rightCamera(): Nullable<FreeCamera>
  • Gets the right camera of a rig setup in case of Rigged Camera

    Returns Nullable<FreeCamera>

  • get screenArea(): number
  • The screen area in scene units squared

    Returns number

  • get target(): Vector3
  • Defines the target point of the camera. The camera looks towards it from the radius distance.

    Returns Vector3

  • set target(value: Vector3): void
  • Parameters

    Returns void

  • get targetHost(): Nullable<AbstractMesh>
  • Defines the target mesh of the camera. The camera looks towards it from the radius distance. Please note that setting a target host will disable panning.

    Returns Nullable<AbstractMesh>

  • set targetHost(value: Nullable<AbstractMesh>): void
  • Parameters

    Returns void

  • get upVector(): Vector3
  • 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 useNaturalPinchZoom(): boolean
  • Gets or Set the pointer use natural pinch zoom to override the pinch precision and pinch delta percentage. When useNaturalPinchZoom is true, multi touch zoom will zoom in such that any object in the plane at the camera's target point will scale perfectly with finger motion.

    Returns boolean

  • set useNaturalPinchZoom(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get wheelDeltaPercentage(): number
  • Gets or Set the mouse wheel delta percentage or how fast is the camera zooming. It will be used instead of pinchDeltaPrecision if different from 0. It defines the percentage of current camera.radius to use as delta when pinch zoom is used.

    Returns number

  • set wheelDeltaPercentage(value: number): void
  • Parameters

    • value: number

    Returns void

  • get wheelPrecision(): number
  • Gets or Set the mouse wheel precision or how fast is the camera zooming.

    Returns number

  • set wheelPrecision(value: number): void
  • Parameters

    • value: number

    Returns void

  • get worldMatrixFromCache(): Matrix
  • Returns directly the latest state of the mesh World matrix. A Matrix is returned.

    Returns Matrix

  • get zoomToMouseLocation(): boolean
  • Gets or Set the boolean value that controls whether or not the mouse wheel zooms to the location of the mouse pointer or not. The default is false.

    Returns boolean

  • set zoomToMouseLocation(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

Methods

  • Internal, gets the first post process.

    Returns

    the first post process to be run on this camera.

    Returns Nullable<PostProcess>

  • Attach a behavior to the node

    See

    https://doc.babylonjs.com/features/featuresDeepDive/behaviors

    Returns

    the current Node

    Parameters

    • behavior: Behavior<Node>

      defines the behavior to attach

    • Optional attachImmediately: boolean

      defines that the behavior must be attached even if the scene is still loading

    Returns Node

  • Automatically tilts the projection plane, using projectionPlaneTilt, to correct the perspective effect on vertical lines.

    Returns void

  • Attach the input controls to a specific dom element to get the input from.

    Parameters

    Returns void

  • Attach the input controls to a specific dom element to get the input from.

    Parameters

    Returns void

  • Attached controls to the current camera.

    Parameters

    Returns void

  • Attached controls to the current camera.

    Parameters

    Returns void

  • Attached controls to the current camera.

    Parameters

    • noPreventDefault: boolean

      Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)

    • useCtrlForPanning: boolean

      Defines whether ctrl is used for panning within the controls

    • panningMouseButton: number

      Defines whether panning is allowed through mouse click button

    Returns void

  • Attach a post process to the camera.

    See

    https://doc.babylonjs.com/features/featuresDeepDive/postProcesses/usePostProcesses#attach-postprocess

    Returns

    the position the post process has been inserted at

    Parameters

    • postProcess: PostProcess

      The post process to attach to the camera

    • Optional insertAt: Nullable<number>

      The position of the post process in case several of them are in use in the scene

    Returns number

  • Will start the animation sequence

    Returns

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

    Parameters

    • name: string

      defines the range frames for animation sequence

    • Optional loop: boolean

      defines if the animation should loop (false by default)

    • Optional speedRatio: number

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

    • Optional onAnimationEnd: (() => void)

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

        • (): void
        • Returns void

    Returns Nullable<Animatable>

  • Clones the current camera.

    Returns

    the cloned camera

    Parameters

    • name: string

      The cloned camera name

    • Optional newParent: Nullable<Node>

      The cloned camera's new parent (none by default)

    Returns Camera

  • Compute the world matrix of the camera.

    Returns

    the camera world matrix

    Returns Matrix

  • 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

  • Override Camera.createRigCamera

    Parameters

    • name: string
    • cameraIndex: number

    Returns Camera

  • Delete a specific animation range

    Parameters

    • name: string

      defines the name of the range to delete

    • Optional deleteFrames: boolean

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

    Returns void

  • Detach the current controls from the specified dom element.

    Returns void

  • Destroy the camera and release the current resources hold by it.

    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

    • Optional doNotUpdateMaxZ: boolean

      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

  • Freeze the projection matrix. It will prevent the cache check of the camera projection compute and can speed up perf if no parameter of the camera are meant to change

    Parameters

    • Optional projection: Matrix

      Defines manually a projection if necessary

    Returns void

  • Gets the list of active meshes this frame (meshes no culled or excluded by lod s in the frame)

    Returns

    the active meshe list

    Returns SmartArray<AbstractMesh>

  • Get an animation by name

    Returns

    null if not found else the requested animation

    Parameters

    • name: string

      defines the name of the animation to look for

    Returns Nullable<BabylonAnimation>

  • Get an animation range by name

    Returns

    null if not found else the requested animation range

    Parameters

    • name: string

      defines the name of the animation range to look for

    Returns Nullable<AnimationRange>

  • Gets the list of all animation ranges defined on this node

    Returns

    an array

    Returns Nullable<AnimationRange>[]

  • Gets an attached behavior by name

    See

    https://doc.babylonjs.com/features/featuresDeepDive/behaviors

    Returns

    null if behavior was not found else the requested behavior

    Parameters

    • name: string

      defines the name of the behavior to look for

    Returns Nullable<Behavior<Node>>

  • Get all child-meshes of this node

    Returns

    an array of AbstractMesh

    Type Parameters

    Parameters

    • Optional directDescendantsOnly: 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)

    • Optional predicate: ((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

        • (node: Node): node is T
        • Parameters

          Returns node is T

    Returns T[]

  • Get all child-meshes of this node

    Returns

    an array of AbstractMesh

    Parameters

    • Optional directDescendantsOnly: 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)

    • Optional predicate: ((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

        • (node: Node): boolean
        • Parameters

          Returns boolean

    Returns AbstractMesh[]

  • Get all direct children of this node

    Returns

    an array of Node

    Type Parameters

    Parameters

    • Optional predicate: ((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

        • (node: Node): node is T
        • Parameters

          Returns node is T

    • Optional directDescendantsOnly: 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[]

  • Get all direct children of this node

    Returns

    an array of Node

    Parameters

    • Optional predicate: ((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

        • (node: Node): boolean
        • Parameters

          Returns boolean

    • Optional directDescendantsOnly: 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[]

  • Gets the current object class name.

    Returns

    the class name

    Returns string

  • Will return all nodes that have this node as ascendant

    Returns

    all children nodes of all types

    Type Parameters

    Parameters

    • Optional directDescendantsOnly: 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

    • Optional predicate: ((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

        • (node: Node): node is T
        • Parameters

          Returns node is T

    Returns T[]

  • Will return all nodes that have this node as ascendant

    Returns

    all children nodes of all types

    Parameters

    • Optional directDescendantsOnly: 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

    • Optional predicate: ((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

        • (node: Node): boolean
        • Parameters

          Returns boolean

    Returns Node[]

  • Gets the direction of the camera relative to a given local axis.

    Returns

    the direction

    Parameters

    • localAxis: Vector3

      Defines the reference axis to provide a relative direction.

    Returns Vector3

  • Gets the direction of the camera relative to a given local axis into a passed vector.

    Parameters

    • localAxis: Vector3

      Defines the reference axis to provide a relative direction.

    • result: Vector3

      Defines the vector to store the result in

    Returns void

  • Gets the engine of the node

    Returns

    a Engine

    Returns Engine

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

    Returns

    the forward ray

    Parameters

    • Optional length: number

      Defines the length of the ray to create

    • Optional transform: Matrix

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

    • Optional origin: Vector3

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

    Returns Ray

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

    Returns

    the forward ray

    Parameters

    • refRay: Ray

      the ray to (re)use when setting the values

    • Optional length: number

      Defines the length of the ray to create

    • Optional transform: Matrix

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

    • Optional origin: Vector3

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

    Returns Ray

  • Gets the position in front of the camera at a given distance.

    Returns

    the position

    Parameters

    • distance: number

      The distance from the camera we want the position to be

    Returns Vector3

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

    Returns

    the new bounding vectors

    Parameters

    • Optional includeDescendants: boolean

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

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

      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 }

  • Gets the left camera target of a rig setup in case of Rigged Camera

    Returns

    the target position

    Returns Nullable<Vector3>

  • Gets the current projection matrix of the camera.

    Returns

    the projection matrix

    Parameters

    • Optional force: boolean

      forces the camera to recompute the matrix without looking at the cached state

    Returns Matrix

  • Gets the right camera target of a rig setup in case of Rigged Camera

    Returns

    the target position

    Returns Nullable<Vector3>

  • Gets the scene of the node

    Returns

    a scene

    Returns Scene

  • Return the current target position of the camera. This value is expressed in local space.

    Returns

    the target position

    Returns Vector3

  • Gets the transformation matrix (ie. the multiplication of view by projection matrices)

    Returns

    a Matrix

    Returns Matrix

  • Gets the current view matrix of the camera.

    Returns

    the view matrix

    Parameters

    • Optional force: boolean

      forces the camera to recompute the matrix without looking at the cached state

    Returns Matrix

  • Gets the current world matrix of the camera

    Returns Matrix

  • Check whether a mesh is part of the current active mesh list of the camera

    Returns

    true if active, false otherwise

    Parameters

    • mesh: Mesh

      Defines the mesh to check

    Returns boolean

  • Checks if a cullable object (mesh...) is in the camera frustum Unlike isInFrustum this checks the full bounding box

    Returns

    true if the object is in frustum otherwise false

    Parameters

    • target: ICullable

      The object to check

    Returns boolean

  • 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

    Returns

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

    Parameters

    • ancestor: Node

      defines the parent node to inspect

    Returns boolean

  • Gets a boolean indicating if the node has been disposed

    Returns

    true if the node was disposed

    Returns boolean

  • 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

    Returns

    whether this node (and its parent) is enabled

    Parameters

    • Optional checkAncestors: boolean

      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

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

    Returns

    true if the object is in frustum otherwise false

    Parameters

    • target: ICullable

      The object to check

    • Optional checkRigCameras: boolean

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

    Returns boolean

  • Is this camera ready to be used/rendered

    Returns

    true if the camera is ready

    Parameters

    • Optional completeCheck: boolean

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

    Returns boolean

  • Flag the node as dirty (Forcing it to update everything)

    Returns

    this node

    Parameters

    • Optional _property: string

      helps children apply precise "dirtyfication"

    Returns Node

  • Rebuilds angles (alpha, beta) and radius from the give position and target

    Returns void

  • Restored camera state. You must call storeState() first.

    Returns

    true if restored and false otherwise

    Returns boolean

  • Serialiaze the camera setup to a json representation

    Returns

    the JSON representation

    Returns any

  • Serialize animation ranges into a JSON compatible object

    Returns

    serialization object

    Returns any

  • Set the enabled state of this node

    Parameters

    • value: boolean

      defines the new enabled state

    Returns void

  • Sets the Y-up to camera up-vector rotation matrix, and the up-vector to Y-up rotation matrix.

    Returns void

  • Use a position to define the current camera related information like alpha, beta and radius

    Parameters

    • position: Vector3

      Defines the position to set the camera at

    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: Vector3 | AbstractMesh

      Defines the new target as a Vector or a mesh

    • Optional toBoundingCenter: boolean

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

    • Optional allowSamePosition: boolean

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

    • Optional cloneAlphaBetaRadius: boolean

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

    Returns void

  • Stores the current state of the camera (alpha, beta, radius and target)

    Returns

    the camera itself

    Returns Camera

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

    Returns

    the string representation

    Parameters

    • Optional fullDetails: boolean

      Defines that a more verbose level of logging is required

    Returns string

  • Unfreeze the projection matrix if it has previously been freezed by freezeProjectionMatrix.

    Returns void

  • Update the camera state according to the different inputs gathered during the frame.

    Returns void

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

    Parameters

    • Optional meshes: AbstractMesh[]

      Defines the mesh to zoom on

    • Optional doNotUpdateMaxZ: boolean

      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

  • Add a new node constructor

    Parameters

    • type: string

      defines the type name of the node to construct

    • constructorFunc: NodeConstructor

      defines the constructor function

    Returns void

  • Returns a node constructor based on type name

    Returns

    the new constructor or null

    Parameters

    • type: string

      defines the type name

    • name: string

      defines the new node name

    • scene: Scene

      defines the hosting scene

    • Optional options: any

      defines optional options to transmit to constructors

    Returns Nullable<(() => Node)>

  • Gets a camera constructor for a given camera type

    Returns

    a factory method to construct the camera

    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

    • Optional interaxial_distance: number

      In case of stereoscopic setup, the distance between both eyes

    • Optional isStereoscopicSideBySide: boolean

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

    Returns (() => Camera)

      • (): Camera
      • Gets a camera constructor for a given camera type

        Returns

        a factory method to construct the camera

        Returns Camera

  • Parse a JSON and creates the camera from the parsed information

    Returns

    the newly constructed camera

    Parameters

    • parsedCamera: any

      The JSON to parse

    • scene: Scene

      The scene to instantiate the camera in

    Returns 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

Generated using TypeDoc