User Tools

Site Tools


en:examples:physics:objects_from_collision_event

Retrieve Objects from Collision Event

orxSTATUS orxFASTCALL PhysicsEventHandler(const orxEVENT *_pstEvent)
{
    if (_pstEvent->eType == orxEVENT_TYPE_PHYSICS) {
        orxPHYSICS_EVENT_PAYLOAD* payload = (orxPHYSICS_EVENT_PAYLOAD*)event->pstPayload; 
 
        if(_pstEvent->eID == orxPHYSICS_EVENT_CONTACT_ADD) {
	    orxOBJECT *pstRecipientObject, *pstSenderObject;
 
            /* Gets colliding objects */
            pstRecipientObject = orxOBJECT(_pstEvent->hRecipient);
            pstSenderObject = orxOBJECT(_pstEvent->hSender);
        }
    }
}

en/examples/physics/objects_from_collision_event.txt · Last modified: 2018/02/14 00:47 (7 years ago) by 127.0.0.1