ReadonlyactiveThe unique type identifier of the active strategy.
The aspect ratio (width / height).
The behaviors attached to this camera.
ReadonlyflashThe tint color of the currently strongest active flash contribution.
ReadonlyflashThe combined post-processing flash intensity of all active camera effects, in [0, 1].
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 active projection (e.g., Perspective, Orthographic).
ReadonlystrategyThe currently active camera control strategy.
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 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
(see CameraEffect.merge), effect is absorbed into it instead of being added separately.
The effect to add.
The effect that now represents this addition: either effect itself, or the
existing effect effect was merged into.
Creates and adds a new effect by its type.
The type of effect.
Optionalintensity: number
The intensity factor.
Optionalduration: number
The duration in seconds.
Optionalcolor: Color
The tint color, only used by effects that support one (e.g. Flash).
The effect that was added (or the existing effect it was merged into).
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, e.g. to cancel it before it finishes on its own.
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.
OptionaldeltaTime: number
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.
Interface representing the core data and API of a camera.