Creates a new Camera.
The projection to use.
The behaviors attached to this camera.
Sub-pixel jitter offset (NDC units) for TAA, baked into viewProjectionMatrix for every
consumer rather than a separate matrix -- see docs/adr/0002-taa-jitter-shared-viewproj-matrix.md.
Horizontal rotation delta accumulated by behaviors.
Vertical rotation delta accumulated by behaviors.
The rotation angle around the X-axis (pitch).
The position of the camera in world space.
The target point the camera is looking at.
The rotation angle around the Y-axis (yaw).
The up vector of the camera (usually 0, 1, 0).
The unique type identifier of the active strategy.
The aspect ratio (width / height).
The aspect ratio (width / height).
The tint color of the currently strongest active flash contribution.
The combined post-processing flash intensity of all active camera effects, in [0, 1].
The active projection (e.g., Perspective, Orthographic).
The active projection (e.g., Perspective, Orthographic).
The currently active camera control strategy.
The view matrix as a Float32Array.
The view matrix as a Matrix4 instance.
The combined view-projection matrix as a Float32Array.
The combined view-projection matrix as a Matrix4 instance.
Adds a new effect to the camera. If an existing effect of the same type accepts a merge,
effect is absorbed into it instead of stacking a separate, independently-decaying instance.
The effect to add.
The effect that now represents this addition.
Creates and adds a new effect by type.
The type of effect.
Optionalintensity: number
The intensity.
Optionalduration: number
The duration in seconds.
Optionalcolor: Color
The tint color, only used by effects that support one (e.g. Flash).
The effect that now represents this addition.
Removes all active effects, or all effects of a specific type.
Optionaltype: CameraEffectType
If given, only effects of this type are removed; otherwise all are.
Projects a 3D world position into Normalized Device Coordinates (NDC: [-1, 1] on X, Y, Z).
After projection, Z >= -1 means the point is in front of the camera (true NDC depth; with
OpenGL-style depth, in-front points closer than ~2x the near plane legitimately have
negative NDC Z, so callers MUST NOT gate on Z > 0). The sentinel Z = -2 marks a point
behind the camera.
The projected NDC vector.
Removes a behavior from the camera.
The behavior to remove.
Removes a specific effect instance.
The effect instance to remove.
Maps screen coordinates (NDC -1 to 1) to world coordinates on the Y=0 plane.
Normalized X coordinate (-1 to 1).
Normalized Y coordinate (-1 to 1).
The world position on the Y=0 plane.
Sets or removes spatial constraints for the active strategy.
Optionalconstraints: CameraConstraints
The constraints to apply, or undefined to clear.
Switches the camera's control behavior.
The type of strategy to use.
Performs the movement and logic of the active strategy.
The target position to follow.
The horizontal rotation delta.
The vertical rotation delta.
Elapsed time since the last frame.
Recomputes the projection matrix.
Recomputes the view matrix and the combined view-projection matrix.
Adjusts the zoom level (radius, FOV, or orthographic bounds).
The zoom delta.
Standard implementation of the CameraInterfaceData.