Exemple #1
0
 public Contact(Collidable firstBody, Plane plane)
 {
     this.body[0] = firstBody;
     this.body[1] = null;
     this.WithPlane = true;
     this.plane = new HalfSpace(plane);
     ContactToWorld = new Matrix3();
     restitution = 0.7f;
     friction = 0.3f; // TODO add a dynamic mechanism
 }
Exemple #2
0
 public override Boolean CollidesWith(HalfSpace plane)
 {
     //TOOD add CollidesWith() code here
     PlaneIntersectionType p = sphere.Intersects(plane.plane);
     if (p == PlaneIntersectionType.Intersecting)
     {
         return true;
     }
     return false;
 }
 /// <summary>
 /// Removes a Plane from the Planes Set.
 /// warning : this method is expensive O(n) , try to not use this in update
 /// </summary>
 /// <param name="plane"></param>
 public void RemovePlane(HalfSpace plane)
 {
     this.planes.Remove(plane);
 }
 /// <summary>
 /// Adds a Plane to the Planes Set to check for associated collisions
 /// </summary>
 /// <param name="plane"></param>
 public void AddPlane(HalfSpace plane)
 {
     this.planes.AddLast(plane);
 }
Exemple #5
0
 public void FindPotentialCollisionsWithPlane(List<Contact> Potentials, HalfSpace P)
 {
     if (this.Volume.Intersects(P.plane) == PlaneIntersectionType.Intersecting)
     {
         if (this.isLeaf())
         {
             Potentials.Add(new Contact(this.Body, P.plane));
         }
         else
         {
             this.Children[0].FindPotentialCollisionsWithPlane(Potentials, P);
             this.Children[1].FindPotentialCollisionsWithPlane(Potentials, P);
         }
     }
 }
Exemple #6
0
 public override Boolean CollidesWith(HalfSpace plane)
 {
     return true;
 }
Exemple #7
0
 public abstract Boolean CollidesWith(HalfSpace plane);