Pose.ToMatrix
Matrix ToMatrix(Vec3 scale)
Converts this pose into a transform matrix, incorporating a provided scale value.
Vec3 scale | A scale vector! Vec3.One would be an identity scale. |
RETURNS: Matrix | A Matrix that transforms to the given pose. |
Matrix ToMatrix(float scale)
Converts this pose into a transform matrix, incorporating a provided scale value.
float scale | A uniform scale factor! 1 would be an identity scale. |
RETURNS: Matrix | A Matrix that transforms to the given pose. |
Matrix ToMatrix()
Converts this pose into a transform matrix.
RETURNS: Matrix | A Matrix that transforms to the given pose. |
Examples
Draw Pose
Having a raw and malleable position/orientation available is great,
but with Pose.ToMatrix
, you can also quickly turn a Pose
into a
Matrix
for use with drawing functions or other places where
Matrix
transforms are needed! ToMatrix
also has overloads to
include a scale, if one is available.
Pose pose = new Pose(0,0,-0.5f, Quat.FromAngles(30,45,0));
float scale = 0.5f;
Mesh.Cube.Draw(Material.Default, pose.ToMatrix(scale));
Found an issue with these docs, or have some additional questions? Create an Issue on Github!