Make a third person camera, the view goes to it at once
target EngineObject3D|Vector3 optionalWhat to follow, an object or a position
distance number optional, default 6How long the pole is
pitch number optional, default 0.3Angle of the pole above level, PI/2 looks straight down
const camera = new ThirdPersonCamera3D(player); // follow the player from 6 units back
camera.autoSwing = false; // a shooter turns it only by hand
Swing around behind the way the target moves
Pull in, in front of a wall between the pivot and the camera
Capture the mouse on a press of dragButton, so turning needs no button held
How far a pixel of mouse movement turns it
The mouse and a gamepad stick turn it
Angle of the pole above level
Where the pole starts from the target, usually its head
Seconds the pivot takes to close most of the gap to the target, 0 sticks to it
Which gamepad stick turns it, 1 is usually the right one
Radians a second a stick pushed all the way turns it
Seconds after turning by hand before it swings on its own again
Seconds the swing takes to close most of the gap, how tight it is
World units a second the target must move across the ground for it to swing
What it follows; destroyed or undefined, the camera holds
Swing behind the target's own facing, its getForward3D, instead of the way it moves
How far in front of a wall it stays
Seconds it takes to ease most of the way back out once clear of a wall
Angle of the pole around the target, 0 puts the camera on the +Z side looking -Z
Make this the camera that drives the view
Let go of the mouse and stop driving the camera
immediate boolean optional
Camera controls draw nothing
Put it on the target at once, with no easing, for a level start or a teleport, the camera too when this one
drives it; with no target it stays where the camera is, looking the way it looks
Taking over from another camera, it turns to look the way that one did
Turn it by hand, as the mouse and stick do, which holds the swing for swingDelay seconds
yaw numberRadians to turn around the target
pitch number optional, default 0Radians to tilt the pole up
Turn, swing and pull in, and set the camera, called by the camera plugin after the objects update