Projects a point onto a plane
| 58 | |
| 59 | // Projects a point onto a plane |
| 60 | Vector3 TriVectorProjectOnPlane( const Vector3& point, const Vector3& p0, const Vector3& n ) |
| 61 | { |
| 62 | Vector3 out = point - p0; |
| 63 | out = n * Dot( out, n ); |
| 64 | out = point - out; |
| 65 | return out; |
| 66 | } |
| 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 ) |