FramingBehavior

The framing behavior (BABYLON.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

http://doc.babylonjs.com/how_to/camera_behaviors#framing-behavior

Hierarchy

  • FramingBehavior

Implements

Index

Properties

defaultElevation

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.

elevationReturnTime

elevationReturnTime: number

Gets the time (in milliseconds) taken to return to the default beta position. Negative value indicates camera should not return to default.

elevationReturnWaitTime

elevationReturnWaitTime: number

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

framingTime

framingTime: number

Gets the transition time when framing the mesh, in milliseconds

isUserIsMoving

isUserIsMoving: boolean

Gets a value indicating if the user is moving the camera

mode

mode: number

Gets current mode used by the behavior.

name

name: string

Gets the name of the behavior.

positionScale

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.

radiusScale

radiusScale: number

Gets the scale applied to the radius

zoomStopsAnimation

zoomStopsAnimation: boolean

Gets the flag that indicates if user zooming should stop animation.

Static EasingFunction

EasingFunction: ExponentialEase

The easing function used by animations

Static EasingMode

EasingMode: number

The easing mode used by animations

Static 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 IgnoreBoundsSizeMode

IgnoreBoundsSizeMode: number

The camera can move all the way towards the mesh.

Methods

attach

  • Attaches the behavior to its arc rotate camera.

    Parameters

    Returns void

detach

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

    Returns void

init

  • init(): void
  • Initializes the behavior.

    Returns void

stopAllAnimations

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

    Returns void

zoomOnBoundingInfo

  • zoomOnBoundingInfo(minimumWorld: Vector3, maximumWorld: Vector3, focusOnOriginXZ?: boolean, onAnimationEnd?: Nullable<function>): void
  • Targets the given mesh and updates zoom level accordingly.

    Parameters

    • minimumWorld: Vector3
    • maximumWorld: Vector3
    • Optional focusOnOriginXZ: boolean

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

    • Optional onAnimationEnd: Nullable<function>

      Callback triggered at the end of the framing animation

    Returns void

zoomOnMesh

  • zoomOnMesh(mesh: AbstractMesh, focusOnOriginXZ?: boolean, onAnimationEnd?: Nullable<function>): 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<function>

      Callback triggered at the end of the framing animation

    Returns void

zoomOnMeshHierarchy

  • zoomOnMeshHierarchy(mesh: AbstractMesh, focusOnOriginXZ?: boolean, onAnimationEnd?: Nullable<function>): 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<function>

      Callback triggered at the end of the framing animation

    Returns void

zoomOnMeshesHierarchy

  • zoomOnMeshesHierarchy(meshes: AbstractMesh[], focusOnOriginXZ?: boolean, onAnimationEnd?: Nullable<function>): 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<function>

      Callback triggered at the end of the framing animation

    Returns void

Generated using TypeDoc