MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Project

Method Project

Source/Engine/Core/Math/Vector3.cs:1355–1361  ·  view source on GitHub ↗

Projects a vector onto another vector. The vector to project. The projection normal vector. The projected vector.

(Vector3 vector, Vector3 onNormal)

Source from the content-addressed store, hash-verified

1353 /// <param name="onNormal">The projection normal vector.</param>
1354 /// <returns>The projected vector.</returns>
1355 public static Vector3 Project(Vector3 vector, Vector3 onNormal)
1356 {
1357 Real sqrMag = Dot(onNormal, onNormal);
1358 if (sqrMag < Mathr.Epsilon)
1359 return Zero;
1360 return onNormal * Dot(vector, onNormal) / sqrMag;
1361 }
1362
1363 /// <summary>
1364 /// Projects a vector onto a plane defined by a normal orthogonal to the plane.

Callers

nothing calls this directly

Calls 2

DotFunction · 0.85
ProjectClass · 0.85

Tested by

no test coverage detected