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

PropertyModifiersTypeDescription
activebooleanReturns true if the controls are active, false otherwise
controllerControllerThe controller used to translate mouse movements into camera rotations
heightOffsetnumberRepresents the vertical offset from the target object
lockAxis{ x: boolean; y: boolean; }Used to lock the camera movement on a specific axis
maxZoomOutnumberRepresents the maximum distance from the target object
usePointerLockbooleanReturns true if the controls are using pointer lock, false otherwise