Class FramingBehavior
Implements
Constructors
constructor
-
Returns FramingBehavior
Properties
auto Correct Camera Limits And Sensibility
Define if the behavior should automatically change the configured camera limits and sensibilities.
on Target Framing Animation End Observable
An event triggered when the animation to zoom on target mesh has ended
StaticEasing Function
The easing function used by animations
StaticEasing Mode
The easing mode used by animations
StaticFit Frustum Sides Mode
The camera is not allowed to zoom closer to the mesh than the point at which the adjusted bounding sphere touches the frustum sides
StaticIgnore Bounds Size Mode
The camera can move all the way towards the mesh.
Accessors
attached Node
-
Attached node of this behavior
Returns Nullable<ArcRotateCamera>
default Elevation
-
get defaultElevation(): number
Gets the angle above/below the horizontal plane to return to when the return to default elevation idle behaviour is triggered, in radians.
Returns number
-
set defaultElevation(elevation: number): void
Sets the angle above/below the horizontal plane to return to when the return to default elevation idle behaviour is triggered, in radians.
Parameters
- elevation: number
Returns void
elevation Return Time
-
get elevationReturnTime(): number
Gets the time (in milliseconds) taken to return to the default beta position. Negative value indicates camera should not return to default.
Returns number
-
set elevationReturnTime(speed: number): void
Sets the time (in milliseconds) taken to return to the default beta position. Negative value indicates camera should not return to default.
Parameters
- speed: number
Returns void
elevation Return Wait Time
-
get elevationReturnWaitTime(): number
Gets the delay (in milliseconds) taken before the camera returns to the default beta position.
Returns number
-
set elevationReturnWaitTime(time: number): void
Sets the delay (in milliseconds) taken before the camera returns to the default beta position.
Parameters
- time: number
Returns void
framing Time
-
get framingTime(): number
Gets the transition time when framing the mesh, in milliseconds
Returns number
-
set framingTime(time: number): void
Sets the transition time when framing the mesh, in milliseconds
Parameters
- time: number
Returns void
is User Is Moving
-
get isUserIsMoving(): boolean
Gets a value indicating if the user is moving the camera
Returns boolean
mode
-
get mode(): number
Gets current mode used by the behavior.
Returns number
-
set mode(mode: number): void
Sets the current mode used by the behavior
Parameters
- mode: number
Returns void
name
-
get name(): string
Gets the name of the behavior.
Returns string
position Scale
-
get positionScale(): number
Gets the scale to apply on Y axis to position camera focus. 0.5 by default which means the center of the bounding box.
Returns number
-
set positionScale(scale: number): void
Sets the scale to apply on Y axis to position camera focus. 0.5 by default which means the center of the bounding box.
Parameters
- scale: number
Returns void
radius Scale
-
get radiusScale(): number
Gets the scale applied to the radius
Returns number
-
set radiusScale(radius: number): void
Sets the scale applied to the radius (1 by default)
Parameters
- radius: number
Returns void
zoom Stops Animation
-
get zoomStopsAnimation(): boolean
Gets the flag that indicates if user zooming should stop animation.
Returns boolean
-
set zoomStopsAnimation(flag: boolean): void
Sets the flag that indicates if user zooming should stop animation.
Parameters
- flag: boolean
Returns void
Methods
attach
-
Attaches the behavior to its arc rotate camera.
Parameters
- camera: ArcRotateCamera
Defines the camera to attach the behavior to
Returns void
- camera: ArcRotateCamera
detach
-
Detaches the behavior from its current arc rotate camera.
Returns void
init
-
Initializes the behavior.
Returns void
stop All Animations
-
Stops and removes all animations that have been applied to the camera
Returns void
zoom On Bounding Info
-
zoomOnBoundingInfo(
minimumWorld: Vector3,
maximumWorld: Vector3,
focusOnOriginXZ?: boolean,
onAnimationEnd?: Nullable<() => void>,
): booleanTargets the bounding box info defined by its extends and updates zoom level accordingly.
Parameters
- minimumWorld: Vector3
Determines the smaller position of the bounding box extend
- maximumWorld: Vector3
Determines the bigger position of the bounding box extend
- focusOnOriginXZ: boolean = false
Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
- onAnimationEnd: Nullable<() => void> = null
Callback triggered at the end of the framing animation
Returns boolean
true if the zoom was done
- minimumWorld: Vector3
zoom On Mesh
-
zoomOnMesh(
mesh: AbstractMesh,
focusOnOriginXZ?: boolean,
onAnimationEnd?: Nullable<() => void>,
): voidTargets the given mesh and updates zoom level accordingly.
Parameters
- mesh: AbstractMesh
The mesh to target.
- focusOnOriginXZ: boolean = false
Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
- onAnimationEnd: Nullable<() => void> = null
Callback triggered at the end of the framing animation
Returns void
- mesh: AbstractMesh
zoom On Meshes Hierarchy
-
zoomOnMeshesHierarchy(
meshes: AbstractMesh[],
focusOnOriginXZ?: boolean,
onAnimationEnd?: Nullable<() => void>,
): voidTargets the given meshes with their children and updates zoom level accordingly.
Parameters
- meshes: AbstractMesh[]
The mesh to target.
- focusOnOriginXZ: boolean = false
Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
- onAnimationEnd: Nullable<() => void> = null
Callback triggered at the end of the framing animation
Returns void
- meshes: AbstractMesh[]
zoom On Mesh Hierarchy
-
zoomOnMeshHierarchy(
mesh: AbstractMesh,
focusOnOriginXZ?: boolean,
onAnimationEnd?: Nullable<() => void>,
): voidTargets the given mesh with its children and updates zoom level accordingly.
Parameters
- mesh: AbstractMesh
The mesh to target.
- focusOnOriginXZ: boolean = false
Determines if the camera should focus on 0 in the X and Z axis instead of the mesh
- onAnimationEnd: Nullable<() => void> = null
Callback triggered at the end of the framing animation
Returns void
- mesh: AbstractMesh
The framing behavior (FramingBehavior) is designed to automatically position an ArcRotateCamera when its target is set to a mesh. It is also useful if you want to prevent the camera to go under a virtual horizontal plane.
See
https://doc.babylonjs.com/features/featuresDeepDive/behaviors/cameraBehaviors#framing-behavior