Options
All
  • Public
  • Public/Protected
  • All
Menu

Class 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

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

Hierarchy

Index

Constructors

constructor

Properties

cameraAccelerationSearch playground for cameraAcceleration

cameraAcceleration: number

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

cameraDirectionSearch playground for cameraDirection

cameraDirection: Vector3

Define the current direction the camera is moving to

cameraRotationSearch playground for cameraRotation

cameraRotation: Vector2

Define the current rotation the camera is rotating to

heightOffsetSearch playground for heightOffset

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 chasing a plane)

ignoreParentScalingSearch playground for ignoreParentScaling

ignoreParentScaling: boolean

Gets or sets a boolean indicating that the scaling of the parent hierarchy will not be taken in account by the camera

inputsSearch playground for inputs

Defines the input associated with the camera.

inverseRotationSpeedSearch playground for inverseRotationSpeed

inverseRotationSpeed: number

Speed multiplier for inverse camera panning

invertRotationSearch playground for invertRotation

invertRotation: boolean

Reverses mouselook direction to 'natural' panning as opposed to traditional direct panning

lockedTargetSearch playground for lockedTarget

lockedTarget: Nullable<AbstractMesh>

Define the target of the camera.

lowerHeightOffsetLimitSearch playground for lowerHeightOffsetLimit

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.

lowerRadiusLimitSearch playground for lowerRadiusLimit

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.

lowerRotationOffsetLimitSearch playground for lowerRotationOffsetLimit

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.

maxCameraSpeedSearch playground for maxCameraSpeed

maxCameraSpeed: number

Define the speed limit of the camera following an object.

noRotationConstraintSearch playground for noRotationConstraint

noRotationConstraint: boolean

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

radiusSearch playground for radius

radius: number

Distance the follow camera should follow an object at

rotationSearch playground for rotation

rotation: Vector3

Define the current rotation of the camera

rotationOffsetSearch playground for rotationOffset

rotationOffset: number

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

rotationQuaternionSearch playground for rotationQuaternion

rotationQuaternion: Quaternion

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

speedSearch playground for speed

speed: number

Define the current speed of the camera

updateUpVectorFromRotationSearch playground for updateUpVectorFromRotation

updateUpVectorFromRotation: boolean

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

upperHeightOffsetLimitSearch playground for upperHeightOffsetLimit

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.

upperRadiusLimitSearch playground for upperRadiusLimit

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.

upperRotationOffsetLimitSearch playground for upperRotationOffsetLimit

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.

Accessors

target

  • Defines the target point of the camera. The camera looks towards it form the radius distance.

    Returns Vector3

  • Defines the target point of the camera. The camera looks towards it form the radius distance.

    Parameters

    Returns any

Methods

attachControlSearch playground for attachControl

  • attachControl(noPreventDefault?: boolean): void

detachControlSearch playground for detachControl

  • detachControl(): void
  • Detach the current controls from the specified dom element.

    Returns void

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Gets the camera class name.

    Returns string

    the class name

getFrontPositionSearch playground for getFrontPosition

  • 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

getTargetSearch playground for getTarget

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

    Returns Vector3

    the target position

setTargetSearch playground for setTarget

  • Defines the target the camera should look at.

    Parameters

    • target: Vector3

      Defines the new target as a Vector

    Returns void

storeStateSearch playground for storeState

  • Store current camera state of the camera (fov, position, rotation, etc..)

    Returns Camera

    the camera

Legend

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