예제 #1
0
 private void ModifyBoostPair(ModifiableContactPair pair)
 {
     for (int i = 0; i < pair.contactCount; i++)
     {
         // set the target velocity to create "boost pad".
         pair.SetTargetVelocity(i, new Vector3(-35, 0, 0));
     }
 }
예제 #2
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);
         }
     }
 }
예제 #3
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);
         }
     }
 }