Entity ID of a special entity that exists for the camera to point at.
By default this entity follows the player entity, so you can
change the player's eye height by changing the follow
component's offset:
var followState = noa.ents.getState(noa.camera.cameraTarget, 'followsEntity')
followState.offset[1] = 0.9 * myPlayerHeight
For customized camera controls you can change the follow target to some other entity, or override the behavior entirely:
// make cameraTarget stop following the player
noa.ents.removeComponent(noa.camera.cameraTarget, 'followsEntity')
// control cameraTarget position directly (or whatever..)
noa.ents.setPosition(noa.camera.cameraTarget, [x,y,z])
Current actual zoom distance. This differs from zoomDistance
when
the camera is in the process of moving towards the desired distance,
or when it's obstructed by solid terrain behind the player.
This value will get overwritten each tick, but you may want to write to it
when overriding the camera zoom speed.
Camera yaw angle.
Returns the camera's rotation angle around the vertical axis.
Range: 0..2π
This value is writeable, but it's managed by the engine and
will be overwritten each frame.
Mouse look inverse (horizontal)
Mouse look inverse (vertical)
Camera pitch angle.
Returns the camera's up/down rotation angle. The pitch angle is
clamped by a small epsilon, such that the camera never quite
points perfectly up or down.
Range: -π/2..π/2
.
This value is writeable, but it's managed by the engine and
will be overwritten each frame.
Multiplier for temporarily altering mouse sensitivity.
Set this to 0
to temporarily disable camera controls.
Multiplier for altering mouse sensitivity when pointerlock
is not active - default of 0
means no camera movement.
Note this setting is ignored if pointerLock isn't supported.
Horizontal mouse sensitivity. Same scale as Overwatch (typical values around 5..10
)
Vertical mouse sensitivity. Same scale as Overwatch (typical values around 5..10
)
How far back the camera should be from the player's eye position
How quickly the camera moves to its zoomDistance
(0..1)
Generated using TypeDoc
noa.camera
- manages the camera, its position and direction, mouse sensitivity, and so on.This module uses the following default options (from the options object passed to the Engine):