Skip to content
API referenceDevelopmentRuntime scriptingEngine ccf7d03f
Synced
  • Represents a mutable four-by-four transformation matrix using column-vector multiplication.

API: scripting
Implements: System.IEquatable<InnoEngine.Mathematics.Matrix>
Inherits: System.ValueType
Project: Inno.Core.Mathematics
Scope: Runtime

public struct InnoEngine.Mathematics.Matrix : System.IEquatable<InnoEngine.Mathematics.Matrix>

Conventions used by this type:

  • Column-vector math: points/vectors are treated as column vectors on the right: v' = M * v.
  • Translation is stored in the last column: (m14, m24, m34).
  • Matrix multiplication follows standard form: C = A * B (apply B then A in column-vector convention: A * (B * v)).

Note on handedness: This T:InnoEngine.Mathematics.Matrix type is handedness-agnostic. Handedness is determined by the specific factory (e.g. M:InnoEngine.Mathematics.Matrix.CreateLookAt(InnoEngine.Mathematics.Vector3,InnoEngine.Mathematics.Vector3,InnoEngine.Mathematics.Vector3) and M:InnoEngine.Mathematics.Matrix.CreatePerspectiveFieldOfView(System.Single,System.Single,System.Single,System.Single) are currently left-handed). If your engine convention is right-handed (-Z forward), add/use explicit RH variants (e.g. CreateLookAtRH / CreatePerspectiveFieldOfViewRH).

Kind Element Description
Constructors Matrix.Constructor Initializes a 4x4 matrix with explicit row-major elements.
Fields Matrix.m11 Row 1, Column 1.
Fields Matrix.m12 Row 1, Column 2.
Fields Matrix.m13 Row 1, Column 3.
Fields Matrix.m14 Row 1, Column 4.
Fields Matrix.m21 Row 2, Column 1.
Fields Matrix.m22 Row 2, Column 2.
Fields Matrix.m23 Row 2, Column 3.
Fields Matrix.m24 Row 2, Column 4.
Fields Matrix.m31 Row 3, Column 1.
Fields Matrix.m32 Row 3, Column 2.
Fields Matrix.m33 Row 3, Column 3.
Fields Matrix.m34 Row 3, Column 4.
Fields Matrix.m41 Row 4, Column 1 (translation X component for affine transforms).
Fields Matrix.m42 Row 4, Column 2 (translation Y component for affine transforms).
Fields Matrix.m43 Row 4, Column 3 (translation Z component for affine transforms).
Fields Matrix.m44 Row 4, Column 4.
Methods Matrix.CopyToColumnMajor Copies matrix elements into an array in column-major order. Useful for APIs like bgfx that expect column-major float[16].
Methods Matrix.CreateFromQuaternion Creates a rotation matrix from a quaternion.
Methods Matrix.CreateLookAt Creates a left-handed view matrix that looks from eye to target.
Methods Matrix.CreateLookAtRH Creates a right-handed view matrix that looks from eye to target.
Methods Matrix.CreateOrthographic Creates an orthographic projection matrix (depth range 0..1).
Methods Matrix.CreateOrthographicOffCenter Creates an off-center orthographic projection matrix (depth range 0..1).
Methods Matrix.CreatePerspectiveFieldOfView Creates a left-handed, perspective projection matrix ( depth range 0..1).
Methods Matrix.CreatePerspectiveFieldOfViewRH Creates a right-handed, perspective projection matrix (depth range 0..1).
Methods Matrix.CreateRotationX Creates a rotation matrix around the X axis (radians).
Methods Matrix.CreateRotationY Creates a rotation matrix around the Y axis (radians).
Methods Matrix.CreateRotationZ Creates a rotation matrix around the Z axis (radians).
Methods Matrix.CreateScale(InnoEngine.Mathematics.Vector3) Creates a non-uniform scale matrix.
Methods Matrix.CreateScale(System.Single) Creates a uniform scale matrix.
Methods Matrix.CreateScale(System.Single,System.Single,System.Single) Creates a non-uniform scale matrix.
Methods Matrix.CreateTranslation(InnoEngine.Mathematics.Vector3) Creates a translation matrix.
Methods Matrix.CreateTranslation(System.Single,System.Single,System.Single) Creates a translation matrix.
Methods Matrix.Decompose Decomposes a matrix into scale, rotation and translation.
Methods Matrix.Determinant Returns the determinant of the matrix.
Methods Matrix.Equals(InnoEngine.Mathematics.Matrix) Determines whether this instance is equal to another matrix.
Methods Matrix.Equals(System.Object) Determines whether this instance and the supplied value represent the same logical state.
Methods Matrix.Extract2DTransform Extracts the 2D-affine portion of a matrix (XY basis + XY translation).
Methods Matrix.GetHashCode Computes a hash code from the fields that participate in logical equality.
Methods Matrix.Invert Returns the inverse, or identity when the absolute determinant is below the default tolerance.
Methods Matrix.Multiply Multiplies two matrices using standard matrix multiplication.
Methods Matrix.op_Equality Tests matrices for approximate equality (per-element).
Methods Matrix.op_Implicit(InnoEngine.Mathematics.Matrix)~System.Numerics.Matrix4x4 Converts to T:System.Numerics.Matrix4x4 preserving element order. System.Numerics assumes row-major with row vectors, so transpose as needed for column-vector usage.
Methods Matrix.op_Implicit(System.Numerics.Matrix4x4)~InnoEngine.Mathematics.Matrix Converts from T:System.Numerics.Matrix4x4 preserving element order. System.Numerics assumes row-major with row vectors, so transpose as needed for column-vector usage.
Methods Matrix.op_Inequality Tests matrices for inequality.
Methods Matrix.op_Multiply Multiplies two matrices.
Methods Matrix.ToColumnMajorArray Returns a new array containing matrix elements in column-major order.
Methods Matrix.ToString Returns a multi-line string representation of the matrix in row-major layout.
Methods Matrix.Transpose Returns the transpose of a matrix.
Properties Matrix.identity Gets the identity matrix.