MCPcopy Create free account
hub / github.com/carbonengine/trinity / TriVectorRotateMatrix

Function TriVectorRotateMatrix

trinity/TriMath.cpp:81–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81Vector3* TriVectorRotateMatrix(
82 Vector3* out,
83 const Vector3* v,
84 const Matrix* m )
85{
86 // can be optimized quite a lot by skipping the matrix op
87 // that have to do with translation instead of cancelling them out
88 Vector3 temp;
89 temp.x = v->x * m->_11 + v->y * m->_21 + v->z * m->_31;
90 temp.y = v->x * m->_12 + v->y * m->_22 + v->z * m->_32;
91 temp.z = v->x * m->_13 + v->y * m->_23 + v->z * m->_33;
92 *out = temp;
93 return out;
94}
95
96//Rotate a unit vector aligned to one of the axes
97//(defined by xyz) by the quaternion

Callers 6

CalculateSplineDataMethod · 0.85
GetLightsMethod · 0.85
UpdateSyncronousMethod · 0.85
DistanceBaseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected