MCPcopy Create free account
hub / github.com/bumptop/BumpTop / isTailVectorPointingToStackIcon

Method isTailVectorPointingToStackIcon

trunk/win/Source/BT_LassoMenu.cpp:479–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

477}
478
479bool LassoMenu::isTailVectorPointingToStackIcon(float delta) const
480{
481 // returns the angle between the tail vector and the vector to the stack icon
482 if (!actualLassoPoints.empty())
483 {
484 Vec3 back = actualLassoPoints.back();
485 Vec3 fiveBack = actualLassoPoints[NxMath::max((int) 0, (int) actualLassoPoints.size()-5)];
486 Vec3 lassoDir = back - fiveBack;
487 Vec3 stackIconPos = WorldToClient(stackIcon.getPosition(), true, true);
488 Vec3 stackIconDir = stackIconPos - fiveBack;
489 lassoDir.normalize();
490 stackIconDir.normalize();
491 return (acos(stackIconDir.dot(lassoDir)) * 180 / PI) < delta;
492 }
493 return false;
494}
495
496float LassoMenu::getCurvatureRatio() const
497{

Callers 1

checkForCrossMethod · 0.80

Calls 9

WorldToClientFunction · 0.85
maxClass · 0.50
acosFunction · 0.50
emptyMethod · 0.45
backMethod · 0.45
sizeMethod · 0.45
getPositionMethod · 0.45
normalizeMethod · 0.45
dotMethod · 0.45

Tested by

no test coverage detected