M&B: Bannerlord 1.2.7
The horns sound, the ravens gather.
Loading...
Searching...
No Matches
TaleWorlds.Library.MatrixFrame Struct Reference

Defines Matrix frame class for a coordinate frame.

Public Member Functions

 MatrixFrame (Mat3 rot, Vec3 o)
 Initializes a new instance of matrix frame.
 
 MatrixFrame (float _11, float _12, float _13, float _21, float _22, float _23, float _31, float _32, float _33, float _41, float _42, float _43)
 Initializes a new instance of matrix frame from a 4x3 matrix(in flat form)
 
 MatrixFrame (float _11, float _12, float _13, float _14, float _21, float _22, float _23, float _24, float _31, float _32, float _33, float _34, float _41, float _42, float _43, float _44)
 
Vec3 TransformToParent (Vec3 v)
 Transforms vector to parent frame.
 
Vec3 TransformToLocal (Vec3 v)
 Transforms vector to local frame.
 
Vec3 TransformToLocalNonUnit (Vec3 v)
 
bool NearlyEquals (MatrixFrame rhs, float epsilon=MBMath.Epsilon)
 
Vec3 TransformToLocalNonOrthogonal (Vec3 v)
 
MatrixFrame TransformToLocalNonOrthogonal (ref MatrixFrame frame)
 
MatrixFrame TransformToParent (MatrixFrame m)
 Transforms a matrix frame to parent frame.
 
MatrixFrame TransformToLocal (MatrixFrame m)
 Transforms matrix frame to local frame.
 
Vec3 TransformToParentWithW (Vec3 _s)
 
MatrixFrame GetUnitRotFrame (float removedScale)
 
MatrixFrame Inverse ()
 
void Rotate (float radian, Vec3 axis)
 
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.
 
MatrixFrame Strafe (float a)
 Moves the origin on the local x-coordinate of the frame.
 
MatrixFrame Advance (float a)
 Moves the origin on the local y-coordinate of the frame.
 
MatrixFrame Elevate (float a)
 Moves the origin on the local z-coordinate of the frame.
 
void Scale (Vec3 scalingVector)
 Scales the matrix frame according to scaling vector.
 
Vec3 GetScale ()
 
void Fill ()
 
void AssertFilled ()
 

Static Public Member Functions

static MatrixFrame Lerp (MatrixFrame m1, MatrixFrame m2, float alpha)
 
static MatrixFrame Slerp (MatrixFrame m1, MatrixFrame m2, float alpha)
 
static MatrixFrame operator* (MatrixFrame m1, MatrixFrame m2)
 Implements the operator *.
 
static bool operator== (MatrixFrame m1, MatrixFrame m2)
 Implements the operator ==.
 
static bool operator!= (MatrixFrame m1, MatrixFrame m2)
 Implements the operator !=.
 
static MatrixFrame CreateLookAt (Vec3 position, Vec3 target, Vec3 upVector)
 Builds a left-handed look-at matrix.
 
static MatrixFrame CenterFrameOfTwoPoints (Vec3 p1, Vec3 p2, Vec3 upVector)
 

Public Attributes

Mat3 rotation
 Rotation matrix.
 
Vec3 origin
 Origin of coordinate frame wrt to parent frame.
 

Properties

static MatrixFrame Identity [get]
 Gets an identity frame.
 
static MatrixFrame Zero [get]
 
bool IsIdentity [get]
 
bool IsZero [get]
 
float this[int i, int j] [get, set]
 

Constructor & Destructor Documentation

◆ MatrixFrame() [1/3]

TaleWorlds.Library.MatrixFrame.MatrixFrame ( Mat3  rot,
Vec3  o 
)
Parameters
rotThe rotation matrix.
oThe origin point.

◆ MatrixFrame() [2/3]

TaleWorlds.Library.MatrixFrame.MatrixFrame ( float  _11,
float  _12,
float  _13,
float  _21,
float  _22,
float  _23,
float  _31,
float  _32,
float  _33,
float  _41,
float  _42,
float  _43 
)
Parameters
_11The _11.
_12The _12.
_13The _13.
_21The _21.
_22The _22.
_23The _23.
_31The _31.
_32The _32.
_33The _33.
_41The _41.
_42The _42.
_43The _43.

◆ MatrixFrame() [3/3]

TaleWorlds.Library.MatrixFrame.MatrixFrame ( float  _11,
float  _12,
float  _13,
float  _14,
float  _21,
float  _22,
float  _23,
float  _24,
float  _31,
float  _32,
float  _33,
float  _34,
float  _41,
float  _42,
float  _43,
float  _44 
)

Member Function Documentation

◆ TransformToParent() [1/2]

Vec3 TaleWorlds.Library.MatrixFrame.TransformToParent ( Vec3  v)
Parameters
vVector in local frame.
Returns
Vector in parent frame.

◆ TransformToLocal() [1/2]

Vec3 TaleWorlds.Library.MatrixFrame.TransformToLocal ( Vec3  v)
Parameters
vVector in parent frame.
Returns
Vector in local frame.

◆ TransformToLocalNonUnit()

Vec3 TaleWorlds.Library.MatrixFrame.TransformToLocalNonUnit ( Vec3  v)

◆ NearlyEquals()

bool TaleWorlds.Library.MatrixFrame.NearlyEquals ( MatrixFrame  rhs,
float  epsilon = MBMath::Epsilon 
)

◆ TransformToLocalNonOrthogonal() [1/2]

Vec3 TaleWorlds.Library.MatrixFrame.TransformToLocalNonOrthogonal ( Vec3  v)

◆ TransformToLocalNonOrthogonal() [2/2]

MatrixFrame TaleWorlds.Library.MatrixFrame.TransformToLocalNonOrthogonal ( ref MatrixFrame  frame)

◆ Lerp()

static MatrixFrame TaleWorlds.Library.MatrixFrame.Lerp ( MatrixFrame  m1,
MatrixFrame  m2,
float  alpha 
)
static

◆ Slerp()

static MatrixFrame TaleWorlds.Library.MatrixFrame.Slerp ( MatrixFrame  m1,
MatrixFrame  m2,
float  alpha 
)
static

◆ TransformToParent() [2/2]

MatrixFrame TaleWorlds.Library.MatrixFrame.TransformToParent ( MatrixFrame  m)
Parameters
mMatrix frame in local frame.
Returns
Matrix frame in parent frame.

◆ TransformToLocal() [2/2]

MatrixFrame TaleWorlds.Library.MatrixFrame.TransformToLocal ( MatrixFrame  m)
Parameters
mMatrix frame in parent frame.
Returns
Matrix frame in local frame.

◆ TransformToParentWithW()

Vec3 TaleWorlds.Library.MatrixFrame.TransformToParentWithW ( Vec3  _s)

◆ GetUnitRotFrame()

MatrixFrame TaleWorlds.Library.MatrixFrame.GetUnitRotFrame ( float  removedScale)

◆ Inverse()

MatrixFrame TaleWorlds.Library.MatrixFrame.Inverse ( )

◆ Rotate()

void TaleWorlds.Library.MatrixFrame.Rotate ( float  radian,
Vec3  axis 
)

◆ operator*()

static MatrixFrame TaleWorlds.Library.MatrixFrame.operator* ( MatrixFrame  m1,
MatrixFrame  m2 
)
static
Parameters
m1The m1.
m2The m2.
Returns
The result of the operator.

◆ operator==()

static bool TaleWorlds.Library.MatrixFrame.operator== ( MatrixFrame  m1,
MatrixFrame  m2 
)
static
Parameters
m1The m1.
m2The m2.
Returns
The result of the operator.

◆ operator!=()

static bool TaleWorlds.Library.MatrixFrame.operator!= ( MatrixFrame  m1,
MatrixFrame  m2 
)
static
Parameters
m1The m1.
m2The m2.
Returns
The result of the operator.

◆ ToString()

override string TaleWorlds.Library.MatrixFrame.ToString ( )
Returns
Output string

◆ Equals()

override bool TaleWorlds.Library.MatrixFrame.Equals ( object  obj)
Parameters
objThe generic object to compare with this instance.
Returns
true if the specified generic object is equal to this instance; otherwise, false.

◆ GetHashCode()

override int TaleWorlds.Library.MatrixFrame.GetHashCode ( )
Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

◆ Strafe()

MatrixFrame TaleWorlds.Library.MatrixFrame.Strafe ( float  a)
Parameters
aUnits to strafe

◆ Advance()

MatrixFrame TaleWorlds.Library.MatrixFrame.Advance ( float  a)
Parameters
aUnits to advance

◆ Elevate()

MatrixFrame TaleWorlds.Library.MatrixFrame.Elevate ( float  a)
Parameters
aUnits to elevate

◆ Scale()

void TaleWorlds.Library.MatrixFrame.Scale ( Vec3  scalingVector)
Parameters
scalingVectorUnits to scale

◆ GetScale()

Vec3 TaleWorlds.Library.MatrixFrame.GetScale ( )

◆ CreateLookAt()

static MatrixFrame TaleWorlds.Library.MatrixFrame.CreateLookAt ( Vec3  position,
Vec3  target,
Vec3  upVector 
)
static
Parameters
position
target
upVector
Returns

◆ CenterFrameOfTwoPoints()

static MatrixFrame TaleWorlds.Library.MatrixFrame.CenterFrameOfTwoPoints ( Vec3  p1,
Vec3  p2,
Vec3  upVector 
)
static

◆ Fill()

void TaleWorlds.Library.MatrixFrame.Fill ( )

◆ AssertFilled()

void TaleWorlds.Library.MatrixFrame.AssertFilled ( )

Member Data Documentation

◆ rotation

Mat3 TaleWorlds.Library.MatrixFrame.rotation

◆ origin

Vec3 TaleWorlds.Library.MatrixFrame.origin

Property Documentation

◆ Identity

MatrixFrame TaleWorlds.Library.MatrixFrame.Identity
staticget

◆ Zero

MatrixFrame TaleWorlds.Library.MatrixFrame.Zero
staticget

◆ IsIdentity

bool TaleWorlds.Library.MatrixFrame.IsIdentity
get

◆ IsZero

bool TaleWorlds.Library.MatrixFrame.IsZero
get

◆ this[int i, int j]

float TaleWorlds.Library.MatrixFrame.this[int i, int j]
getset