11-03-2021, 09:10 AM
(This post was last modified: 11-03-2021, 09:11 AM by josemendez.)
This code doesn't make much sense. You're indexing the particleToActor arrays using contact.bodyA and contact.bodyB that are simplex indices, not particle indices. So it will check unrelated particles at best, or result in an out of bounds access exception at worst. My guess is that it's checking the sheep against itself.
It should be:
See "Retrieving the particle involved in a contact" in the manual:
http://obi.virtualmethodstudio.com/tutor...sions.html
let me know how it goes!
It should be:
Code:
var pa = solver.particleToActor[solver.simplices[contact.bodyA]];
var po = solver.particleToActor[solver.simplices[contact.bodyB]];
See "Retrieving the particle involved in a contact" in the manual:
http://obi.virtualmethodstudio.com/tutor...sions.html
let me know how it goes!