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

Method findCallback

Engine/source/T3D/rigidShape.cpp:1492–1512  ·  view source on GitHub ↗

The callback used in by the checkTriggers() method. The checkTriggers method uses a container search which will invoke this callback on each obj that matches. */

Source from the content-addressed store, hash-verified

1490invoke this callback on each obj that matches.
1491*/
1492void RigidShape::findCallback(SceneObject* obj,void *key)
1493{
1494 RigidShape* shape = reinterpret_cast<RigidShape*>(key);
1495 U32 objectMask = obj->getTypeMask();
1496
1497 // Check: triggers, corpses and items, basically the same things
1498 // that the player class checks for
1499 if (objectMask & TriggerObjectType) {
1500 Trigger* pTrigger = static_cast<Trigger*>(obj);
1501 pTrigger->potentialEnterObject(shape);
1502 }
1503 else if (objectMask & CorpseObjectType) {
1504 ShapeBase* col = static_cast<ShapeBase*>(obj);
1505 shape->queueCollision(col,shape->getVelocity() - col->getVelocity());
1506 }
1507 else if (objectMask & ItemObjectType) {
1508 Item* item = static_cast<Item*>(obj);
1509 if (shape != item->getCollisionObject())
1510 shape->queueCollision(item,shape->getVelocity() - item->getVelocity());
1511 }
1512}
1513
1514
1515//----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 5

getTypeMaskMethod · 0.80
potentialEnterObjectMethod · 0.80
queueCollisionMethod · 0.80
getVelocityMethod · 0.45
getCollisionObjectMethod · 0.45

Tested by

no test coverage detected