-
public final class MatrixKt
-
-
Method Summary
Modifier and Type Method Description final static Bool2equal(Mat2 a, Float b, Float delta)final static Bool2equal(Mat2 a, Mat2 b, Float delta)final static Bool3equal(Mat3 a, Float b, Float delta)final static Bool3equal(Mat3 a, Mat3 b, Float delta)final static Bool4equal(Mat4 a, Float b, Float delta)final static Bool4equal(Mat4 a, Mat4 b, Float delta)final static Bool2notEqual(Mat2 a, Float b, Float delta)final static Bool2notEqual(Mat2 a, Mat2 b, Float delta)final static Bool3notEqual(Mat3 a, Float b, Float delta)final static Bool3notEqual(Mat3 a, Mat3 b, Float delta)final static Bool4notEqual(Mat4 a, Float b, Float delta)final static Bool4notEqual(Mat4 a, Mat4 b, Float delta)final static Mat2transpose(Mat2 m)final static Mat3transpose(Mat3 m)final static Mat4transpose(Mat4 m)final static Mat3inverse(Mat3 m)final static Mat4inverse(Mat4 m)final static Mat4scale(Float3 s)final static Mat4scale(Mat4 m)final static Mat4translation(Float3 t)final static Mat4translation(Mat4 m)final static Mat4rotation(Mat4 m)final static Mat4rotation(Float3 d, RotationsOrder order)Construct a rotation matrix from Euler angles using YPR around a specified orderUses intrinsic Tait-Bryan angles. final static Mat4rotation(Float yaw, Float pitch, Float roll, RotationsOrder order)Construct a rotation matrix from Euler yaw, pitch, roll around a specified order. final static Mat4rotation(Float3 axis, Float angle)final static Mat4rotation(Quaternion quaternion)Construct a Quaternion Rotation Matrix following the Hamilton conventionAssume the destination and local coordinate spaces are initially aligned, and the local coordinate space is then rotated counter-clockwise about a unit-length axis, k, by an angle, theta. final static Float3eulerAngles(Mat4 m, RotationsOrder order)Get the Euler angles in degrees from a rotation Matrix final static Quaternionquaternion(Mat4 m)Get the Quaternion from a rotation Matrix final static Mat4normal(Mat4 m)final static Mat4lookAt(Float3 eye, Float3 target, Float3 up)final static Mat4lookTowards(Float3 eye, Float3 forward, Float3 up)final static Mat4perspective(Float fov, Float ratio, Float near, Float far)final static Mat4ortho(Float l, Float r, Float b, Float t, Float n, Float f)-
-
Method Detail
-
translation
final static Mat4 translation(Float3 t)
-
translation
final static Mat4 translation(Mat4 m)
-
rotation
final static Mat4 rotation(Float3 d, RotationsOrder order)
Construct a rotation matrix from Euler angles using YPR around a specified order
Uses intrinsic Tait-Bryan angles. This means that rotations are performed with respect to the local coordinate system. That is, for order 'XYZ', the rotation is first around the X axis (which is the same as the world-X axis), then around local-Y (which may now be different from the world Y-axis), then local-Z (which may be different from the world Z-axis)
- Parameters:
d- Per axis Euler angles in degrees Yaw, pitch, roll (YPR) are taken accordingly to the rotations order input.order- The order in which to apply rotations.
-
rotation
final static Mat4 rotation(Float yaw, Float pitch, Float roll, RotationsOrder order)
Construct a rotation matrix from Euler yaw, pitch, roll around a specified order.
- Parameters:
yaw- about 3rd rotation axis in radians.pitch- about 2nd rotation axis in radians.roll- about 1st rotation axis in radians.order- The order in which to apply rotations.
-
rotation
final static Mat4 rotation(Quaternion quaternion)
Construct a Quaternion Rotation Matrix following the Hamilton convention
Assume the destination and local coordinate spaces are initially aligned, and the local coordinate space is then rotated counter-clockwise about a unit-length axis, k, by an angle, theta.
-
eulerAngles
final static Float3 eulerAngles(Mat4 m, RotationsOrder order)
Get the Euler angles in degrees from a rotation Matrix
- Parameters:
m- The rotation matrix.order- The order in which to apply rotations.
-
quaternion
final static Quaternion quaternion(Mat4 m)
Get the Quaternion from a rotation Matrix
- Parameters:
m- The rotation matrix.
-
lookTowards
final static Mat4 lookTowards(Float3 eye, Float3 forward, Float3 up)
-
-
-
-