03-07-2020, 10:55 AM
(This post was last modified: 03-07-2020, 10:55 AM by josemendez.)
(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.Hi there,
Thanks
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).