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

Method DrawSplineTangents

extra/SplinesDraw.cpp:306–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306void SL::DrawSplineTangents(Draw* dd, int numSplines, const Spline2 splines[], const Colour& colour)
307{
308 dd->SetColour(colour);
309
310 for (int i = 0; i < numSplines; i++)
311 {
312 const Spline2& spline = splines[i];
313
314 Vec2f p0 = Position0(spline);
315 Vec2f p1 = Position1(spline);
316
317 Vec2f v0 = Velocity0(spline);
318 Vec2f v1 = Velocity1(spline);
319
320 Vec2f p[] =
321 {
322 p0,
323 p0 + v0 / 3.0f,
324 p1,
325 p1 - v1 / 3.0f,
326 };
327
328 dd->DrawLines(SL_SIZE(p), p);
329 }
330}
331
332void SL::DrawSplineFrames(Draw* dd, int numSplines, const Spline2 splines[], float size, float step, bool consistent)
333{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected