Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  In more than one rope, it is not seen which ropes are in contact with each other.
#1
Pregunta 
[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


Attached Files Thumbnail(s)
       
Reply
#2
(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/manua...sions.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
Reply
#3
(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/manua...sions.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
Reply