FreeMatrixLens provides a projection lens that exposes a full projection matrix, rather than provide one through more user-friendly settings. Whenever the matrix is updated, it needs to be reset in order to trigger an update.

Constructor

new()

Creates a new FreeMatrixLens object.

Methods

Inherited Variables

Defined by LensBase

far:Float

frustumCorners:Vector<Float>

matrix:Matrix3D

near:Float

read onlyunprojectionMatrix:Matrix3D

Inherited Methods

Defined by LensBase

@:value({ v : null })project(point3d:Vector3D, ?v:Vector3D):Vector3D

Calculates the normalised position in screen space of the given scene position relative to the camera.

Parameters:

point3d

the position vector of the scene coordinates to be projected.

v

The destination Vector3D object

Returns:

The normalised screen position of the given scene coordinates relative to the camera.

@:value({ v : null })unproject(nX:Float, nY:Float, sZ:Float, ?v:Vector3D):Vector3D

Calculates the scene position relative to the camera of the given normalized coordinates in screen space.

Parameters:

nX

The normalised x coordinate in screen space, -1 corresponds to the left edge of the viewport, 1 to the right.

nY

The normalised y coordinate in screen space, -1 corresponds to the top edge of the viewport, 1 to the bottom.

sZ

The z coordinate in screen space, representing the distance into the screen.

v

The destination Vector3D object

Returns:

The scene position relative to the camera of the given screen coordinates.