Api Matrix
struct

Matrix

public sealed struct Matrix

Represents a 4x4 matrix.

Constructors

Matrix(Single 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)

Properties

Name Type Description
Identity static Matrix Returns the multiplicative identity matrix.
Inverted Matrix Returns inverse of this matrix.
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

Methods

static Matrix CreateWorld(Vector3 position, Vector3 forward, Vector3 up)
static Matrix CreateRotation(Rotation rot)
static Matrix CreateRotation(Vector3 angles)
static Matrix CreateRotationX(Single degrees)
static Matrix CreateRotationX(Single degrees, Vector3 center)
static Matrix CreateRotationY(Single degrees)
static Matrix CreateRotationY(Single degrees, Vector3 center)
static Matrix CreateRotationZ(Single degrees)
static Matrix CreateRotationZ(Single degrees, Vector3 center)
static Matrix CreateTranslation(Vector3 vec)
static Matrix CreateScale(Vector3 scales)
static Matrix CreateScale(Vector3 scales, Vector3 centerPoint)
static Matrix CreateSkew(Vector2 skew)
static Matrix CreateSkewX(Single degrees)
static Matrix CreateSkewY(Single degrees)
static Matrix CreateMatrix3D(Single[] matrix)
static Matrix Lerp(Matrix ma, Matrix mb, Single frac)

Performs linear interpolation from one matrix to another.

static Matrix Slerp(Matrix ma, Matrix mb, Single frac)

Performs spherical interpolation from one matrix to another.

Matrix Transpose()

Returns transposed version of this matrix, meaning columns in this matrix become rows in the returned matrix and rows in this matrix become columns in the returned one.

Vector4 Transform(Vector4 v)

Transforms a vector by a 4x4 matrix

Vector3 Transform(Vector3 v)

Transforms a vector by a 4x4 matrix

Vector2 Transform(Vector2 v)

Transforms a vector by a 4x4 matrix

Vector3 TransformNormal(Vector3 v)

Transforms a normal vector by a specified 4x4 matrix

static Matrix CreateProjection(Single zNear, Single zFar, Single fovX, Single aspectRatio, Vector4? clipSpace = null)
static Matrix CreateObliqueProjection(Transform cameraTransform, Plane clipPlane, Matrix projectionMatrix)

Create a projection matrix. The matrix will be in the correct format for the engine, and will also be reverse z.

Assembly: Sandbox.System Full Name: Matrix