public sealed struct Matrix
Represents a 4x4 matrix.
Related Guides
Broader workflow and conceptual references connected to this API.
A Vector is just a set of numbers that describe a position or a direction in space.
GPU instancing is an optimization where multiple instances of the same model with the same material can be drawn in a single draw call. This is a big optimization when rendering things that appear many times in a scene such as foliage.
Scenes can be traced against using Scene.Trace - which uses a builder pattern to make construction a bit easier. At a minimum, traces have a shape, start, and end. You can also filter which specific tags will be hit or ignored, or opt-in to using your project's collision rule matrix by calling WithCollisionRules(tag).
Constructors
Showing 1 constructors
public Matrix(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)
No results match this filter.
Methods
Showing 25 methods
public static Matrix CreateMatrix3D(float[] matrix)
public static Matrix CreateObliqueProjection(Transform cameraTransform, Sandbox.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.
public static Matrix CreateProjection(float zNear, float zFar, float fovX, float aspectRatio, System.Nullable`1<Vector4> clipSpace = null)
Parameters
clipSpace: Default: null
public static Matrix CreateSkewX(float degrees)
public static Matrix CreateSkewY(float degrees)
public static Matrix Lerp(Matrix ma, Matrix mb, float frac)
Performs linear interpolation from one matrix to another.
public static Matrix Slerp(Matrix ma, Matrix mb, float frac)
Performs spherical interpolation from one matrix to another.
public 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.
No results match this filter.
Properties
Showing 18 properties
public float Matrix.M11 { get; set; }
public float Matrix.M12 { get; set; }
public float Matrix.M13 { get; set; }
public float Matrix.M14 { get; set; }
public float Matrix.M21 { get; set; }
public float Matrix.M22 { get; set; }
public float Matrix.M23 { get; set; }
public float Matrix.M24 { get; set; }
public float Matrix.M31 { get; set; }
public float Matrix.M32 { get; set; }
public float Matrix.M33 { get; set; }
public float Matrix.M34 { get; set; }
public float Matrix.M41 { get; set; }
public float Matrix.M42 { get; set; }
public float Matrix.M43 { get; set; }
public float Matrix.M44 { get; set; }
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | global |
| Type | class |
| Assembly | Sandbox.System |
| Doc ID | T:Matrix |