MCPcopy Create free account
hub / github.com/axmolengine/axmol / getAngle

Method getAngle

core/math/Vec2.cpp:223–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223float Vec2::getAngle(const Vec2& other) const
224{
225 Vec2 a2 = getNormalized();
226 Vec2 b2 = other.getNormalized();
227 float angle = atan2f(a2.cross(b2), a2.dot(b2));
228 if (std::abs(angle) < FLT_EPSILON)
229 return 0.f;
230 return angle;
231}
232
233Vec2 Vec2::rotateByAngle(const Vec2& pivot, float angle) const
234{

Callers 3

addParticlesMethod · 0.45
collideWithPaddleMethod · 0.45

Calls 4

absFunction · 0.50
getNormalizedMethod · 0.45
crossMethod · 0.45
dotMethod · 0.45

Tested by

no test coverage detected