Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How can i detect if two ropes are twisted
#9
(01-07-2020, 09:34 AM)josemendez Wrote: You're still checking for exactly the same thing as before: if either of the two particles involved in the contact belongs to a certain rope.

You need to check if a contact involves two different ropes. So:

Code:
ObiSolver.ParticleInActor pa1 = solver.particleToActor[contact.particle];
ObiSolver.ParticleInActor pa2 = solver.particleToActor[contact.other];

if (pa1.actor != pa2.actor){
// collision between two different ropes
}

Hi, thanks a lot for this. It works.

Is there any way I can detect 2 ropes not colliding with each other ? It seems to me the collision callback always returns collision result since the particles can collide with themselves.
I check for the count of ObiCollisionEventArgs. If there is 0 count means there is no collision. But the callback are for all the particles/actors in the scene. Is there any way I can set a specific collision call back of 1 single rope only ? Then check for the count of ObiCollisionEventArgs should solve whether the a rope is colliding or not.
Reply


Messages In This Thread
RE: How can i detect if two ropes are twisted - by rand123 - 03-07-2020, 09:40 AM