Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting actors from bodyA and bodyB in Obi 6.0?
#6
Hi Matt,

My bad: there is a difference when accessing particle indices from contacts: now that simplices are a part of the engine and particles are just one simplex type, you should use the solver.simplices array, as contact.bodyA and contact.bodyB are simplex indices, not particle indices.

So instead of:

Code:
solver.particleToActor[contact.bodyA];

you should use:

Code:
solver.particleToActor[solver.simplices[contact.bodyA]];

Notice the extra indirection level: contact.bodyA is an index in the simplices array, and solver.simplices[contact.bodyA] is a particle index.

This wasn't mentioned in the changelog and is undocumented in the manual, so it's entirely my fault. Will update both the changelog and the manual asap.

Let me know how it goes,
Reply


Messages In This Thread
RE: Getting actors from bodyA and bodyB in Obi 6.0? - by josemendez - 16-02-2021, 11:38 AM