26-02-2021, 01:27 PM
(This post was last modified: 26-02-2021, 01:32 PM by josemendez.)
Hi,
Collision callbacks return all contacts for all actors in the solver, you can't just grab any contact and then change the color of the current actor, as the contact might be generated by a different one. What you want to do instead is:
- Iterate over all contacts in the solver just once! (not once per rope, as that would quickly become really slow and impractical as you point out).
- See which actor is involved in the contact.
- Change the color of that actor.
The manual contains examples on how to retrieve the actor involved in a contact, see:
http://obi.virtualmethodstudio.com/tutor...sions.html
Collision callbacks return all contacts for all actors in the solver, you can't just grab any contact and then change the color of the current actor, as the contact might be generated by a different one. What you want to do instead is:
- Iterate over all contacts in the solver just once! (not once per rope, as that would quickly become really slow and impractical as you point out).
- See which actor is involved in the contact.
- Change the color of that actor.
The manual contains examples on how to retrieve the actor involved in a contact, see:
http://obi.virtualmethodstudio.com/tutor...sions.html