|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--CollisionHandler
This class implements the simple two dimensional collision handling.
| Field Summary | |
protected static int |
FIELD_HIGH
Playfield high |
protected static int |
FIELD_WIDTH
Playfield width |
protected boolean |
m_bCollision
Collision state |
protected static byte[][] |
m_byarrCollision
Two dimensional collision array |
protected javax.vecmath.Point3f |
m_cCollPoint
Collision location |
protected int |
m_iLastX
Previous player location at the last frame. |
protected int |
m_iLastY
Previous player location at the last frame. |
protected static Tron3D |
m_theApp
Reference to main application |
| Constructor Summary | |
CollisionHandler(javax.vecmath.Point3f cStartPoint)
Initializes the collision array and sets the surrounding walls. |
|
| Method Summary | |
void |
AddCorner(javax.vecmath.Point3f p)
This method should be called at each turn of the player. |
javax.vecmath.Point3f |
getCollPoint()
Returns the location of the collision. |
boolean |
isCollision()
Returns the status of a collision. |
void |
SetLocation(javax.vecmath.Point3f p)
Sets the current location of the player in the collision matrix and checks for a collision. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected static final int FIELD_WIDTH
protected static final int FIELD_HIGH
protected static byte[][] m_byarrCollision
protected static Tron3D m_theApp
protected boolean m_bCollision
protected int m_iLastX
protected int m_iLastY
protected javax.vecmath.Point3f m_cCollPoint
| Constructor Detail |
public CollisionHandler(javax.vecmath.Point3f cStartPoint)
cStartPoint - Start point of the player| Method Detail |
public final boolean isCollision()
public final javax.vecmath.Point3f getCollPoint()
public void SetLocation(javax.vecmath.Point3f p)
p - Current location of the player.public void AddCorner(javax.vecmath.Point3f p)
p - Location of the corner.
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||