Determining collision source destination

From TDN

A quick answer to this is simply determing what's calling the "onCollision" function. For example:

function playerClass::onCollision(%srcObj, %dstObj, %srcRef, %dstRef, %time, %normal, %contactCount, %contact){
}

The %srcObj would be the playerClass. So say the player ran into an enemyClass and you want to delete the player. The enemyClass would be "%dstObj", because your calling it from the playerClass. The playerClass is colliding with the destination object (%dstObj).

function playerClass::onCollision(%srcObj, %dstObj, %srcRef, %dstRef, %time, %normal, %contactCount, %contact){
          if(%dstObj.class $= "enemyClass") //check if the object colliding with the player is from an enemyclas
                      %srcObj.safeDelete(); // delete the playerClass object. 
}            

Below is a function being called from the enemyClass instead. It should achieve the same effect, but notice how the source and destination objects have switched since it's now the enemyClass calling the collision check.

function enemyClass::onCollision(%srcObj, %dstObj, %srcRef, %dstRef, %time, %normal, %contactCount, %contact){
             if(%dstObj.class $= "playerClass")
                       %dstObj.safeDelete(); //delete the destination object, since that's the playerClass
}