Ejemplo n.º 1
0
 public override SegmentCollisionResult CollideLineSegment(ShapeLineSegment other)
 {
     //We can just do a line-line intersection, as if both Segments are Lines,
     //and then see if the point of intersection
     //is on both segments. No need for ridiculous math here!
     ShapeLine one = ToLine();
     ShapeLine two = other.ToLine();
     LineCollisionResult res = one.CollideLines(two);
     if(res.Collides && PointLiesOnSegment(res.PointOfIntersection) && other.PointLiesOnSegment(res.PointOfIntersection))
     {
         return new SegmentCollisionResult {Collides = true, PointOfCollision = res.PointOfIntersection};
     }
     return new SegmentCollisionResult();
 }
Ejemplo n.º 2
0
 public override SegmentCollisionResult CollideLineSegment(ShapeLineSegment collidingWith)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
 public abstract SegmentCollisionResult CollideLineSegment(ShapeLineSegment collidingWith);