Class VRDeviceOrientationArcRotateCamera
Hierarchy (View Summary)
- ArcRotateCamera
- VRDeviceOrientationArcRotateCamera
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new VRDeviceOrientationArcRotateCamera(
name: string,
alpha: number,
beta: number,
radius: number,
target: Vector3,
scene?: Scene,
compensateDistortion?: boolean,
vrCameraMetrics?: VRCameraMetrics,
): VRDeviceOrientationArcRotateCameraCreates a new VRDeviceOrientationArcRotateCamera
Parameters
- name: string
defines camera name
- 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: Scenedefines the scene the camera belongs to
- compensateDistortion: boolean = true
defines if the camera needs to compensate the lens distortion
- vrCameraMetrics: VRCameraMetrics = ...
defines the vr metrics associated to the camera
Returns VRDeviceOrientationArcRotateCamera
- name: string
Properties
allow Upside Down
Allows the camera to be completely reversed. If false the camera can not arrive upside down.
alpha
Defines the rotation angle of the camera along the longitudinal axis.
animations
Gets a list of Animations associated with the node
beta
Defines the rotation angle of the camera along the latitudinal axis.
camera Direction
Define the current direction the camera is moving to
camera Rig Mode
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.
camera Rotation
Define the current rotation the camera is rotating to
check Collisions
Defines whether the camera should check collision with the objects oh the scene.
collision Radius
Defines the collision radius of the camera. This simulates a sphere around the camera.
custom Render Targets
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
Field Of View is set in Radians. (default is 0.8)
fov Mode
fovMode sets the camera frustum bounds to the viewport bounds. (default is FOVMODE_VERTICAL_FIXED)
id
Gets or sets the id of the node
ignore Camera Max Z
Ignores camera maxZ when computing the projection matrix (ie. use 0 instead of maxZ), meaning objects won't be culled by the far plane
inertial Panning X
Defines the current inertia value used during panning of the camera along the X axis.
inertial Panning Y
Defines the current inertia value used during panning of the camera along the Y axis.
inputs
Defines the input associated to the camera.
inspectable Custom Properties
List of inspectable custom properties (used by the Inspector)
interaxial Distance
Defines the distance between both "eyes" in case of a RIG
inverse Rotation Speed
Speed multiplier for inverse camera panning
invert Rotation
Reverses mouselook direction to 'natural' panning as opposed to traditional direct panning
is Intermediate
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
is Rig Camera
Is this camera a part of a rig system?
is Stereoscopic Side By Side
Defines if stereoscopic rendering is done side by side or over under.
layer Mask
Restricts the camera to viewing objects with the same layerMask. A camera with a layerMask of 1 will render mesh.layerMask & camera.layerMask!== 0
locked Target
Define the current target of the camera as an object or a position. Please note that locking a target will disable panning.
lower Alpha Limit
Minimum allowed angle on the longitudinal axis. This can help limiting how the Camera is able to move in the scene.
lower Beta Limit
Minimum allowed angle on the latitudinal axis. This can help limiting how the Camera is able to move in the scene.
lower Radius Limit
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.
lower Target Y Limit
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.
map Panning
Defines if camera will eliminate transform on y axis.
max Z
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
Gets or sets an object used to store user defined information for the node
min Z
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
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
Gets or sets the name of the node
no Rotation Constraint
Add constraint to the camera to prevent it to move freely in all directions and around all axis.
oblique
Object containing oblique projection values (only used with ORTHOGRAPHIC_CAMERA)
on Accessibility Tag Changed Observable
Observable fired when an accessibility tag is changed
on After Check Inputs Observable
Observable triggered when the inputs have been processed.
on Collide
Event raised when the camera is colliding with a mesh.
on Dispose Observable
An event triggered when the mesh is disposed
on Mesh Target Changed Observable
Observable triggered when the transform node target has been changed on the camera.
on Projection Matrix Changed Observable
Observable triggered when the camera Projection matrix has changed.
on Ready
Callback raised when the node is ready to be used
on Restore State Observable
Observable triggered when reset has been called and applied to the camera.
on View Matrix Changed Observable
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.
output Render Target
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
override Clone Alpha Beta Radius
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).
panning Axis
Defines the allowed panning axis.
panning Distance Limit
Defines the maximum distance the camera can pan. This could help keeping the camera always in your scene.
panning Origin Target
Defines the target of the camera before panning.
pinch To Pan Max Distance
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.
projection Plane Tilt
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
Defines the radius of the camera from its target point.
render Pass Id
Render pass id used by the camera to render into the main framebuffer
reserved Data Store
For internal use only. Please do not use.
restore State Interpolation Factor
Factor for restoring information interpolation. default is 0 = off. Any value < 0 or > 1 will disable interpolation.
Optionalrig Parent
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
Define the current rotation of the camera
rotation Quaternion
Define the current rotation of the camera as a quaternion to prevent Gimbal lock
speed
Define the current speed of the camera
state
Gets or sets a string used to store user defined state for the node
target Screen Offset
Defines a screen offset for the camera position.
unique Id
Gets or sets the unique id of the node
update Up Vector From Rotation
When set, the up vector of the camera will be updated by the rotation of the camera
upper Alpha Limit
Maximum allowed angle on the longitudinal axis. This can help limiting how the Camera is able to move in the scene.
upper Beta Limit
Maximum allowed angle on the latitudinal axis. This can help limiting how the Camera is able to move in the scene.
upper Radius Limit
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.
use Input To Restore State
Define if double tap/click is used to restore the previously saved state of the camera.
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.
zoom On Factor
Defines how much the radius should be scaled while zooming on a particular mesh (through the zoomOn function)
StaticForce Attach Control To Always Prevent Default
Defines if by default attaching controls should prevent the default javascript event to continue.
Static ReadonlyFOVMODE_ HORIZONTAL_ FIXED
This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.
Static ReadonlyFOVMODE_ 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.
Static ReadonlyORTHOGRAPHIC_ 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.
Static ReadonlyPERSPECTIVE_ 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.
Static ReadonlyRIG_ MODE_ CUSTOM
Custom rig mode allowing rig cameras to be populated manually with any number of cameras
Static ReadonlyRIG_ MODE_ NONE
This specifies there is no need for a camera rig. Basically only one eye is rendered corresponding to the camera.
Static ReadonlyRIG_ 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.
Static ReadonlyRIG_ MODE_ STEREOSCOPIC_ INTERLACED
Defines that both eyes of the camera will be rendered on successive lines interlaced for passive 3d monitors.
Static ReadonlyRIG_ MODE_ STEREOSCOPIC_ OVERUNDER
Defines that both eyes of the camera will be rendered over under each other.
Static ReadonlyRIG_ MODE_ STEREOSCOPIC_ SIDEBYSIDE_ CROSSEYED
Defines that both eyes of the camera will be rendered side by side with a none parallel target.
Static ReadonlyRIG_ MODE_ STEREOSCOPIC_ SIDEBYSIDE_ PARALLEL
Defines that both eyes of the camera will be rendered side by side with a parallel target.
Static ReadonlyRIG_ MODE_ VR
Defines that both eyes of the camera should be renderered in a VR mode (carbox).
Accessors
_ panning Mouse Button
-
set _panningMouseButton(value: number): void
Parameters
- value: number
Returns void
_ use Ctrl For Panning
-
set _useCtrlForPanning(value: boolean): void
Parameters
- value: boolean
Returns void
absolute Rotation
-
Returns the current camera absolute rotation
Returns Quaternion
accessibility Tag
angular Sensibility X
-
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
angular Sensibility Y
-
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
animation Properties Override
-
Gets or sets the animation properties override
Returns Nullable<AnimationPropertiesOverride>
-
Parameters
- value: Nullable<AnimationPropertiesOverride>
Returns void
auto Rotation Behavior
-
Gets the auto rotation behavior of the camera if it has been enabled.
Returns Nullable<AutoRotationBehavior>
behaviors
bouncing Behavior
-
Gets the bouncing behavior of the camera if it has been enabled.
Returns Nullable<BouncingBehavior>
do Not Serialize
-
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
framing Behavior
-
Gets the framing behavior of the camera if it has been enabled.
Returns Nullable<FramingBehavior>
global Position
-
Gets the current world space position of the camera.
Returns Vector3
has Moved
-
get hasMoved(): boolean
Gets a flag indicating that the camera has moved in some way since the last call to Camera.update()
Returns boolean
inertia
-
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 attarget: ES5, and ES5 downleveling ofsuperaccess inside a decorated accessor (the base Camera.inertia carries@serialize()) mis-compiles toundefined. That would feedNaNinto the movement decay and freeze the camera. It only breaks in the ES5 UMD bundle; native-ESM dev keeps realsuper. See thebabylonjs/no-super-in-accessorlint rule.Parameters
- value: number
Returns void
inertial Alpha Offset
-
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
inertial Beta Offset
-
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
inertial Radius Offset
-
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
inherit Visibility
-
get inheritVisibility(): boolean
-
set inheritVisibility(value: boolean): void
Parameters
- value: boolean
Returns void
is Interpolating
-
get isInterpolating(): boolean
If true, indicates the camera is currently interpolating to a new pose.
Returns boolean
is Left Camera
-
get isLeftCamera(): boolean
Gets the left camera of a rig setup in case of Rigged Camera
Returns boolean
is Right Camera
-
get isRightCamera(): boolean
Gets the right camera of a rig setup in case of Rigged Camera
Returns boolean
is Visible
-
get isVisible(): boolean
-
set isVisible(value: boolean): void
Parameters
- value: boolean
Returns void
keys Down
-
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
keys Left
-
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
keys Right
-
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
keys Up
-
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
left Camera
-
Gets the left camera of a rig setup in case of Rigged Camera
Returns Nullable<FreeCamera>
mode
-
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
on Cloned Observable
-
An event triggered when the node is cloned
Returns Observable<Node>
on Dispose
-
set onDispose(callback: () => void): void
Sets a callback that will be raised when the node will be disposed
Parameters
- callback: () => void
Returns void
on Effective Enabled State Changed Observable
-
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>
on Enabled State Changed Observable
-
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>
ortho Bottom
ortho Left
ortho Right
ortho Top
panning Inertia
-
get panningInertia(): number
Defines the value of the inertia used during panning. A decay coefficient applied per reference frame at 60fps: 0 means stop instantly, 0.9 means smooth glide, 1 means never stop. Setting this also updates the movement system's pan inertia.
Returns number
-
set panningInertia(value: number): void
Parameters
- value: number
Returns void
panning Sensibility
-
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
parent
-
Gets or sets the parent of the node (without keeping the current position in the scene)
Returns void
pinch Delta Percentage
-
get pinchDeltaPercentage(): number
Gets or Set the pointer pinch delta percentage or how fast is the camera zooming. It will be used instead of pinchPrecision 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
pinch Precision
-
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
position
right Camera
-
Gets the right camera of a rig setup in case of Rigged Camera
Returns Nullable<FreeCamera>
rig Post Process
-
Gets the post process used by the rig cameras
Returns Nullable<PostProcess>
screen Area
-
get screenArea(): number
The screen area in scene units squared
Returns number
target
target Host
-
get targetHost(): any
Defines the target transform node of the camera. The camera looks towards it from the radius distance. Please note that setting a target host will disable panning.
Returns any
-
set targetHost(value: any): void
Parameters
- value: any
Returns void
up Vector
-
The vector the camera should consider as up. (default is Vector3(0, 1, 0) aka Vector3.Up())
Returns Vector3
-
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
- vec: Vector3
Returns void
use Auto Rotation Behavior
-
get useAutoRotationBehavior(): boolean
Defines if the auto rotation behavior of the camera is enabled on the camera.
Returns boolean
-
set useAutoRotationBehavior(value: boolean): void
Parameters
- value: boolean
Returns void
use Bouncing Behavior
-
get useBouncingBehavior(): boolean
Defines if the bouncing behavior of the camera is enabled on the camera.
Returns boolean
-
set useBouncingBehavior(value: boolean): void
Parameters
- value: boolean
Returns void
use Framing Behavior
-
get useFramingBehavior(): boolean
Defines if the framing behavior of the camera is enabled on the camera.
Returns boolean
-
set useFramingBehavior(value: boolean): void
Parameters
- value: boolean
Returns void
use Natural Pinch Zoom
-
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
wheel Delta Percentage
-
get wheelDeltaPercentage(): number
Gets or Set the mouse wheel delta percentage or how fast is the camera zooming. It will be used instead of wheelPrecision if different from 0. It defines the percentage of current camera.radius to use as delta when wheel zoom is used.
Returns number
-
set wheelDeltaPercentage(value: number): void
Parameters
- value: number
Returns void
wheel Precision
-
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
world Matrix From Cache
-
Returns directly the latest state of the mesh World matrix. A Matrix is returned.
Returns Matrix
zoom To Mouse Location
-
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
_ get First Post Process
-
Internal, gets the first post process.
Returns Nullable<PostProcess>
the first post process to be run on this camera.
add Behavior
apply Vertical Correction
-
Automatically tilts the projection plane, using
projectionPlaneTilt, to correct the perspective effect on vertical lines.Returns void
attach Control
-
Attach the input controls to a specific dom element to get the input from.
Parameters
OptionalnoPreventDefault: booleanDefines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
Returns void
-
Attach the input controls to a specific dom element to get the input from.
Parameters
- ignored: any
defines an ignored parameter kept for backward compatibility.
OptionalnoPreventDefault: booleanDefines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
Returns void
- ignored: any
-
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
Returns void
- noPreventDefault: boolean
-
Attached controls to the current camera.
Parameters
- ignored: any
defines an ignored parameter kept for backward compatibility.
- 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
Returns void
- ignored: any
-
attachControl(
noPreventDefault: boolean,
useCtrlForPanning: boolean,
panningMouseButton: number,
): voidAttached 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
- noPreventDefault: boolean
attach Post Process
-
Attach a post process to the camera.
Parameters
- postProcess: PostProcess
The post process to attach to the camera
- insertAt: Nullable<number> = null
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
- postProcess: PostProcess
begin Animation
-
beginAnimation(
name: string,
loop?: boolean,
speedRatio?: number,
onAnimationEnd?: () => void,
): Nullable<Animatable>Will start the animation sequence
Parameters
- name: string
defines the range frames for animation sequence
Optionalloop: booleandefines if the animation should loop (false by default)
OptionalspeedRatio: numberdefines the speed factor in which to run the animation (1 by default)
OptionalonAnimationEnd: () => voiddefines 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
- name: string
clone
compute World Matrix
create Animation Range
-
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
- name: string
create Rig Camera
-
Override Camera.createRigCamera
Parameters
- name: string
the name of the camera
- cameraIndex: number
the index of the camera in the rig cameras array
Returns Camera
- name: string
delete Animation Range
-
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
- name: string
detach Control
-
Detach the current controls from the specified dom element.
Returns void
detach Post Process
-
Detach a post process to the camera.
Parameters
- postProcess: PostProcess
The post process to detach from the camera
Returns void
- postProcess: PostProcess
dispose
-
Destroy the camera and release the current resources hold by it.
Returns void
focus On
-
focusOn(
meshesOrMinMaxVectorAndDistance:
| AbstractMesh[]
| { distance: number; max: Vector3; min: Vector3 },
doNotUpdateMaxZ?: boolean,
): voidFocus 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
- meshesOrMinMaxVectorAndDistance: AbstractMesh[] | { distance: number; max: Vector3; min: Vector3 }
freeze Projection Matrix
-
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: MatrixDefines manually a projection if necessary
Returns void
get Active Meshes
-
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 Animation By Name
get Animation Range
-
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
- name: string
get Animation Ranges
-
Gets the list of all animation ranges defined on this node
Returns Nullable<AnimationRange>[]
an array
get Behavior By Name
get Child Meshes
-
getChildMeshes<T extends AbstractMesh>(
directDescendantsOnly?: boolean,
predicate?: (node: Node) => node is T,
): T[]Get all child-meshes of this node
Type Parameters
- T extends AbstractMesh
Parameters
OptionaldirectDescendantsOnly: booleandefines 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 Tdefines 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
-
getChildMeshes(
directDescendantsOnly?: boolean,
predicate?: (node: Node) => boolean,
): AbstractMesh[]Get all child-meshes of this node
Parameters
OptionaldirectDescendantsOnly: booleandefines 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) => booleandefines 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 Children
-
getChildren<T extends Node>(
predicate?: (node: Node) => node is T,
directDescendantsOnly?: boolean,
): T[]Get all direct children of this node
Type Parameters
- T extends Node
Parameters
Optionalpredicate: (node: Node) => node is Tdefines 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: booleandefines 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) => booleandefines 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: booleandefines 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
get Class Name
-
Gets camera class name
Returns string
VRDeviceOrientationArcRotateCamera
get Descendants
-
getDescendants<T extends Node>(
directDescendantsOnly?: boolean,
predicate?: (node: Node) => node is T,
): T[]Will return all nodes that have this node as ascendant
Type Parameters
- T extends Node
Parameters
OptionaldirectDescendantsOnly: booleandefines 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 Tdefines 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: booleandefines 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) => booleandefines 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
get Direction
-
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
- localAxis: DeepImmutable<Vector3>
get Direction To Ref
-
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
- localAxis: DeepImmutable<Vector3>
get Engine
get Forward Ray
get Forward Ray To Ref
-
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: MatrixDefines the transform to apply to the ray, by default the world matrix is used to create a world space ray
Optionalorigin: Vector3Defines the start point of the ray which defaults to the camera position
Returns Ray
the forward ray
- refRay: Ray
get Front Position
-
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
- distance: number
get Hierarchy Bounding Vectors
-
getHierarchyBoundingVectors(
includeDescendants?: boolean,
predicate?: Nullable<(abstractMesh: AbstractMesh) => boolean>,
): { max: Vector3; min: Vector3 }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
- includeDescendants: boolean = true
get Left Target
get Projection Matrix
-
Gets the current projection matrix of the camera.
Parameters
Optionalforce: booleanforces the camera to recompute the matrix without looking at the cached state
Returns Matrix
the projection matrix
get Right Target
get Scene
get Target
-
Return the current target position of the camera. This value is expressed in local space.
Returns Vector3
the target position
get Transformation Matrix
-
Gets the transformation matrix (ie. the multiplication of view by projection matrices)
Returns Matrix
a Matrix
get View Matrix
-
Gets the current view matrix of the camera.
Parameters
Optionalforce: booleanforces the camera to recompute the matrix without looking at the cached state
Returns Matrix
the view matrix
get World Matrix
has State Stored
-
Returns true if a state has been stored by calling storeState method.
Returns boolean
true if state has been stored.
interpolate To
-
interpolateTo(
alpha?: number,
beta?: number,
radius?: number,
target?: Vector3,
targetScreenOffset?: Vector2,
interpolationFactor?: number,
): voidInterpolates 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: numberA value between 0 and 1 that determines the speed of the interpolation.
Returns void
Remarks
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).
- alpha: number = ...
is Active Mesh
-
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
- mesh: Mesh
is Completely In Frustum
-
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
- target: ICullable
is Descendant Of
-
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
- ancestor: Node
is Disposed
-
Gets a boolean indicating if the node has been disposed
Returns boolean
true if the node was disposed
is Enabled
-
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
Remarks
To observe changes to the value returned when calling this with
checkAncestorsset to true (the default, i.e. the effective enabled state), subscribe to onEffectiveEnabledStateChangedObservable. To observe changes to the value returned when calling this withcheckAncestorsset to false (i.e. this node's own enabled state only), subscribe to onEnabledStateChangedObservable. - checkAncestors: boolean = true
is In Frustum
-
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
- target: ICullable
is Ready
-
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
- completeCheck: boolean = false
mark As Dirty
-
Flag the node as dirty (Forcing it to update everything)
Parameters
Optional_property: stringhelps children apply precise "dirtyfication"
Returns Node
this node
rebuild Angles And Radius
-
Rebuilds angles (alpha, beta) and radius from the give position and target
Returns void
remove Behavior
restore State
-
Restored camera state. You must call storeState() first.
Returns boolean
true if restored and false otherwise
serialize
-
Serialiaze the camera setup to a json representation
Returns any
the JSON representation
serialize Animation Ranges
-
Serialize animation ranges into a JSON compatible object
Returns any
serialization object
set Enabled
-
Set the enabled state of this node
Parameters
- value: boolean
defines the new enabled state
Returns void
- value: boolean
set Focal Length
-
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
- value: number
set Mat Up
-
Sets the Y-up to camera up-vector rotation matrix, and the up-vector to Y-up rotation matrix.
Returns void
set Position
-
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
- position: Vector3
set Target
-
setTarget(
target: any,
toBoundingCenter?: boolean,
allowSamePosition?: boolean,
cloneAlphaBetaRadius?: boolean,
): voidDefines 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
- target: any
stop Interpolation
-
Stops any in-progress interpolation.
Returns void
store State
-
Stores the current state of the camera (alpha, beta, radius and target)
Returns Camera
the camera itself
to String
-
Gets a string representation of the camera useful for debug purpose.
Parameters
OptionalfullDetails: booleanDefines that a more verbose level of logging is required
Returns string
the string representation
unfreeze Projection Matrix
-
Unfreeze the projection matrix if it has previously been freezed by freezeProjectionMatrix.
Returns void
update
-
Update the camera state according to the different inputs gathered during the frame.
Returns void
zoom On
-
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
StaticAdd Node Constructor
-
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
- type: string
StaticConstruct
StaticGet Constructor From Name
-
GetConstructorFromName(
type: string,
name: string,
scene: Scene,
interaxial_distance?: number,
isStereoscopicSideBySide?: boolean,
): () => CameraGets 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
- type: string
Camera used to simulate VR rendering (based on ArcRotateCamera)
See
https://doc.babylonjs.com/features/featuresDeepDive/cameras/camera_introduction#vr-device-orientation-cameras