示例#1
0
 private void ModifyValvePair(ModifiableContactPair pair)
 {
     for (int i = 0; i < pair.contactCount; i++)
     {
         // ignore contacts that have right facing normal to create a valve like behaviour
         if (Vector3.Dot(Vector3.right, pair.GetNormal(i)) > 0)
         {
             pair.IgnoreContact(i);
         }
     }
 }
示例#2
0
 private void ModifyNoSeparationPair(ModifiableContactPair pair)
 {
     for (int i = 0; i < pair.contactCount; i++)
     {
         // ignore contacts that have positive separation to prevent ball from bouncing on collider seams
         if (pair.GetSeparation(i) > 0)
         {
             pair.IgnoreContact(i);
         }
     }
 }