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. */
| 1490 | invoke this callback on each obj that matches. |
| 1491 | */ |
| 1492 | void 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 | //---------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected