MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / VectorNormalize

Function VectorNormalize

src/Util/Raytracer.cpp:20–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20FLOATPT VectorNormalize(FLOATPT nc) {
21 float length = sqrt((nc.x * nc.x) + (nc.y * nc.y) + (nc.z * nc.z));
22 nc.x = nc.x / length;
23 nc.y = nc.y / length;
24 nc.z = nc.z / length;
25 return nc;
26}
27
28FLOATPT NormalVectorCalc(FLOATPT a, FLOATPT b, FLOATPT c) {
29 FLOATPT v1, v2, out;

Callers 2

NormalVectorCalcFunction · 0.85
SumVectorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected