Hello, just a few questions to get a better understanding on how collision detection works.
- When using the global collision handling (with Runtime), upon a collision between physics bodies (let’s call them ‘x1’ and ‘x2’), am I correct to assume that the handler will be called once with either :
Scenario 1: event.object1 == x1 and event.object2 == x2
OR
Scenario 2: event.object2 == x2 and event.object1 == x1
And it will not call the handler twice with both scenarios. Is this correct?
-
Assuming it is, what determines the order of the event objects? In other words, why would Scenario 1 occur as opposed to Scenario 2 or vice versa? For example, could it have something to do with when an object is created? or where on the display hierarchy they are? OR is it arbitrary?
-
The Collision Detection Documentation states: “If you need to modify /create an object as a result of a collision, your collision handler should set a flag or add a time delay so the change can occur in the next application cycle or later”. Is there a particular set of modifications that this refers to? For example, if I understand correctly, this applies for the isBodyActive property. Does it similarly apply for all other physicsBody properties? What about properties that are not related to physics? Knowing this type of information would help me better understand and plan for the cases in which I should use a time delay (as opposed to making changes to an object within the handler).
Thank you very much for your time and have a nice day!