FollowCamera

A follow camera takes a mesh as a target and follows it as it moves. Both a free camera version followCamera and an arc rotate version arcFollowCamera are available.

see

http://doc.babylonjs.com/features/cameras#follow-camera

Hierarchy

Index

Constructors

constructor

Find examples in Playground

Properties

cameraAcceleration

Find examples in Playground
cameraAcceleration: number

Define how fast the camera can accelerate to follow it s target.

cameraDirection

Find examples in Playground
cameraDirection: Vector3

Define the current direction the camera is moving to

cameraRotation

Find examples in Playground
cameraRotation: Vector2

Define the current rotation the camera is rotating to

heightOffset

Find examples in Playground
heightOffset: number

Define a height offset between the camera and the object it follows. It can help following an object from the top (like a car chaing a plane)

inputs

Find examples in Playground

Defines the input associated with the camera.

lockedTarget

Find examples in Playground
lockedTarget: Nullable<AbstractMesh>

Define the target of the camera.

lowerHeightOffsetLimit

Find examples in Playground
lowerHeightOffsetLimit: Nullable<number>

Minimum allowed height of camera position relative to target object. This can help limiting how the Camera is able to move in the scene.

lowerRadiusLimit

Find examples in Playground
lowerRadiusLimit: Nullable<number>

Minimum allowed distance of the camera to the axis of rotation (The camera can not get closer). This can help limiting how the Camera is able to move in the scene.

lowerRotationOffsetLimit

Find examples in Playground
lowerRotationOffsetLimit: Nullable<number>

Minimum allowed angle to camera position relative to target object. This can help limiting how the Camera is able to move in the scene.

maxCameraSpeed

Find examples in Playground
maxCameraSpeed: number

Define the speed limit of the camera following an object.

noRotationConstraint

Find examples in Playground
noRotationConstraint: boolean

Add cconstraint to the camera to prevent it to move freely in all directions and around all axis.

radius

Find examples in Playground
radius: number

Distance the follow camera should follow an object at

rotation

Find examples in Playground
rotation: Vector3

Define the current rotation of the camera

rotationOffset

Find examples in Playground
rotationOffset: number

Define a rotation offset between the camera and the object it follows

rotationQuaternion

Find examples in Playground
rotationQuaternion: Quaternion

Define the current rotation of the camera as a quaternion to prevent Gimbal lock

speed

Find examples in Playground
speed: number

Define the current speed of the camera

updateUpVectorFromRotation

Find examples in Playground
updateUpVectorFromRotation: boolean

When set, the up vector of the camera will be updated by the rotation of the camera

upperHeightOffsetLimit

Find examples in Playground
upperHeightOffsetLimit: Nullable<number>

Maximum allowed height of camera position relative to target object. This can help limiting how the Camera is able to move in the scene.

upperRadiusLimit

Find examples in Playground
upperRadiusLimit: Nullable<number>

Maximum allowed distance of the camera to the axis of rotation (The camera can not get further). This can help limiting how the Camera is able to move in the scene.

upperRotationOffsetLimit

Find examples in Playground
upperRotationOffsetLimit: Nullable<number>

Maximum allowed angle to camera position relative to target object. This can help limiting how the Camera is able to move in the scene.

Methods

attachControl

Find examples in Playground
  • attachControl(element: HTMLElement, noPreventDefault?: boolean): void

detachControl

Find examples in Playground
  • detachControl(element: HTMLElement): void
  • Detach the current controls from the camera. The camera will stop reacting to inputs.

    Parameters

    • element: HTMLElement

      Defines the element to stop listening the inputs from

    Returns void

getClassName

Find examples in Playground
  • getClassName(): string

getFrontPosition

Find examples in Playground
  • getFrontPosition(distance: number): Vector3
  • 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

getTarget

Find examples in Playground
  • Return the current target position of the camera. This value is expressed in local space.

    Returns Vector3

    the target position

setTarget

Find examples in Playground
  • Defines the target the camera should look at.

    Parameters

    • target: Vector3

      Defines the new target as a Vector or a mesh

    Returns void

storeState

Find examples in Playground
  • Store current camera state of the camera (fov, position, rotation, etc..)

    Returns Camera

    the camera

Generated using TypeDoc