Thirdpersoncameracontrolswrapper

ThirdPersonCameraControlsWrapper class

This class is used to implement third person camera mode.

The controls use mouse movements to rotate the camera around the target object; By default the conttrols controller will enter pointer lock mode when the user clicks on the canvas. To disable this behavior set the usePointerLock property to false on the controls controller.

The behavior of the controls can be customized by passing a ThirdPersonCameraControlsWrapperParams object to the constructor

The meaning of object & target options is intepreted as follows:

  • The object is typically set to the camera object being controlled

  • The target is the object that the camera will follow from the given maxZoomOut distance

Signature:

export declare class ThirdPersonCameraControlsWrapper extends ControlsAbstract 

Extends: ControlsAbstract

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ThirdPersonCameraControlsWrapper class.

Properties

Property

Modifiers

Type

Description

$$lerp

{ dt: number; a: number; }

active

boolean

Returns true if the controls are active, false otherwise

cameraAltitudeMaxDistance

number

cameraAltitudeSmoothing

number

cameraVirtualTarget

Vector3

controller

Controller

The controller used to translate mouse movements into camera rotations

disableCollision

boolean

disableWheelZoom

boolean

heightOffset

number

Represents the vertical offset from the target object

lockAxis

{ x: boolean; y: boolean; }

Used to lock the camera movement on a specific axis

maxZoomOut

number

Represents the maximum distance from the target object

smoothFactor

number

smoothMethod

"position" | "orbit"

usePointerLock

boolean

Returns true if the controls are using pointer lock, false otherwise

Methods

Method

Modifiers

Description

lerpSpherical(spherical, target, alpha)