Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FramingBehavior

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/how_to/camera_behaviors#framing-behavior

Hierarchy

  • FramingBehavior

Implements

Index

Properties

autoCorrectCameraLimitsAndSensibilitySearch playground for autoCorrectCameraLimitsAndSensibility

autoCorrectCameraLimitsAndSensibility: boolean

Define if the behavior should automatically change the configured camera limits and sensibilities.

onTargetFramingAnimationEndObservableSearch playground for onTargetFramingAnimationEndObservable

onTargetFramingAnimationEndObservable: Observable<void>

An event triggered when the animation to zoom on target mesh has ended

Static EasingFunctionSearch playground for EasingFunction

EasingFunction: ExponentialEase

The easing function used by animations

Static EasingModeSearch playground for EasingMode

EasingMode: number

The easing mode used by animations

Static FitFrustumSidesModeSearch playground for FitFrustumSidesMode

FitFrustumSidesMode: number

The camera is not allowed to zoom closer to the mesh than the point at which the adjusted bounding sphere touches the frustum sides

Static IgnoreBoundsSizeModeSearch playground for IgnoreBoundsSizeMode

IgnoreBoundsSizeMode: number

The camera can move all the way towards the mesh.

Accessors

defaultElevation

  • get defaultElevation(): number
  • set defaultElevation(elevation: number): any
  • 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

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

elevationReturnTime

  • get elevationReturnTime(): number
  • set elevationReturnTime(speed: number): any
  • Gets the time (in milliseconds) taken to return to the default beta position. Negative value indicates camera should not return to default.

    Returns number

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

elevationReturnWaitTime

  • get elevationReturnWaitTime(): number
  • set elevationReturnWaitTime(time: number): any
  • Gets the delay (in milliseconds) taken before the camera returns to the default beta position.

    Returns number

  • Sets the delay (in milliseconds) taken before the camera returns to the default beta position.

    Parameters

    • time: number

    Returns any

framingTime

  • get framingTime(): number
  • set framingTime(time: number): any
  • Gets the transition time when framing the mesh, in milliseconds

    Returns number

  • Sets the transition time when framing the mesh, in milliseconds

    Parameters

    • time: number

    Returns any

isUserIsMoving

  • get isUserIsMoving(): boolean
  • Gets a value indicating if the user is moving the camera

    Returns boolean

mode

  • get mode(): number
  • set mode(mode: number): any
  • Gets current mode used by the behavior.

    Returns number

  • Sets the current mode used by the behavior

    Parameters

    • mode: number

    Returns any

name

  • get name(): string
  • Gets the name of the behavior.

    Returns string

positionScale

  • get positionScale(): number
  • set positionScale(scale: number): any
  • 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

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

radiusScale

  • get radiusScale(): number
  • set radiusScale(radius: number): any
  • Gets the scale applied to the radius

    Returns number

  • Sets the scale applied to the radius (1 by default)

    Parameters

    • radius: number

    Returns any

zoomStopsAnimation

  • get zoomStopsAnimation(): boolean
  • set zoomStopsAnimation(flag: boolean): any
  • Gets the flag that indicates if user zooming should stop animation.

    Returns boolean

  • Sets the flag that indicates if user zooming should stop animation.

    Parameters

    • flag: boolean

    Returns any

Methods

attachSearch playground for attach

  • Attaches the behavior to its arc rotate camera.

    Parameters

    Returns void

detachSearch playground for detach

  • detach(): void
  • Detaches the behavior from its current arc rotate camera.

    Returns void

initSearch playground for init

  • init(): void
  • Initializes the behavior.

    Returns void

stopAllAnimationsSearch playground for stopAllAnimations

  • stopAllAnimations(): void
  • Stops and removes all animations that have been applied to the camera

    Returns void

zoomOnBoundingInfoSearch playground for zoomOnBoundingInfo

  • zoomOnBoundingInfo(minimumWorld: Vector3, maximumWorld: Vector3, focusOnOriginXZ?: boolean, onAnimationEnd?: Nullable<() => void>): void
  • Targets 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

    • Optional focusOnOriginXZ: boolean

      Determines if the camera should focus on 0 in the X and Z axis instead of the mesh

    • Optional onAnimationEnd: Nullable<() => void>

      Callback triggered at the end of the framing animation

    Returns void

zoomOnMeshSearch playground for zoomOnMesh

  • zoomOnMesh(mesh: AbstractMesh, focusOnOriginXZ?: boolean, onAnimationEnd?: Nullable<() => void>): void
  • Targets the given mesh and updates zoom level accordingly.

    Parameters

    • mesh: AbstractMesh

      The mesh to target.

    • Optional focusOnOriginXZ: boolean

      Determines if the camera should focus on 0 in the X and Z axis instead of the mesh

    • Optional onAnimationEnd: Nullable<() => void>

      Callback triggered at the end of the framing animation

    Returns void

zoomOnMeshHierarchySearch playground for zoomOnMeshHierarchy

  • zoomOnMeshHierarchy(mesh: AbstractMesh, focusOnOriginXZ?: boolean, onAnimationEnd?: Nullable<() => void>): void
  • Targets the given mesh with its children and updates zoom level accordingly.

    Parameters

    • mesh: AbstractMesh

      The mesh to target.

    • Optional focusOnOriginXZ: boolean

      Determines if the camera should focus on 0 in the X and Z axis instead of the mesh

    • Optional onAnimationEnd: Nullable<() => void>

      Callback triggered at the end of the framing animation

    Returns void

zoomOnMeshesHierarchySearch playground for zoomOnMeshesHierarchy

  • zoomOnMeshesHierarchy(meshes: AbstractMesh[], focusOnOriginXZ?: boolean, onAnimationEnd?: Nullable<() => void>): void
  • Targets the given meshes with their children and updates zoom level accordingly.

    Parameters

    • meshes: AbstractMesh[]

      The mesh to target.

    • Optional focusOnOriginXZ: boolean

      Determines if the camera should focus on 0 in the X and Z axis instead of the mesh

    • Optional onAnimationEnd: Nullable<() => void>

      Callback triggered at the end of the framing animation

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method