12-05-2021, 08:52 AM
(This post was last modified: 12-05-2021, 08:55 AM by josemendez.)
There's code for this in theĀ above link to the manual, that you can just copypaste. Retrieve the actor for each simplex:
You do this for both contact.bodyA and contact.bodyB, then compare their respective actors to see if they're the same or not. There's nothing more to it.
Let me know if you need further help. cheers!
Code:
// retrieve the offset and size of the simplex in the solver.simplices array:
int simplexStart = solver.simplexCounts.GetSimplexStartAndSize(contact.bodyA, out int simplexSize);
// get first particle in the simplex:
int firstParticle = solver.simplices[simplexStart];
// retrieve the actor to which this particle belongs:
ObiSolver.ParticleInActor pa = solver.particleToActor[firstParticle];
var actor = pa.actor;
You do this for both contact.bodyA and contact.bodyB, then compare their respective actors to see if they're the same or not. There's nothing more to it.
Let me know if you need further help. cheers!