Package buildengine.math.collision
Class Collisions
java.lang.Object
buildengine.math.collision.Collisions
Handling Collisions using the BuildEngine shape system.
-
Method Summary
-
Method Details
-
compare
Compare two shapes for collision. This method applies the fastest method to do that, but is still pretty performance intensive if used extensively. If so, make sure you do proximity checks first, than use this method for possible collisions.- Parameters:
a
- The first shape.b
- The second shape.- Returns:
- The contact object containing the vector to move
a
out ofb
. Returnsnull
if there is no collision. - Throws:
IllegalArgumentException
- If there is not (yet) a way to compare the two shape objects.
-
compareRectangle
Compare two rectangles for collision. Does a lazy check first.- Parameters:
a
- The first rectangle.b
- The second rectangle.- Returns:
- The contact object containing the vector to move
a
out ofb
. Returnsnull
if there is no collision.
-
contain
Contains a point in a shape for collision. This method applies the fastest method to do that, but is still pretty performance intensive if used extensively. If so, make sure you do proximity checks first, than use this method for possible collisions.- Parameters:
a
- The shapepoint
- The point- Returns:
- A contact object if there is collision containing the vector to move
a
out ofpoint
. Otherwisenull
. - Throws:
IllegalArgumentException
- If there is not (yet) a way to contain the shape object.
-