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

Function TriVectorProjectOnPlane

trinity/TriMath.cpp:60–66  ·  view source on GitHub ↗

Projects a point onto a plane

Source from the content-addressed store, hash-verified

58
59// Projects a point onto a plane
60Vector3 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
69Vector3 TriVectorRotateToPlane( const Vector3& point, const Vector3& p0, const Vector3& n )

Callers 1

AddLineMethod · 0.85

Calls 1

DotFunction · 0.50

Tested by

no test coverage detected