19-08-2022, 12:09 PM
(This post was last modified: 19-08-2022, 12:11 PM by josemendez.)
(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