W-CF Documentation - v11.0.0
    Preparing search index...

    Class Camera

    Hierarchy

    • TargetCamera
      • Camera
    Index
    • Parameters

      Returns Camera

    _accessibilityTag: Nullable<IAccessibilityTag>
    _currentTarget: Vector3
    _deferOnly: boolean
    _deferredPositionUpdate: Vector3
    _deferredRotationQuaternionUpdate: Quaternion
    _deferredRotationUpdate: Vector3
    _deferredUpdated: boolean
    _globalPosition: Vector3
    _initialFocalDistance: number
    _isDirty: boolean
    _parentNode: Nullable<Node>
    _ranges: { [name: string]: Nullable<AnimationRange> }
    _referencePoint: Vector3
    _transformedReferencePoint: Vector3
    _upVector: Vector3
    _viewMatrix: Matrix
    animations: Animation[]

    Gets a list of Animations associated with the node

    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

    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

    ignoreCameraMaxZ: boolean

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

    inputs: CameraInputsManager<Camera>

    Define the input manager associated with 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

    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.

    maxZ: number

    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

    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.

    movement: CameraMovement

    Framerate-independent movement controller shared by the TargetCamera family (FreeCamera/FlyCamera/FollowCamera). Provides inertial physics and the configurable input map. Subclasses may replace it with a specialized CameraMovement (for example ArcRotateCamera uses ArcRotateCameraMovement).

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

    Observable fired when an accessibility tag is changed

    onAfterCheckInputsObservable: Observable<Camera>

    Observable triggered when the inputs have been processed.

    onDisposeObservable: Observable<Node>

    An event triggered when the mesh is disposed

    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. 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>

    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

    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

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

    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

    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.

    ForceAttachControlToAlwaysPreventDefault: boolean

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

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

    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

    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

    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

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

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

    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

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

    RIG_MODE_STEREOSCOPIC_OVERUNDER: 13

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

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

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

    RIG_MODE_VR: 20

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

    • 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 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 hasMoved(): boolean

      Gets a flag indicating that the camera has moved in some way since the last call to Camera.update()

      Returns boolean

    • get inertia(): number

      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.

      Returns number

    • set inertia(value: number): void

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

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

    • 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

      Define the mode of the camera (Camera.PERSPECTIVE_CAMERA or Camera.ORTHOGRAPHIC_CAMERA)

      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

      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 onEnabledStateChangedObservable(): Observable<boolean>

      An event triggered when the enabled state of the node changes. This only reflects changes to the node's own enabled flag (as set via setEnabled), not changes inherited from an ancestor. Use onEffectiveEnabledStateChangedObservable to also be notified when an ancestor's enabled state changes the effective enabled state.

      Returns Observable<boolean>

    • get orthoBottom(): Nullable<number>

      Returns Nullable<number>

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

      Define the current limit on the bottom side for an orthographic camera In scene unit

      Parameters

      • value: Nullable<number>

      Returns void

    • get orthoLeft(): Nullable<number>

      Returns Nullable<number>

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

      Define the current limit on the left side for an orthographic camera In scene unit

      Parameters

      • value: Nullable<number>

      Returns void

    • get orthoRight(): Nullable<number>

      Returns Nullable<number>

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

      Define the current limit on the right side for an orthographic camera In scene unit

      Parameters

      • value: Nullable<number>

      Returns void

    • get orthoTop(): Nullable<number>

      Returns Nullable<number>

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

      Define the current limit on the top side for an orthographic camera In scene unit

      Parameters

      • value: Nullable<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

      • newPosition: Vector3

      Returns void

    • get rightCamera(): Nullable<FreeCamera>

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

      Returns Nullable<FreeCamera>

    • get rigPostProcess(): Nullable<PostProcess>

      Gets the post process used by the rig cameras

      Returns Nullable<PostProcess>

    • 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 form the radius distance.

      Returns Vector3

    • set target(value: Vector3): void

      Parameters

      • value: Vector3

      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) aka Vector3.Up())

      Parameters

      • vec: Vector3

      Returns void

    • get worldMatrixFromCache(): Matrix

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

      Returns Matrix

    • Parameters

      • position: Vector3
      • target: Vector3
      • up: Vector3

      Returns void

    • Internal, gets the first post process.

      Returns Nullable<PostProcess>

      the first post process to be run on this camera.

    • Parameters

      • rigParams: any

      Returns void

    • Returns void

    • Attach a behavior to the node

      Parameters

      • behavior: Behavior<Node>

        defines the behavior to attach

      • OptionalattachImmediately: boolean

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

      Returns Node

      the current 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

    • Attach a post process to the camera.

      Parameters

      • postProcess: PostProcess

        The post process to attach to the camera

      • OptionalinsertAt: Nullable<number>

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

      Returns number

      the position the post process has been inserted at

    • 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

    • Clones the current camera.

      Parameters

      • name: string

        The cloned camera name

      • OptionalnewParent: Nullable<Node>

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

      Returns Camera

      the cloned camera

    • Compute the world matrix of the camera.

      Returns Matrix

      the camera world 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

    • Delete a specific animation range

      Parameters

      • name: string

        defines the name of the range to delete

      • OptionaldeleteFrames: 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

    • Detach the current controls from the specified dom element.

      Parameters

      • Optionalignored: any

        defines an ignored parameter kept for backward compatibility.

      Returns void

    • Releases resources associated with this node.

      Parameters

      • OptionaldoNotRecurse: boolean

        Set to true to not recurse into each children (recurse into each children by default)

      • OptionaldisposeMaterialAndTextures: boolean

        Set to true to also dispose referenced materials and textures (false by default)

      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

      • Optionalprojection: 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 SmartArray<AbstractMesh>

      the active meshe list

    • Get an animation by name

      Parameters

      • name: string

        defines the name of the animation to look for

      Returns Nullable<Animation>

      null if not found else the requested animation

    • Get an animation range by name

      Parameters

      • name: string

        defines the name of the animation range to look for

      Returns Nullable<AnimationRange>

      null if not found else the requested animation range

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

      Returns Nullable<AnimationRange>[]

      an array

    • Gets an attached behavior by name

      Parameters

      • name: string

        defines the name of the behavior to look for

      Returns Nullable<Behavior<Node>>

      null if behavior was not found else the requested behavior

    • Get all child-meshes of this node

      Type Parameters

      • T extends AbstractMesh

      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

      • T extends Node

      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

    • Gets the current object class name.

      Returns string

      the class name

    • Will return all nodes that have this node as ascendant

      Type Parameters

      • T extends 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

      • 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 the direction of the camera relative to a given local axis.

      Parameters

      • localAxis: DeepImmutable<Vector3>

        Defines the reference axis to provide a relative direction.

      Returns Vector3

      the direction

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

      Parameters

      • localAxis: DeepImmutable<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 AbstractEngine

      a Engine

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

      Parameters

      • Optionallength: number

        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

      • Optionallength: number

        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 the position in front of the camera at a given distance.

      Parameters

      • distance: number

        The distance from the camera we want the position to be

      Returns Vector3

      the position

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

      Parameters

      • OptionalincludeDescendants: boolean

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

      • Optionalpredicate: 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 }

      the new bounding vectors

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

      Returns Nullable<Vector3>

      the target position

    • Gets the current projection matrix of the camera.

      Parameters

      • OptionalpForce: boolean

      Returns Matrix

      the projection matrix

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

      Returns Nullable<Vector3>

      the target position

    • Gets the scene of the node

      Returns Scene

      a scene

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

      Returns Vector3

      the target position

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

      Returns Matrix

      a Matrix

    • Gets the current view matrix of the camera.

      Parameters

      • Optionalforce: boolean

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

      Returns Matrix

      the view matrix

    • Gets the current world matrix of the camera

      Returns Matrix

      the world matrix

    • Returns true if a state has been stored by calling storeState method.

      Returns boolean

      true if state has been stored.

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

      Parameters

      • mesh: Mesh

        Defines the mesh to check

      Returns boolean

      true if active, false otherwise

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

      Parameters

      • target: ICullable

        The object to check

      Returns boolean

      true if the object is in frustum otherwise false

    • 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

    • Gets a boolean indicating if the node has been disposed

      Returns boolean

      true if the node was disposed

    • 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

      • OptionalcheckAncestors: 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

      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

      • OptionalcheckRigCameras: boolean

        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

      • OptionalcompleteCheck: boolean

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

      Returns boolean

      true if the camera is ready

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

      Parameters

      • Optional_property: string

        helps children apply precise "dirtyfication"

      Returns Node

      this node

    • Returns void

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

      Returns boolean

      true if restored and false otherwise

    • Serialiaze the camera setup to a json representation

      Returns any

      the JSON representation

    • Serialize animation ranges into a JSON compatible object

      Returns any

      serialization object

    • Set the enabled state of this node

      Parameters

      • value: boolean

        defines the new enabled state

      Returns void

    • 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.

      • OptionalsensorSize: number

        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.

      Parameters

      • pTarget: Vector3

      Returns void

    • Store current camera state of the camera (fov, position, rotation, etc..)

      Returns Camera

      the camera

    • 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

    • 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

    • 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

      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

      • Optionalinteraxial_distance: number

        In case of stereoscopic setup, the distance between both eyes

      • OptionalisStereoscopicSideBySide: boolean

        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