edu.eside.flingbox.math
Class Intersect

java.lang.Object
  extended by edu.eside.flingbox.math.Intersect

public class Intersect
extends java.lang.Object

Handles functions to compute and storage intersections between two traces.


Field Summary
 Vector2D[] contourA
          Stores array with intersect contour of first polygon
 Vector2D[] contourB
          Stores array with intersect contour of second polygon
 Vector2D ingoingPoint
          Ingoing point, it's also in contour[0]
 Vector2D outgoingPoint
          Outgoing point, also in contour
 Vector2D[] polygonA
          Just pointer to recognize polygon side
 Vector2D[] polygonB
          Just pointer to recognize polygon side
 
Method Summary
 float getIntersectionDepth()
          Computes intersection penetration.
static Intersect[] intersectPolygons(Vector2D[] polygonA, Vector2D[] polygonB)
          Computes all intersects between two polygons
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

polygonA

public final Vector2D[] polygonA
Just pointer to recognize polygon side


polygonB

public final Vector2D[] polygonB
Just pointer to recognize polygon side


contourA

public final Vector2D[] contourA
Stores array with intersect contour of first polygon


contourB

public final Vector2D[] contourB
Stores array with intersect contour of second polygon


ingoingPoint

public final Vector2D ingoingPoint
Ingoing point, it's also in contour[0]


outgoingPoint

public final Vector2D outgoingPoint
Outgoing point, also in contour

Method Detail

intersectPolygons

public static Intersect[] intersectPolygons(Vector2D[] polygonA,
                                            Vector2D[] polygonB)
Computes all intersects between two polygons

Parameters:
polygonA - first polygon
polygonB - second polygon
Returns:
an array with all intersect. if no intersects, an empty array returned

getIntersectionDepth

public float getIntersectionDepth()
Computes intersection penetration.

Returns:
penetration distance