MCPcopy Create free account
hub / github.com/chrxh/alien / normalize

Method normalize

source/Base/Math.cpp:54–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void Math::normalize(RealVector2D& v)
55{
56 float l = length(v);
57 if (l > 0.0001f) {
58 v = {v.x / l, v.y / l};
59 } else {
60 v = {1.0f, 0.0f};
61 }
62}
63
64float Math::subtractAngle(float angleMinuend, float angleSubtrahend)
65{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected