MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / dirVect

Function dirVect

Engine/CoonsRegularization.cpp:373–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373static Point
374dirVect(const BezierCPs& cps,
375 double time,
376 double t,
377 int sign)
378{
379 Point ret;
380
381 if (sign == 0) {
382 Point pre = predir(cps, time, t);
383 Point post = postdir(cps, time, t);
384 ret.x = pre.x + post.x;
385 ret.y = pre.y + post.y;
386 } else if (sign < 0) {
387 ret = predir(cps, time, t);
388 } else if (sign > 0) {
389 ret = postdir(cps, time, t);
390 }
391
392 double norm = std::sqrt(ret.x * ret.x + ret.y * ret.y);
393 assert(norm != 0);
394 ret.x /= norm;
395 ret.y /= norm;
396
397 return ret;
398}
399
400static Point
401dirVect(const BezierCPs& cps,

Callers 3

splitAtFunction · 0.85
findPointInsideFunction · 0.85

Calls 8

predirFunction · 0.85
postdirFunction · 0.85
getPointAtFunction · 0.85
getRightPointAtFunction · 0.85
getLeftPointAtFunction · 0.85
normFunction · 0.85
sqrtFunction · 0.50
floorFunction · 0.50

Tested by

no test coverage detected