| 79 | } |
| 80 | |
| 81 | Vector3* 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 |
no outgoing calls
no test coverage detected