Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem detecting collisions between two softbodies
#2
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:

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!
Reply


Messages In This Thread
RE: Problem detecting collisions between two softbodies - by josemendez - 11-03-2021, 09:10 AM