MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / SquareDistance

Method SquareDistance

Source/GameToolbox/math.cpp:27–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 return std::clamp(a - floorf(a / length) * length, 0.0f, length);
26}
27float GameToolbox::SquareDistance(float xa, float ya, float xb, float yb) {
28 return ((xb - xa) * (xb - xa)) + ((yb - ya) * (yb - ya));
29}
30float GameToolbox::SquareDistance(ax::Vec2 a, ax::Vec2 b) {
31 return SquareDistance(a.x, a.y, b.x, b.y);
32}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected