Projects a vector onto plane but maintains it's length so it's effectively like moving/rotating it onto the plane
| 67 | |
| 68 | // Projects a vector onto plane but maintains it's length so it's effectively like moving/rotating it onto the plane |
| 69 | Vector3 TriVectorRotateToPlane( const Vector3& point, const Vector3& p0, const Vector3& n ) |
| 70 | { |
| 71 | Vector3 out = point - p0; |
| 72 | float length = Length( out ); |
| 73 | out = n * Dot( out, n ); |
| 74 | out = point - out; |
| 75 | // We have the projected position, now scale it to the original distance |
| 76 | out -= p0; |
| 77 | out = Normalize( out ) * length + p0; |
| 78 | return out; |
| 79 | } |
| 80 | |
| 81 | Vector3* TriVectorRotateMatrix( |
| 82 | Vector3* out, |
no test coverage detected