Class ArcRotateCamera
Hierarchy
Implements
Index
Constructors
Properties
- allow
Upside Down - alpha
- animations
- beta
- camera
Direction - camera
Rig Mode - camera
Rotation - check
Collisions - collision
Radius - custom
Render Targets - fov
- fov
Mode - id
- ignore
Parent Scaling - inertia
- inertial
Alpha Offset - inertial
Beta Offset - inertial
PanningX - inertial
PanningY - inertial
Radius Offset - inputs
- inspectable
Custom Properties - interaxial
Distance - inverse
Rotation Speed - invert
Rotation - is
Intermediate - is
Rig Camera - is
Stereoscopic Side BySide - layer
Mask - locked
Target - lower
Alpha Limit - lower
Beta Limit - lower
Radius Limit - map
Panning - maxZ
- metadata
- minZ
- mode
- name
- no
Rotation Constraint - on
After Check Inputs Observable - on
Collide - on
Dispose Observable - on
Mesh Target Changed Observable - on
Projection Matrix Changed Observable - on
Ready - on
Restore State Observable - on
View Matrix Changed Observable - ortho
Bottom - ortho
Left - ortho
Right - ortho
Top - output
Render Target - override
Clone Alpha Beta Radius - panning
Axis - panning
Distance Limit - panning
Inertia - panning
Origin Target - pinch
ToPan Max Distance - projection
Plane Tilt - radius
- render
Pass Id - reserved
Data Store - rig
Parent - rotation
- rotation
Quaternion - speed
- state
- target
Screen Offset - unique
Id - update
UpVector From Rotation - upper
Alpha Limit - upper
Beta Limit - upper
Radius Limit - use
Input ToRestore State - viewport
- zoom
OnFactor - FOVMODE_
HORIZONTAL_ FIXED - FOVMODE_
VERTICAL_ FIXED - Force
Attach Control ToAlways Prevent Default - 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 - RIG_
MODE_ WEBVR
Accessors
- absolute
Rotation - angular
SensibilityX - angular
SensibilityY - animation
Properties Override - auto
Rotation Behavior - behaviors
- bouncing
Behavior - do
Not Serialize - framing
Behavior - global
Position - is
Left Camera - is
Right Camera - keys
Down - keys
Left - keys
Right - keys
Up - left
Camera - on
Cloned Observable - on
Dispose - on
Enabled State Changed Observable - panning
Sensibility - parent
- pinch
Delta Percentage - pinch
Precision - position
- rig
Post Process - right
Camera - screen
Area - target
- target
Host - up
Vector - use
Auto Rotation Behavior - use
Bouncing Behavior - use
Framing Behavior - use
Natural Pinch Zoom - wheel
Delta Percentage - wheel
Precision - world
Matrix From Cache - zoom
ToMouse Location
Methods
- _get
First Post Process - add
Behavior - apply
Vertical Correction - attach
Control - attach
Post Process - begin
Animation - clone
- compute
World Matrix - create
Animation Range - create
Rig Camera - delete
Animation Range - detach
Control - detach
Post Process - dispose
- focus
On - freeze
Projection Matrix - get
Active Meshes - get
Animation ByName - get
Animation Range - get
Animation Ranges - get
Behavior ByName - get
Child Meshes - get
Children - get
Class Name - get
Descendants - get
Direction - get
Direction ToRef - get
Engine - get
Forward Ray - get
Forward Ray ToRef - get
Front Position - get
Hierarchy Bounding Vectors - get
Left Target - get
Projection Matrix - get
Right Target - get
Scene - get
Target - get
Transformation Matrix - get
View Matrix - get
World Matrix - is
Active Mesh - is
Completely InFrustum - is
Descendant Of - is
Disposed - is
Enabled - is
InFrustum - is
Ready - mark
AsDirty - rebuild
Angles And Radius - remove
Behavior - restore
State - serialize
- serialize
Animation Ranges - set
Enabled - set
Mat Up - set
Position - set
Target - store
State - to
String - unfreeze
Projection Matrix - update
- zoom
On - Add
Node Constructor - Construct
- Get
Constructor From Name - Parse
- Parse
Animation Ranges
Constructors
constructor
-
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
allow Upside DownSearch playground for allowUpsideDown
Allows the camera to be completely reversed. If false the camera can not arrive upside down.
alphaSearch playground for alpha
Defines the rotation angle of the camera along the longitudinal axis.
animationsSearch playground for animations
Gets a list of Animations associated with the node
betaSearch playground for beta
Defines the rotation angle of the camera along the latitudinal axis.
camera DirectionSearch playground for cameraDirection
Define the current direction the camera is moving to
camera Rig ModeSearch playground for cameraRigMode
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 RotationSearch playground for cameraRotation
Define the current rotation the camera is rotating to
check CollisionsSearch playground for checkCollisions
Defines whether the camera should check collision with the objects oh the scene.
collision RadiusSearch playground for collisionRadius
Defines the collision radius of the camera. This simulates a sphere around the camera.
custom Render TargetsSearch playground for customRenderTargets
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)
fovSearch playground for fov
Field Of View is set in Radians. (default is 0.8)
fov ModeSearch playground for fovMode
fovMode sets the camera frustum bounds to the viewport bounds. (default is FOVMODE_VERTICAL_FIXED)
idSearch playground for id
Gets or sets the id of the node
ignore Parent ScalingSearch playground for ignoreParentScaling
Gets or sets a boolean indicating that the scaling of the parent hierarchy will not be taken in account by the camera
inertiaSearch playground for inertia
Define the default inertia of the camera. This helps giving a smooth feeling to the camera movement.
inertial Alpha OffsetSearch playground for inertialAlphaOffset
Current inertia value on the longitudinal axis. The bigger this number the longer it will take for the camera to stop.
inertial Beta OffsetSearch playground for inertialBetaOffset
Current inertia value on the latitudinal axis. The bigger this number the longer it will take for the camera to stop.
inertial PanningXSearch playground for inertialPanningX
Defines the current inertia value used during panning of the camera along the X axis.
inertial PanningYSearch playground for inertialPanningY
Defines the current inertia value used during panning of the camera along the Y axis.
inertial Radius OffsetSearch playground for inertialRadiusOffset
Current inertia value on the radius axis. The bigger this number the longer it will take for the camera to stop.
inputsSearch playground for inputs
Defines the input associated to the camera.
inspectable Custom PropertiesSearch playground for inspectableCustomProperties
List of inspectable custom properties (used by the Inspector)
interaxial DistanceSearch playground for interaxialDistance
Defines the distance between both "eyes" in case of a RIG
inverse Rotation SpeedSearch playground for inverseRotationSpeed
Speed multiplier for inverse camera panning
invert RotationSearch playground for invertRotation
Reverses mouselook direction to 'natural' panning as opposed to traditional direct panning
is IntermediateSearch playground for isIntermediate
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 CameraSearch playground for isRigCamera
Is this camera a part of a rig system?
is Stereoscopic Side BySideSearch playground for isStereoscopicSideBySide
Defines if stereoscopic rendering is done side by side or over under.
layer MaskSearch playground for layerMask
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 TargetSearch playground for lockedTarget
Define the current target of the camera as an object or a position. Please note that locking a target will disable panning.
lower Alpha LimitSearch playground for lowerAlphaLimit
Minimum allowed angle on the longitudinal axis. This can help limiting how the Camera is able to move in the scene.
lower Beta LimitSearch playground for lowerBetaLimit
Minimum allowed angle on the latitudinal axis. This can help limiting how the Camera is able to move in the scene.
lower Radius LimitSearch playground for lowerRadiusLimit
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.
map PanningSearch playground for mapPanning
Defines if camera will eliminate transform on y axis.
maxZSearch playground for maxZ
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.
metadataSearch playground for metadata
Gets or sets an object used to store user defined information for the node
minZSearch playground for minZ
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.
modeSearch playground for mode
Define the mode of the camera (Camera.PERSPECTIVE_CAMERA or Camera.ORTHOGRAPHIC_CAMERA)
nameSearch playground for name
Gets or sets the name of the node
no Rotation ConstraintSearch playground for noRotationConstraint
Add constraint to the camera to prevent it to move freely in all directions and around all axis.
on After Check Inputs ObservableSearch playground for onAfterCheckInputsObservable
Observable triggered when the inputs have been processed.
on CollideSearch playground for onCollide
Event raised when the camera is colliding with a mesh.
Type declaration
-
-
Parameters
-
collidedMesh: AbstractMesh
Returns void
-
-
on Dispose ObservableSearch playground for onDisposeObservable
An event triggered when the mesh is disposed
on Mesh Target Changed ObservableSearch playground for onMeshTargetChangedObservable
Observable triggered when the mesh target has been changed on the camera.
on Projection Matrix Changed ObservableSearch playground for onProjectionMatrixChangedObservable
Observable triggered when the camera Projection matrix has changed.
on ReadySearch playground for onReady
Callback raised when the node is ready to be used
on Restore State ObservableSearch playground for onRestoreStateObservable
Observable triggered when reset has been called and applied to the camera.
on View Matrix Changed ObservableSearch playground for onViewMatrixChangedObservable
Observable triggered when the camera view matrix has changed.
ortho BottomSearch playground for orthoBottom
Define the current limit on the bottom side for an orthographic camera In scene unit
ortho LeftSearch playground for orthoLeft
Define the current limit on the left side for an orthographic camera In scene unit
ortho RightSearch playground for orthoRight
Define the current limit on the right side for an orthographic camera In scene unit
ortho TopSearch playground for orthoTop
Define the current limit on the top side for an orthographic camera In scene unit
output Render TargetSearch playground for outputRenderTarget
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 RadiusSearch playground for overrideCloneAlphaBetaRadius
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 AxisSearch playground for panningAxis
Defines the allowed panning axis.
panning Distance LimitSearch playground for panningDistanceLimit
Defines the maximum distance the camera can pan. This could help keeping the camera always in your scene.
panning InertiaSearch playground for panningInertia
Defines the value of the inertia used during panning. 0 would mean stop inertia and one would mean no deceleration at all.
panning Origin TargetSearch playground for panningOriginTarget
Defines the target of the camera before panning.
pinch ToPan Max DistanceSearch playground for pinchToPanMaxDistance
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 TiltSearch playground for projectionPlaneTilt
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
radiusSearch playground for radius
Defines the radius of the camera from it s target point.
render Pass IdSearch playground for renderPassId
Render pass id used by the camera to render into the main framebuffer
reserved Data StoreSearch playground for reservedDataStore
For internal use only. Please do not use.
Optional rig ParentSearch playground for rigParent
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)
rotationSearch playground for rotation
Define the current rotation of the camera
rotation QuaternionSearch playground for rotationQuaternion
Define the current rotation of the camera as a quaternion to prevent Gimbal lock
speedSearch playground for speed
Define the current speed of the camera
stateSearch playground for state
Gets or sets a string used to store user defined state for the node
target Screen OffsetSearch playground for targetScreenOffset
Defines a screen offset for the camera position.
unique IdSearch playground for uniqueId
Gets or sets the unique id of the node
update UpVector From RotationSearch playground for updateUpVectorFromRotation
When set, the up vector of the camera will be updated by the rotation of the camera
upper Alpha LimitSearch playground for upperAlphaLimit
Maximum allowed angle on the longitudinal axis. This can help limiting how the Camera is able to move in the scene.
upper Beta LimitSearch playground for upperBetaLimit
Maximum allowed angle on the latitudinal axis. This can help limiting how the Camera is able to move in the scene.
upper Radius LimitSearch playground for upperRadiusLimit
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 ToRestore StateSearch playground for useInputToRestoreState
Define if double tap/click is used to restore the previously saved state of the camera.
viewportSearch playground for 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 OnFactorSearch playground for zoomOnFactor
Defines how much the radius should be scaled while zooming on a particular mesh (through the zoomOn function)
Static Readonly FOVMODE_ HORIZONTAL_ FIXEDSearch playground for FOVMODE_HORIZONTAL_FIXED
This setting aligns the left and right bounds of the viewport to the left and right bounds of the camera frustum.
Static Readonly FOVMODE_ VERTICAL_ FIXEDSearch playground for FOVMODE_VERTICAL_FIXED
This is the default FOV mode for perspective cameras. This setting aligns the upper and lower bounds of the viewport to the upper and lower bounds of the camera frustum.
Static Force Attach Control ToAlways Prevent DefaultSearch playground for ForceAttachControlToAlwaysPreventDefault
Defines if by default attaching controls should prevent the default javascript event to continue.
Static Readonly ORTHOGRAPHIC_ CAMERASearch playground for ORTHOGRAPHIC_CAMERA
This helps creating camera with an orthographic mode. Orthographic is commonly used in engineering as a means to produce object specifications that communicate dimensions unambiguously, each line of 1 unit length (cm, meter..whatever) will appear to have the same length everywhere on the drawing. This allows the drafter to dimension only a subset of lines and let the reader know that other lines of that length on the drawing are also that length in reality. Every parallel line in the drawing is also parallel in the object.
Static Readonly PERSPECTIVE_ CAMERASearch playground for PERSPECTIVE_CAMERA
This is the default projection mode used by the cameras. It helps recreating a feeling of perspective and better appreciate depth. This is the best way to simulate real life cameras.
Static Readonly RIG_ MODE_ CUSTOMSearch playground for RIG_MODE_CUSTOM
Custom rig mode allowing rig cameras to be populated manually with any number of cameras
Static Readonly RIG_ MODE_ NONESearch playground for RIG_MODE_NONE
This specifies there is no need for a camera rig. Basically only one eye is rendered corresponding to the camera.
Static Readonly RIG_ MODE_ STEREOSCOPIC_ ANAGLYPHSearch playground for RIG_MODE_STEREOSCOPIC_ANAGLYPH
Simulates a camera Rig with one blue eye and one red eye. This can be use with 3d blue and red glasses.
Static Readonly RIG_ MODE_ STEREOSCOPIC_ INTERLACEDSearch playground for RIG_MODE_STEREOSCOPIC_INTERLACED
Defines that both eyes of the camera will be rendered on successive lines interlaced for passive 3d monitors.
Static Readonly RIG_ MODE_ STEREOSCOPIC_ OVERUNDERSearch playground for RIG_MODE_STEREOSCOPIC_OVERUNDER
Defines that both eyes of the camera will be rendered over under each other.
Static Readonly RIG_ MODE_ STEREOSCOPIC_ SIDEBYSIDE_ CROSSEYEDSearch playground for RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_CROSSEYED
Defines that both eyes of the camera will be rendered side by side with a none parallel target.
Static Readonly RIG_ MODE_ STEREOSCOPIC_ SIDEBYSIDE_ PARALLELSearch playground for RIG_MODE_STEREOSCOPIC_SIDEBYSIDE_PARALLEL
Defines that both eyes of the camera will be rendered side by side with a parallel target.
Static Readonly RIG_ MODE_ VRSearch playground for RIG_MODE_VR
Defines that both eyes of the camera should be renderered in a VR mode (carbox).
Static Readonly RIG_ MODE_ WEBVRSearch playground for RIG_MODE_WEBVR
Defines that both eyes of the camera should be renderered in a VR mode (webVR).
Accessors
absolute Rotation
-
Returns the current camera absolute rotation
Returns Quaternion
angular SensibilityX
-
Gets or Set the pointer angular sensibility along the X axis or how fast is the camera rotating.
Returns number
-
Gets or Set the pointer angular sensibility along the X axis or how fast is the camera rotating.
Parameters
-
value: number
Returns any
-
angular SensibilityY
-
Gets or Set the pointer angular sensibility along the Y axis or how fast is the camera rotating.
Returns number
-
Gets or Set the pointer angular sensibility along the Y axis or how fast is the camera rotating.
Parameters
-
value: number
Returns any
-
animation Properties Override
-
Gets or sets the animation properties override
Returns Nullable<AnimationPropertiesOverride>
-
Gets or sets the animation properties override
Parameters
-
value: Nullable<AnimationPropertiesOverride>
Returns any
-
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
-
Gets or sets a boolean used to define if the node must be serialized
Returns boolean
-
Gets or sets a boolean used to define if the node must be serialized
Parameters
-
value: boolean
Returns any
-
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
is Left Camera
-
Gets the left camera of a rig setup in case of Rigged Camera
Returns boolean
is Right Camera
-
Gets the right camera of a rig setup in case of Rigged Camera
Returns boolean
keys Down
-
Gets or Set the list of keyboard keys used to control beta angle in a negative direction.
Returns number[]
-
Gets or Set the list of keyboard keys used to control beta angle in a negative direction.
Parameters
-
value: number[]
Returns any
-
keys Left
-
Gets or Set the list of keyboard keys used to control alpha angle in a negative direction.
Returns number[]
-
Gets or Set the list of keyboard keys used to control alpha angle in a negative direction.
Parameters
-
value: number[]
Returns any
-
keys Right
-
Gets or Set the list of keyboard keys used to control alpha angle in a positive direction.
Returns number[]
-
Gets or Set the list of keyboard keys used to control alpha angle in a positive direction.
Parameters
-
value: number[]
Returns any
-
keys Up
-
Gets or Set the list of keyboard keys used to control beta angle in a positive direction.
Returns number[]
-
Gets or Set the list of keyboard keys used to control beta angle in a positive direction.
Parameters
-
value: number[]
Returns any
-
left Camera
-
Gets the left camera of a rig setup in case of Rigged Camera
Returns Nullable<FreeCamera>
on Cloned Observable
-
An event triggered when the node is cloned
Returns Observable<Node>
on Dispose
-
Sets a callback that will be raised when the node will be disposed
Parameters
-
callback: () => void
-
-
Returns void
-
-
Returns any
-
on Enabled State Changed Observable
-
An event triggered when the enabled state of the node changes
Returns Observable<boolean>
panning Sensibility
-
Gets or Set the pointer panning sensibility or how fast is the camera moving.
Returns number
-
Gets or Set the pointer panning sensibility or how fast is the camera moving.
Parameters
-
value: number
Returns any
-
parent
pinch Delta Percentage
-
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
-
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.
Parameters
-
value: number
Returns any
-
pinch Precision
-
Gets or Set the pointer pinch precision or how fast is the camera zooming.
Returns number
-
Gets or Set the pointer pinch precision or how fast is the camera zooming.
Parameters
-
value: number
Returns any
-
position
rig Post Process
-
Gets the post process used by the rig cameras
Returns Nullable<PostProcess>
right Camera
-
Gets the right camera of a rig setup in case of Rigged Camera
Returns Nullable<FreeCamera>
screen Area
-
The screen area in scene units squared
Returns number
target
target Host
-
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>
-
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.
Parameters
-
value: Nullable<AbstractMesh>
Returns any
-
up Vector
-
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.
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 any
-
use Auto Rotation Behavior
-
Defines if the auto rotation behavior of the camera is enabled on the camera.
Returns boolean
-
Defines if the auto rotation behavior of the camera is enabled on the camera.
Parameters
-
value: boolean
Returns any
-
use Bouncing Behavior
-
Defines if the bouncing behavior of the camera is enabled on the camera.
Returns boolean
-
Defines if the bouncing behavior of the camera is enabled on the camera.
Parameters
-
value: boolean
Returns any
-
use Framing Behavior
-
Defines if the framing behavior of the camera is enabled on the camera.
Returns boolean
-
Defines if the framing behavior of the camera is enabled on the camera.
Parameters
-
value: boolean
Returns any
-
use Natural Pinch Zoom
-
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
-
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.
Parameters
-
value: boolean
Returns any
-
wheel Delta Percentage
-
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
-
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.
Parameters
-
value: number
Returns any
-
wheel Precision
-
Gets or Set the mouse wheel precision or how fast is the camera zooming.
Returns number
-
Gets or Set the mouse wheel precision or how fast is the camera zooming.
Parameters
-
value: number
Returns any
-
world Matrix From Cache
-
Returns directly the latest state of the mesh World matrix. A Matrix is returned.
Returns Matrix
zoom ToMouse Location
-
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
-
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.
Parameters
-
value: boolean
Returns any
-
Methods
_get First Post ProcessSearch playground for _getFirstPostProcess
-
Internal, gets the first post process.
Returns Nullable<PostProcess>
the first post process to be run on this camera.
add BehaviorSearch playground for addBehavior
apply Vertical CorrectionSearch playground for applyVerticalCorrection
-
Automatically tilts the projection plane, using
projectionPlaneTilt
, to correct the perspective effect on vertical lines.Returns void
attach ControlSearch playground for attachControl
-
Attach the input controls to a specific dom element to get the input from.
Parameters
-
Optional noPreventDefault: boolean
Defines 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.
-
Optional noPreventDefault: boolean
Defines whether event caught by the controls should call preventdefault() (https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault)
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
Returns void
-
-
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
-
-
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 Post ProcessSearch playground for attachPostProcess
-
Attach a post process to the camera.
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
the position the post process has been inserted at
-
begin AnimationSearch playground for beginAnimation
-
Will start the animation sequence
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)
-
-
Returns void
-
-
Returns Nullable<Animatable>
the object created for this animation. If range does not exist, it will return null
-
cloneSearch playground for clone
compute World MatrixSearch playground for computeWorldMatrix
-
Compute the world matrix of the camera.
Returns Matrix
the camera world matrix
create Animation RangeSearch playground for createAnimationRange
-
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
-
create Rig CameraSearch playground for createRigCamera
-
Parameters
-
name: string
-
cameraIndex: number
Returns Camera
-
delete Animation RangeSearch playground for deleteAnimationRange
-
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 ControlSearch playground for detachControl
-
Detach the current controls from the specified dom element.
Returns void
detach Post ProcessSearch playground for detachPostProcess
-
Detach a post process to the camera.
Parameters
-
postProcess: PostProcess
The post process to detach from the camera
Returns void
-
disposeSearch playground for dispose
-
Destroy the camera and release the current resources hold by it.
Returns void
focus OnSearch playground for focusOn
-
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 Projection MatrixSearch playground for freezeProjectionMatrix
-
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
-
get Active MeshesSearch playground for getActiveMeshes
-
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 ByNameSearch playground for getAnimationByName
get Animation RangeSearch playground for getAnimationRange
-
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
-
get Animation RangesSearch playground for getAnimationRanges
-
Gets the list of all animation ranges defined on this node
Returns Nullable<AnimationRange>[]
an array
get Behavior ByNameSearch playground for getBehaviorByName
get Child MeshesSearch playground for getChildMeshes
-
Get all child-meshes of this node
Type parameters
-
T: 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) => 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
-
-
Parameters
-
node: Node
Returns node is T
-
-
-
Returns T[]
an array of AbstractMesh
-
-
Get all child-meshes of this node
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
-
-
Parameters
-
node: Node
Returns boolean
-
-
-
Returns AbstractMesh[]
an array of AbstractMesh
-
get ChildrenSearch playground for getChildren
-
Get all direct children of this node
Type parameters
-
T: Node
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
-
-
Parameters
-
node: Node
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[]
an array of Node
-
-
Get all direct children of this 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
-
-
Parameters
-
node: Node
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[]
an array of Node
-
get Class NameSearch playground for getClassName
-
Gets the current object class name.
Returns string
the class name
get DescendantsSearch playground for getDescendants
-
Will return all nodes that have this node as ascendant
Type parameters
-
T: Node
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
-
-
Parameters
-
node: Node
Returns node is T
-
-
-
Returns T[]
all children nodes of all types
-
-
Will return all nodes that have this node as ascendant
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
-
-
Parameters
-
node: Node
Returns boolean
-
-
-
Returns Node[]
all children nodes of all types
-
get DirectionSearch playground for getDirection
get Direction ToRefSearch playground for getDirectionToRef
get EngineSearch playground for getEngine
-
Gets the engine of the node
Returns Engine
a Engine
get Forward RaySearch playground for getForwardRay
-
Gets a ray in the forward direction from the camera.
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
the forward ray
-
get Forward Ray ToRefSearch playground for getForwardRayToRef
-
Gets a ray in the forward direction from the camera.
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
the forward ray
-
get Front PositionSearch playground for getFrontPosition
-
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
-
get Hierarchy Bounding VectorsSearch playground for getHierarchyBoundingVectors
-
Return the minimum and maximum world vectors of the entire hierarchy under current node
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 }
the new bounding vectors
-
get Left TargetSearch playground for getLeftTarget
get Projection MatrixSearch playground for getProjectionMatrix
-
Gets the current projection matrix of the camera.
Parameters
-
Optional force: boolean
forces the camera to recompute the matrix without looking at the cached state
Returns Matrix
the projection matrix
-
get Right TargetSearch playground for getRightTarget
get SceneSearch playground for getScene
-
Gets the scene of the node
Returns Scene
a scene
get TargetSearch playground for getTarget
-
Return the current target position of the camera. This value is expressed in local space.
Returns Vector3
the target position
get Transformation MatrixSearch playground for getTransformationMatrix
-
Gets the transformation matrix (ie. the multiplication of view by projection matrices)
Returns Matrix
a Matrix
get View MatrixSearch playground for getViewMatrix
-
Gets the current view matrix of the camera.
Parameters
-
Optional force: boolean
forces the camera to recompute the matrix without looking at the cached state
Returns Matrix
the view matrix
-
get World MatrixSearch playground for getWorldMatrix
-
Gets the current world matrix of the camera
Returns Matrix
is Active MeshSearch playground for isActiveMesh
-
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
-
is Completely InFrustumSearch playground for isCompletelyInFrustum
-
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 Descendant OfSearch playground for isDescendantOf
-
Is this node a descendant of the given node? The function will iterate up the hierarchy until the ancestor was found or no more parents defined
Parameters
-
ancestor: Node
defines the parent node to inspect
Returns boolean
a boolean indicating if this node is a descendant of the given node
-
is DisposedSearch playground for isDisposed
-
Gets a boolean indicating if the node has been disposed
Returns boolean
true if the node was disposed
is EnabledSearch playground for isEnabled
-
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
-
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
whether this node (and its parent) is enabled
-
is InFrustumSearch playground for isInFrustum
-
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
-
Optional checkRigCameras: boolean
If the rig cameras should be checked (eg. with webVR camera both eyes should be checked) (Default: false)
Returns boolean
true if the object is in frustum otherwise false
-
is ReadySearch playground for isReady
-
Is this camera ready to be used/rendered
Parameters
-
Optional completeCheck: boolean
defines if a complete check (including post processes) has to be done (false by default)
Returns boolean
true if the camera is ready
-
mark AsDirtySearch playground for markAsDirty
-
Flag the node as dirty (Forcing it to update everything)
Parameters
-
Optional property: string
helps children apply precise "dirtyfication"
Returns Node
this node
-
rebuild Angles And RadiusSearch playground for rebuildAnglesAndRadius
-
Rebuilds angles (alpha, beta) and radius from the give position and target
Returns void
remove BehaviorSearch playground for removeBehavior
restore StateSearch playground for restoreState
-
Restored camera state. You must call storeState() first.
Returns boolean
true if restored and false otherwise
serializeSearch playground for serialize
-
Serialiaze the camera setup to a json representation
Returns any
the JSON representation
serialize Animation RangesSearch playground for serializeAnimationRanges
-
Serialize animation ranges into a JSON compatible object
Returns any
serialization object
set EnabledSearch playground for setEnabled
-
Set the enabled state of this node
Parameters
-
value: boolean
defines the new enabled state
Returns void
-
set Mat UpSearch playground for setMatUp
-
Sets the Y-up to camera up-vector rotation matrix, and the up-vector to Y-up rotation matrix.
Returns void
set PositionSearch playground for setPosition
-
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
-
set TargetSearch playground for setTarget
-
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: AbstractMesh | Vector3
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
-
store StateSearch playground for storeState
-
Stores the current state of the camera (alpha, beta, radius and target)
Returns Camera
the camera itself
to StringSearch playground for toString
-
Gets a string representation of the camera useful for debug purpose.
Parameters
-
Optional fullDetails: boolean
Defines that a more verbose level of logging is required
Returns string
the string representation
-
unfreeze Projection MatrixSearch playground for unfreezeProjectionMatrix
-
Unfreeze the projection matrix if it has previously been freezed by freezeProjectionMatrix.
Returns void
updateSearch playground for update
-
Update the camera state according to the different inputs gathered during the frame.
Returns void
zoom OnSearch playground for zoomOn
-
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
-
Static Add Node ConstructorSearch playground for AddNodeConstructor
-
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
-
Static ConstructSearch playground for Construct
-
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
-
Optional options: any
defines optional options to transmit to constructors
Returns Nullable<() => Node>
the new constructor or null
-
Static Get Constructor From NameSearch playground for GetConstructorFromName
-
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
-
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
a factory method to construct the camera
-
-
Returns Camera
-
-
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.
https://doc.babylonjs.com/babylon101/cameras#arc-rotate-camera