|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.phys2d.raw.collide.ColliderFactory
A collider factory to create colliders for arbitrary bodies, or actually their shapes. This was implemented to replace a visitor-pattern based implementation, that required many files to be edited to add a new shape. Furthermore this factory can handle singleton colliders if needed.
| Constructor Summary | |
ColliderFactory()
|
|
| Method Summary | |
Collider |
createCollider(Body bodyA,
Body bodyB)
Create a collider for two bodies. |
Collider |
createColliderFor(Box shapeA,
Shape shapeB)
Creates a collider for a Box and a Shape. |
Collider |
createColliderFor(Circle shapeA,
Shape shapeB)
Creates a collider for a Circle and a Shape. |
Collider |
createColliderFor(Line shapeA,
Shape shapeB)
Creates a collider for a Line and a Shape. |
Collider |
createColliderFor(Polygon shapeA,
Shape shapeB)
Creates a collider for a ConvexPolygon and a Shape. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ColliderFactory()
| Method Detail |
public Collider createCollider(Body bodyA,
Body bodyB)
throws ColliderUnavailableException
bodyA - First body in the collision testbodyB - Second body in the collision test
ColliderUnavailableException - This exception will be thrown if no suitable collider can be found.
public Collider createColliderFor(Circle shapeA,
Shape shapeB)
throws ColliderUnavailableException
shapeA - The circle to provide a collider forshapeB - The shape to provide a collider for
ColliderUnavailableException - This exception will be thrown if no suitable collider can be found.
public Collider createColliderFor(Box shapeA,
Shape shapeB)
throws ColliderUnavailableException
shapeA - The box to provide a collider forshapeB - The shape to provide a collider for
ColliderUnavailableException - This exception will be thrown if no suitable collider can be found.
public Collider createColliderFor(Line shapeA,
Shape shapeB)
throws ColliderUnavailableException
shapeA - The line to provide a collider forshapeB - The shape to provide a collider for
ColliderUnavailableException - This exception will be thrown if no suitable collider can be found.
public Collider createColliderFor(Polygon shapeA,
Shape shapeB)
throws ColliderUnavailableException
shapeA - The convex polygon to provide a collider forshapeB - The shape to provide a collider for
ColliderUnavailableException - This exception will be thrown if no suitable collider can be found.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||