Matrix.*

static Matrix *(Matrix a, Matrix b)

Multiplies two matrices together! This is a great way to combine transform operations. Note that StereoKit’s matrices are row-major, and multiplication order is important! To translate, then scale, multiply in order of ‘translate * scale’.

   
Matrix a First Matrix.
Matrix b Second Matrix.
RETURNS: Matrix Result of matrix multiplication.
static Vec3 *(Matrix a, Vec3 b)

Multiplies the vector by the Matrix! Since only a 1x4 vector can be multiplied against a 4x4 matrix, this uses ‘1’ for the 4th element, so the result will also include translation! To exclude translation, use Matrix.TransformNormal.

   
Matrix a A transform matrix.
Vec3 b Any Vector.
RETURNS: Vec3 The Vec3 transformed by the matrix, including translation.
static Ray *(Matrix a, Ray b)

Transforms a Ray by the Matrix! The position and direction are both multiplied by the matrix, accounting properly for which should include translation, and which should not.

   
Matrix a A transform matrix.
Ray b A Ray to be transformed.
RETURNS: Ray A Ray transformed by the Matrix.
static Pose *(Matrix a, Pose b)

Transforms a Pose by the Matrix! The position and orientation are both transformed by the matrix, accounting properly for the Pose’s quaternion.

   
Matrix a A transform matrix.
Pose b A Pose to be transformed.
RETURNS: Pose A Ray transformed by the Matrix.




Found an issue with these docs, or have some additional questions? Create an Issue on Github!