Class: Camera

Camera

Camera is an abstract base class for camera objects.


new Camera()

Properties:
Name Type Description
nearDistance number

The minimum distance to be able to render. Anything closer gets cut off.

farDistance number

The maximum distance to be able to render. Anything farther gets cut off.

viewProjectionMatrix Matrix4x4

The matrix transforming coordinates from world space to the camera's homogeneous projective space.

viewMatrix Matrix4x4

The matrix transforming coordinates from world space to the camera's local coordinate system (eye space).

projectionMatrix Matrix4x4

The matrix transforming coordinates from eye space to the camera's homogeneous projective space.

inverseViewProjectionMatrix Matrix4x4

The matrix that transforms from the homogeneous projective space to world space.

inverseProjectionMatrix Matrix4x4

The matrix that transforms from the homogeneous projective space to view space.

Author:
  • derschmale <http://www.derschmale.com>
See:

Methods


_setScene()


destroy()


getRay(x, y)

Returns a ray in world space at the given coordinates.

Parameters:
Name Type Description
x

The x-coordinate in NDC [-1, 1] range.

y

The y-coordinate in NDC [-1, 1] range.


setJitterOffset(v)

Offsets the projection matrix. Is called by the renderer AFTER updating the resolution.

Parameters:
Name Type Description
v Float2

A Float2 object with components in range from [-1, 1]. 0 represents the center of the subpixel, 1 to the right.