Class: Camera

Camera()

Base camera class. Responsibilities: - Caches view matrix (inverse of local TRS transform). - Defines a common camera contract for derived camera types.

Constructor

new Camera()

Source:

Classes

Camera

Methods

getProjectionMatrix() → {Float32Array}

Returns the projection matrix for this camera. Derived camera classes must implement this method.
Source:
Throws:
Always throws in the base class.
Type
Error
Returns:
- Projection matrix.
Type
Float32Array

getViewMatrix() → {Float32Array}

Returns the view matrix (inverse of camera local TRS transform). The returned matrix is cached and reused between calls.
Source:
Returns:
- Cached view matrix.
Type
Float32Array

setAspectRatio(aspectRatio)

Updates the camera aspect ratio (width/height). Base camera class does not define, how aspect ratio affects the projection.
Parameters:
Name Type Description
aspectRatio number New viewport aspect ratio.
Source: