Class
Projection
View sourceDefines the polymorphic projection value contract used by Camera.
Use PerspectiveProjection or OrthographicProjection for
the built-in projection values; their type values are represented by
ProjectionType.
Examples
import { Camera, OrthographicProjection } from '@wimaengine/render-core'
const camera = new Camera(new OrthographicProjection(-1, 1, 1, -1))
const matrix = camera.projectionMatrix()Constructor
Methods
asProjectionMatrix(_near: number, _far: number): Matrix4
View sourceReturns the base projection matrix.
The base implementation ignores both clipping distances and returns a new
identity Matrix4. The Camera calls this method
polymorphically; concrete projection values provide their own transforms.
isPerspective(): boolean
View sourceReports whether this base projection is perspective.
The base implementation always returns false. A
PerspectiveProjection overrides this predicate for perspective
values, while OrthographicProjection leaves it false.
isOrthographic(): boolean
View sourceReports whether this base projection is orthographic.
The base implementation always returns false. An
OrthographicProjection overrides this predicate for orthographic
values, while PerspectiveProjection leaves it false.
staticserialize(_value: unknown): object
View sourceSerializes the base projection value.
The base implementation ignores _value and returns a new empty object.
It does not select a ProjectionType or persist concrete settings;
Camera.serialize uses the built-in projection serializers for
camera data.
staticdeserialize(_value: unknown, out?: Projection): Projection
View sourceDeserializes the base projection value.
The base implementation ignores _value and returns the supplied out
object unchanged, or a new Projection when out is omitted. It
does not select a concrete projection; Camera.deserialize chooses
the built-in projection from its serialized discriminator.
