| 878 | } |
| 879 | |
| 880 | Mat2f 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 | |
| 892 | void SL::Frame(const Spline2& spline, float t, Mat2f* frameInOut) |
| 893 | { |