|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brackeen.javagamebook.game.CollisionDetection
The CollisionDetection class handles collision detection between the GameObjects, and between GameObjects and a BSP tree. When a collision occurs, the GameObject stops.
Constructor Summary | |
CollisionDetection(BSPTree bspTree)
Creates a new CollisionDetection object for the specified BSP tree. |
Method Summary | |
boolean |
checkBSP(GameObject object,
Vector3D oldLocation,
long elapsedTime)
Checks a GameObject against the BSP tree. |
boolean |
checkObject(GameObject objectA,
GameObject objectB,
Vector3D oldLocation)
Returns true if the two specified objects collide. |
boolean |
checkObject(GameObject objectA,
java.util.List objects,
Vector3D oldLocation)
Checks if the specified object collisions with any other object in the specified list. |
BSPPolygon |
checkWalls(GameObject object,
Vector3D oldLocation,
long elapsedTime)
Checks for a game object collision with the walls of the BSP tree. |
BSPPolygon |
getFirstWallIntersection(float x1,
float z1,
float x2,
float z2,
float yBottom,
float yTop)
Gets the first intersection, if any, of the path (x1,z1)-> (x2,z2) with the walls of the BSP tree. |
void |
getFloorAndCeiling(GameObject object)
Gets the floor and ceiling values for the specified GameObject. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CollisionDetection(BSPTree bspTree)
Method Detail |
public boolean checkBSP(GameObject object, Vector3D oldLocation, long elapsedTime)
public void getFloorAndCeiling(GameObject object)
public BSPPolygon checkWalls(GameObject object, Vector3D oldLocation, long elapsedTime)
public BSPPolygon getFirstWallIntersection(float x1, float z1, float x2, float z2, float yBottom, float yTop)
public boolean checkObject(GameObject objectA, java.util.List objects, Vector3D oldLocation)
public boolean checkObject(GameObject objectA, GameObject objectB, Vector3D oldLocation)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |