A 4×4 matrix for 3D projective transformations.
A 4×4 matrix used for 3D projective transformations. It can represent transformations such as translation, rotation, scaling, shearing, and perspective division. It consists of four Vector4 columns.
For purely linear transformations (translation, rotation, and scale), it is recommended to use Transform3D, as it is more performant and requires less memory.
Used internally as Camera3D's projection matrix.
Note: In a boolean context, a projection will evaluate to false if it's equal to IDENTITY. Otherwise, a projection will always evaluate to true.
Creates a new Projection that projects positions from a depth range of -1 to 1 to one that ranges from 0 to 1, and flips the projected positions vertically, according to flip_y.
Creates a new Projection that scales a given projection to fit around a given AABB in projection space.
Creates a new Projection for projecting positions onto a head-mounted display with the given X:Y aspect ratio, distance between eyes, display width, distance to lens, oversampling factor, and depth clipping planes.
eye creates the projection for the left eye when set to 1, or the right eye when set to 2.
Creates a new Projection that projects positions in a frustum with the given clipping planes.
Creates a new Projection that projects positions in a frustum with the given size, X:Y aspect ratio, offset, and clipping planes.
flip_fov determines whether the projection's field of view is flipped over its diagonal.
Creates a new Projection that projects positions into the given Rect2.
Creates a new Projection that projects positions using an orthogonal projection with the given clipping planes.
Creates a new Projection that projects positions using an orthogonal projection with the given size, X:Y aspect ratio, and clipping planes.
flip_fov determines whether the projection's field of view is flipped over its diagonal.
Creates a new Projection that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping planes.
flip_fov determines whether the projection's field of view is flipped over its diagonal.
Creates a new Projection that projects positions using a perspective projection with the given Y-axis field of view (in degrees), X:Y aspect ratio, and clipping distances. The projection is adjusted for a head-mounted display with the given distance between eyes and distance to a point that can be focused on.
eye creates the projection for the left eye when set to 1, or the right eye when set to 2.
flip_fov determines whether the projection's field of view is flipped over its diagonal.
Returns a scalar value that is the signed factor by which areas are scaled by this matrix. If the sign is negative, the matrix flips the orientation of the area.
The determinant can be used to calculate the invertibility of a matrix or solve linear systems of equations involving the matrix, among other applications.
Returns a copy of this Projection with the signs of the values of the Y column flipped.
Returns the vertical field of view of the projection (in degrees) associated with the given horizontal field of view (in degrees) and aspect ratio.
Note: Unlike most methods of Projection, aspect is expected to be 1 divided by the X:Y aspect ratio.
Returns the factor by which the visible level of detail is scaled by this Projection.
Returns for_pixel_width divided by the viewport's width measured in meters on the near plane, after this Projection is applied.
Returns the clipping plane of this Projection whose index is given by plane.
plane should be equal to one of PLANE_NEAR, PLANE_FAR, PLANE_LEFT, PLANE_TOP, PLANE_RIGHT, or PLANE_BOTTOM.
Returns the dimensions of the viewport plane that this Projection projects positions onto, divided by two.
Returns the distance for this Projection beyond which positions are clipped.
Returns the distance for this Projection before which positions are clipped.
Returns a Projection that performs the inverse of this Projection's projective transformation.
Returns a Projection with the X and Y values from the given Vector2 added to the first and second values of the final column respectively.
Returns a Projection with the near clipping distance adjusted to be new_znear.
Note: The original Projection must be a perspective projection.
PLANE_NEAR = 0The index value of the projection's near clipping plane.
PLANE_FAR = 1The index value of the projection's far clipping plane.
PLANE_LEFT = 2The index value of the projection's left clipping plane.
PLANE_TOP = 3The index value of the projection's top clipping plane.
PLANE_RIGHT = 4The index value of the projection's right clipping plane.
PLANE_BOTTOM = 5The index value of the projection bottom clipping plane.
A Projection with no transformation defined. When applied to other data structures, no transformation is performed.
A Projection with all values initialized to 0. When applied to other data structures, they will be zeroed.