Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • FramingBehavior

Implements

Index

Constructors

Properties

autoCorrectCameraLimitsAndSensibility: boolean

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

onTargetFramingAnimationEndObservable: Observable<void>

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

EasingFunction: ExponentialEase

The easing function used by animations

EasingMode: number

The easing mode used by animations

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

IgnoreBoundsSizeMode: number

The camera can move all the way towards the mesh.

Accessors

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

  • get elevationReturnTime(): number
  • set elevationReturnTime(speed: number): void
  • 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 void

  • get elevationReturnWaitTime(): number
  • set elevationReturnWaitTime(time: number): void
  • 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 void

  • get framingTime(): number
  • set framingTime(time: number): void
  • 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 void

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

    Returns boolean

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

    Returns number

  • Sets the current mode used by the behavior

    Parameters

    • mode: number

    Returns void

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

    Returns string

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

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

    Returns number

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

    Parameters

    • radius: number

    Returns void

  • get zoomStopsAnimation(): boolean
  • set zoomStopsAnimation(flag: boolean): void
  • 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 void

Methods

  • Attaches the behavior to its arc rotate camera.

    Parameters

    Returns void

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

    Returns void

  • init(): void
  • Initializes the behavior.

    Returns void

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

    Returns void

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

    true if the zoom was done

  • 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

  • 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

  • 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
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static property
  • Static method

Settings

Theme