MCPcopy Create free account
hub / github.com/andrewwillmott/splines-lib / Frame

Method Frame

Splines.cpp:880–890  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

878}
879
880Mat2f SL::Frame(const Spline2& spline, float t)
881{
882 Vec2f v = Velocity (spline, t);
883 Vec2f a = Acceleration(spline, t);
884
885 Mat2f frame;
886 frame.x = norm_safe(v); // x = forward
887 frame.y = norm_safe(a - frame.x * dot(frame.x, a)); // y = left or right, pointing in the direction of path turn
888
889 return frame;
890}
891
892void SL::Frame(const Spline2& spline, float t, Mat2f* frameInOut)
893{

Callers

nothing calls this directly

Calls 5

norm_safeFunction · 0.85
dotFunction · 0.85
sqrlenFunction · 0.85
normFunction · 0.85
crossFunction · 0.85

Tested by

no test coverage detected