M&B: Bannerlord 1.2.9
The horns sound, the ravens gather.
|
3x3 Matrix class for 3d graphics.
Public Member Functions | |
Mat3 (Vec3 s, Vec3 f, Vec3 u) | |
Initializes a new instance of matrix. | |
Mat3 (float sx, float sy, float sz, float fx, float fy, float fz, float ux, float uy, float uz) | |
Initializes a new instance of matrix. | |
void | RotateAboutSide (float a) |
Rotates about side/x-axis. Applies pitch rotation. | |
void | RotateAboutForward (float a) |
Rotates about forward/y-axis. Applies roll rotation. | |
void | RotateAboutUp (float a) |
Rotates about up/z-axis. Applies yaw rotation. | |
void | RotateAboutAnArbitraryVector (Vec3 v, float a) |
Rotates about the param vector. | |
bool | IsOrthonormal () |
Determines whether the matrix is orthonormal. | |
bool | IsLeftHanded () |
bool | NearlyEquals (Mat3 rhs, float epsilon=MBMath.Epsilon) |
Vec3 | TransformToParent (Vec3 v) |
Transforms vector to parent frame. | |
Vec3 | TransformToParent (ref Vec3 v) |
Vec3 | TransformToLocal (Vec3 v) |
Transforms vector to local frame. | |
Mat3 | TransformToParent (Mat3 m) |
Transforms matrix to parent frame. | |
Mat3 | TransformToLocal (Mat3 m) |
Transforms matrix to local frame. | |
void | Orthonormalize () |
Orthonormalizes the matrix. | |
void | OrthonormalizeAccordingToForwardAndKeepUpAsZAxis () |
Mat3 | GetUnitRotation (float removedScale) |
Vec3 | MakeUnit () |
bool | IsUnit () |
void | ApplyScaleLocal (float scaleAmount) |
Scales the matrix by scaleAmount. | |
void | ApplyScaleLocal (Vec3 scaleAmountXYZ) |
Scales the matrix by scaleAmountXYZ vector. | |
bool | HasScale () |
Vec3 | GetScaleVector () |
Get scale amounts of each component. | |
Vec3 | GetScaleVectorSquared () |
Get scale squared amounts of each component. | |
void | ToQuaternion (out Quaternion quat) |
Quaternion | ToQuaternion () |
Vec3 | GetEulerAngles () |
Calculates the angular orientation of the matrix with respect to XYZ axes. | |
Mat3 | Transpose () |
Create a transposed matrix. | |
override string | ToString () |
Creates readable string representation. | |
override bool | Equals (object obj) |
Determines whether the specified generic object is equal to this instance. | |
override int | GetHashCode () |
Returns a hash code for this instance. | |
bool | IsIdentity () |
bool | IsZero () |
bool | IsUniformScaled () |
void | ApplyEulerAngles (Vec3 eulerAngles) |
Static Public Member Functions | |
static Mat3 | Lerp (Mat3 m1, Mat3 m2, float alpha) |
static Mat3 | CreateMat3WithForward (in Vec3 direction) |
Creates a new rotation matrix which has its forward axis aligned with the given direction. Uses global up vector (0,0,1) if global up is not aligned with the given direction to determine perpendicular frame directions If global up and direction are aligned, uses the global forward vector (0,1,0) for the same purpose. | |
static Mat3 | operator* (Mat3 v, float a) |
Implements matrix scalar product. | |
static bool | operator== (Mat3 m1, Mat3 m2) |
Implements the operator ==. | |
static bool | operator!= (Mat3 m1, Mat3 m2) |
Implements the operator !=. | |
Public Attributes | |
Vec3 | s |
Side vector, also x axis. | |
Vec3 | f |
Forward vector, also y axis. | |
Vec3 | u |
Up vector, also z axis. | |
Properties | |
Vec3 | this[int i] [get, set] |
Implements indexer operation. | |
static Mat3 | Identity [get] |
Returns a identity matrix. | |
s | The side axis. |
f | The forward axis. |
u | The up axis. |
TaleWorlds.Library.Mat3.Mat3 | ( | float | sx, |
float | sy, | ||
float | sz, | ||
float | fx, | ||
float | fy, | ||
float | fz, | ||
float | ux, | ||
float | uy, | ||
float | uz ) |
sx | The side.x. |
sy | The side.y. |
sz | The side.z. |
fx | The forward.x. |
fy | The forward.y. |
fz | The forward.z. |
ux | The up.x. |
uy | The up.y. |
uz | The up.z. |
void TaleWorlds.Library.Mat3.RotateAboutSide | ( | float | a | ) |
a | The amount, in radians, in which to rotate around the x-axis. |
void TaleWorlds.Library.Mat3.RotateAboutForward | ( | float | a | ) |
a | The amount, in radians, in which to rotate around the y-axis. |
void TaleWorlds.Library.Mat3.RotateAboutUp | ( | float | a | ) |
a | The amount, in radians, in which to rotate around the z-axis. |
void TaleWorlds.Library.Mat3.RotateAboutAnArbitraryVector | ( | Vec3 | v, |
float | a ) |
v | The vector to be rotated about. |
a | The amount, in radians, in which to rotate around the param vector. |
bool TaleWorlds.Library.Mat3.IsOrthonormal | ( | ) |
true
if the matrix is orthonormal; otherwise, false
. bool TaleWorlds.Library.Mat3.IsLeftHanded | ( | ) |
bool TaleWorlds.Library.Mat3.NearlyEquals | ( | Mat3 | rhs, |
float | epsilon = MBMath::Epsilon ) |
v | Vector in local frame. |
v | Vector in parent frame. |
m | Matrix in local frame. |
m | Matrix in parent frame. |
void TaleWorlds.Library.Mat3.Orthonormalize | ( | ) |
void TaleWorlds.Library.Mat3.OrthonormalizeAccordingToForwardAndKeepUpAsZAxis | ( | ) |
Mat3 TaleWorlds.Library.Mat3.GetUnitRotation | ( | float | removedScale | ) |
Vec3 TaleWorlds.Library.Mat3.MakeUnit | ( | ) |
bool TaleWorlds.Library.Mat3.IsUnit | ( | ) |
void TaleWorlds.Library.Mat3.ApplyScaleLocal | ( | float | scaleAmount | ) |
scaleAmount | The scale amount. |
void TaleWorlds.Library.Mat3.ApplyScaleLocal | ( | Vec3 | scaleAmountXYZ | ) |
scaleAmountXYZ | The scale amount. |
bool TaleWorlds.Library.Mat3.HasScale | ( | ) |
Vec3 TaleWorlds.Library.Mat3.GetScaleVector | ( | ) |
Vec3 TaleWorlds.Library.Mat3.GetScaleVectorSquared | ( | ) |
void TaleWorlds.Library.Mat3.ToQuaternion | ( | out Quaternion | quat | ) |
Quaternion TaleWorlds.Library.Mat3.ToQuaternion | ( | ) |
direction | Is the forward direction. |
Vec3 TaleWorlds.Library.Mat3.GetEulerAngles | ( | ) |
Mat3 TaleWorlds.Library.Mat3.Transpose | ( | ) |
v | The matrix. |
a | Scalar. |
m1 | The m1. |
m2 | The m2. |
m1 | The m1. |
m2 | The m2. |
override string TaleWorlds.Library.Mat3.ToString | ( | ) |
override bool TaleWorlds.Library.Mat3.Equals | ( | object | obj | ) |
obj | The generic object to compare with this instance. |
true
if the specified generic object is equal to this instance; otherwise, false
. override int TaleWorlds.Library.Mat3.GetHashCode | ( | ) |
bool TaleWorlds.Library.Mat3.IsIdentity | ( | ) |
bool TaleWorlds.Library.Mat3.IsZero | ( | ) |
bool TaleWorlds.Library.Mat3.IsUniformScaled | ( | ) |
void TaleWorlds.Library.Mat3.ApplyEulerAngles | ( | Vec3 | eulerAngles | ) |
Vec3 TaleWorlds.Library.Mat3.s |
Vec3 TaleWorlds.Library.Mat3.f |
Vec3 TaleWorlds.Library.Mat3.u |
|
getset |
return s if i = 0 return f if i = 1 return u if i = 2
|
staticget |