Matrix4
Namespace: Hex1b.Scene.Math
Assembly: Hex1b.dll
A 4x4 matrix for 3D transformations (position, rotation, scale, projection). Row-major layout: elements[row, col]
[Experimental("HEX1B_SCENE", UrlFormat = "https://github.com/hex1b/hex1b/blob/main/docs/experimental/scene.md")]
public struct Matrix4 : IEquatable<Matrix4>Implements
Constructors
Matrix4()
public Matrix4()Matrix4(float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float)
Parameters:
m11(Single):m12(Single):m13(Single):m14(Single):m21(Single):m22(Single):m23(Single):m24(Single):m31(Single):m32(Single):m33(Single):m34(Single):m41(Single):m42(Single):m43(Single):m44(Single):
public Matrix4(float m11, float m12, float m13, float m14, float m21, float m22, float m23, float m24, float m31, float m32, float m33, float m34, float m41, float m42, float m43, float m44)Matrix4(float[])
Parameters:
elements(Single[]):
public Matrix4(float[] elements)Properties
IdentityMatrix
Returns: Matrix4
public static Matrix4 IdentityMatrix { get; }Methods
Determinant()
Returns: Single
public float Determinant()Equals(Matrix4)
Indicates whether the current object is equal to another object of the same type.
Parameters:
other(Matrix4): An object to compare with this object.
Returns: Boolean
true if the current object is equal to the other parameter; otherwise, false.
public bool Equals(Matrix4 other)Equals(object?)
Indicates whether this instance and a specified object are equal.
Parameters:
obj(Object): The object to compare with the current instance.
Returns: Boolean
true if obj and this instance are the same type and represent the same value; otherwise, false.
public override bool Equals(object? obj)Get(int, int)
Parameters:
Returns: Single
public float Get(int row, int col)GetHashCode()
Returns the hash code for this instance.
Returns: Int32
A 32-bit signed integer that is the hash code for this instance.
public override int GetHashCode()Identity()
public void Identity()Inverse()
Returns: Matrix4
public Matrix4 Inverse()Orthographic(float, float, float, float, float, float)
Create an orthographic projection matrix.
Parameters:
Returns: Matrix4
public static Matrix4 Orthographic(float left, float right, float bottom, float top, float near, float far)Perspective(float, float, float, float)
Create a perspective projection matrix.
Parameters:
Returns: Matrix4
public static Matrix4 Perspective(float fovRadians, float aspect, float near, float far)RotationX(float)
Parameters:
radians(Single):
Returns: Matrix4
public static Matrix4 RotationX(float radians)RotationY(float)
Parameters:
radians(Single):
Returns: Matrix4
public static Matrix4 RotationY(float radians)RotationZ(float)
Parameters:
radians(Single):
Returns: Matrix4
public static Matrix4 RotationZ(float radians)Scale(Vector3)
Parameters:
s(Vector3):
Returns: Matrix4
public static Matrix4 Scale(Vector3 s)Set(int, int, float)
Parameters:
public void Set(int row, int col, float value)Translation(Vector3)
Parameters:
t(Vector3):
Returns: Matrix4
public static Matrix4 Translation(Vector3 t)Transposed()
Returns: Matrix4
public Matrix4 Transposed()Members
operator *(Matrix4, Matrix4)
Parameters:
Returns: Matrix4
public static Matrix4 operator *(Matrix4 a, Matrix4 b)operator *(Matrix4, Vector4)
Parameters:
Returns: Vector4
public static Vector4 operator *(Matrix4 m, Vector4 v)