MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / testObject

Method testObject

Engine/source/T3D/trigger.cpp:672–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670//--------------------------------------------------------------------------
671
672bool Trigger::testObject(GameBase* enter)
673{
674 if (mTriggerPolyhedron.mPointList.size() == 0)
675 return false;
676
677 if (!(enter->getTypeMask() & mTrippedBy))
678 return false; //not the right type of object
679
680 mClippedList.clear();
681
682 SphereF sphere;
683 sphere.center = (mWorldBox.minExtents + mWorldBox.maxExtents) * 0.5;
684 VectorF bv = mWorldBox.maxExtents - sphere.center;
685 sphere.radius = bv.len();
686
687 enter->buildPolyList(PLC_Collision, &mClippedList, mWorldBox, sphere);
688 return mClippedList.isEmpty() == false;
689}
690
691bool Trigger::testTrippable()
692{

Callers

nothing calls this directly

Calls 6

getTypeMaskMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45
lenMethod · 0.45
buildPolyListMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected