MCPcopy Create free account
hub / github.com/admtrv/objcurses / normalize

Method normalize

utils/mathematics.cpp:58–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58Vec3 Vec3::normalize() const
59{
60 const float mag = magnitude();
61 return (mag > 0) ? (*this * (1.0f / mag)) : Vec3(0.0f, 0.0f, 0.0f);
62}
63
64float Vec3::dot(const Vec3 &a, const Vec3 &b)
65{

Callers 1

mainFunction · 0.45

Calls 1

Vec3Class · 0.85

Tested by

no test coverage detected