Obi Official Forum
Help In more than one rope, it is not seen which ropes are in contact with each other. - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help In more than one rope, it is not seen which ropes are in contact with each other. (/thread-3559.html)



In more than one rope, it is not seen which ropes are in contact with each other. - hy411 - 19-08-2022

[attachment=1446]Hello,

In more than one rope, it is not seen which ropes are in contact with each other. I have multiple ropes under the one solver.

Rope1 and Rope2 colliding but , Pa and Pb gives same Rope(Rope 1) , same blueprint ( not saying other interacted rope) . but it doesn't say which of the two interacting rope is which. how can i learn each of the collided rope


RE: In more than one rope, it is not seen which ropes are in contact with each other. - josemendez - 19-08-2022

(19-08-2022, 12:05 PM)hy411 Wrote: Hello,

In more than one rope, it is not seen which ropes are in contact with each other. I have multiple ropes under the one solver.

Rope1 and Rope2 colliding but , Pa and Pb gives same Rope(Rope 1) , same blueprint ( not saying other interacted rope) . but it doesn't say which of the two interacting rope is which. how can i learn each of the collided rope

Hi there!

You'll find the answer in the manual, in the "Retrieving the actor involved in a contact" section of "Scripting collisions":
http://obi.virtualmethodstudio.com/manual/6.3/scriptingcollisions.html

Quote:The ParticleInActor struct has two public variables:

Actor: A reference to the ObiActor to which this particle belongs. //<--- this is what you need
IndexInActor: The index of this particle in the actor's arrays.

So you can just access pa and pb's actor property to get a reference to the ropes. For instance:

Quote:ObiSolver.ParticleInActor pa = solver.particleToActor[particleIndex];
ObiSolver.ParticleInActor pb = solver.particleToActor[particleIndex];

ObiRope ropeA = pa.actor as ObiRope;
ObiRope ropeB = pb.actor as ObiRope;

if (ropeA == ropeB)
  // self-collision
else
  // inter-collision



RE: In more than one rope, it is not seen which ropes are in contact with each other. - hy411 - 19-08-2022

(19-08-2022, 12:09 PM)josemendez Wrote: Hi there!

You'll find the answer in the manual, in the "Retrieving the actor involved in a contact" section of "Scripting collisions":
http://obi.virtualmethodstudio.com/manual/6.3/scriptingcollisions.html


So you can just access pa and pb's actor property to get a reference to the ropes. For instance:
Okay thank you Sonrisa . It's worked