After the collision, the collision body determines the speed, but before it starts moving, is it possible to change its direction of movement? #54
Replies: 1 comment 3 replies
-
Present-tense events like DetectingInitialCollision would give you a callback from within the execution of collision detection. Past-tense events like InitialCollisionDetected are dispatched in a deferred way at the end of the frame. (The reason for the split is that the 'inline' version of events requires that you deal with potentially multithreaded dispatch, since they're called from within collision detection.) If you do use the inline events, note that modifying the velocity of a body is a potentially dangerous operation. Multiple events might fire simultaneously across different threads and attempt to modify the same body values. Reading the velocity from multiple threads, though, would be fine. |
Beta Was this translation helpful? Give feedback.
-
Hello, I have a question. I want to change the speed and direction of the collision body after two objects collide and contact, and determine the speed at the moment of collision, but before they start moving. Is there such an interface? Is it in InitialCollisionDetected? Is this callback after the collision speed is determined but before the position changes? If I change the speed of the object in this callback, will there be other simulation processes to change the speed of the object later?
Beta Was this translation helpful? Give feedback.
All reactions