Struct Float4x4
A 4x4 matrix of 32-bit floats. Used for transformations in shader code.
public struct Float4x4
- Inherited Members
Constructors
Float4x4(Float4, Float4, Float4, Float4)
Initializes a new instance of the Float4x4 struct.
public Float4x4(Float4 row0, Float4 row1, Float4 row2, Float4 row3)
Parameters
Fields
Row0
First row of the matrix.
public Float4 Row0
Field Value
Row1
Second row of the matrix.
public Float4 Row1
Field Value
Row2
Third row of the matrix.
public Float4 Row2
Field Value
Row3
Fourth row of the matrix.
public Float4 Row3
Field Value
Properties
Identity
Gets the identity matrix.
public static Float4x4 Identity { get; }
Property Value
Methods
CreateLookAt(Float3, Float3, Float3)
Creates a view matrix (look-at matrix).
public static Float4x4 CreateLookAt(Float3 eye, Float3 target, Float3 up)
Parameters
Returns
CreatePerspective(F32, F32, F32, F32)
Creates a perspective projection matrix.
public static Float4x4 CreatePerspective(F32 fovY, F32 aspectRatio, F32 nearPlane, F32 farPlane)
Parameters
fovYF32Field of view in the Y direction (in radians).
aspectRatioF32Aspect ratio (width / height).
nearPlaneF32Near clipping plane distance.
farPlaneF32Far clipping plane distance.
Returns
Remarks
This uses a [0, 1] depth range (DirectX/Vulkan style) instead of OpenGL's [-1, 1]. The matrix maps the near plane to NDC Z = 0 and far plane to NDC Z = 1.
CreateRotationX(F32)
Creates a rotation matrix around the X axis.
public static Float4x4 CreateRotationX(F32 angle)
Parameters
angleF32
Returns
CreateRotationY(F32)
Creates a rotation matrix around the Y axis.
public static Float4x4 CreateRotationY(F32 angle)
Parameters
angleF32
Returns
CreateRotationZ(F32)
Creates a rotation matrix around the Z axis.
public static Float4x4 CreateRotationZ(F32 angle)
Parameters
angleF32
Returns
CreateTranslation(F32, F32, F32)
Creates a translation matrix.
public static Float4x4 CreateTranslation(F32 x, F32 y, F32 z)
Parameters
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator *(Float4x4, Float4)
Multiplies a matrix by a vector.
public static Float4 operator *(Float4x4 matrix, Float4 vector)
Parameters
Returns
operator *(Float4x4, Float4x4)
Multiplies two matrices.
public static Float4x4 operator *(Float4x4 left, Float4x4 right)