Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Collision works buggy
#4
There's code for this in theĀ above link to the manual, that you can just copypaste. Retrieve the actor for each simplex:

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


Messages In This Thread
Collision works buggy - by boulder - 11-05-2021, 01:33 AM
RE: Collision works buggy - by josemendez - 11-05-2021, 07:36 AM
RE: Collision works buggy - by boulder - 11-05-2021, 04:20 PM
RE: Collision works buggy - by josemendez - 12-05-2021, 08:52 AM