Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How can i detect if two ropes are twisted
#12
(03-07-2020, 10:26 AM)rand123 Wrote: How should i filter out the contacts ? Like which contact belongs to each actor ? How can i keep a contact counter for each actor. Could you please give me some hints.

Thanks
Hi there,

These are very basic programming concepts, you should check some info on C# variables / arrays / listsĀ  and other structures.

You already know how to identify white pair of actors are involved in each contact, just like we did before:

Code:
ObiActor a1 = solver.particleToActor[contact.particle].actor;
ObiActor a2 = solver.particleToActor[contact.other].actor;

So just add a counter for each actor, and increment it every time you find the actor involved in a contact. This can be done in multitude of ways (a dictionary mapping actor to counter, a component in each actor that contains a counter, etc).
Reply


Messages In This Thread
RE: How can i detect if two ropes are twisted - by josemendez - 03-07-2020, 10:55 AM