|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpacman.engine.Physics
public class Physics
A class that handles the movement through the scene and the keyboard input.
| Field Summary | |
|---|---|
private int |
animStart
Keeps track of what frame the current animation started on |
private int |
flag
Determines whether to turn left (-1), turn right (1), turn around (-2 or 2) or move (0) |
private int |
frame
Keeps track of which frame of the animation is being rendered |
private int |
lastFlag
Keeps track of the last animation run and ensures that animStart is not constantly overwritten |
(package private) static javax.vecmath.Matrix3d |
m3d
|
private MenuPanel |
menu
|
private boolean |
modflag
Determines whether or not the flag variable can be modified |
private java.lang.Thread |
t
|
(package private) static javax.media.j3d.Transform3D |
t3d
|
(package private) static javax.media.j3d.TransformGroup |
tg
|
(package private) static javax.vecmath.Vector3d |
v3d
|
private double |
viewAngle
Keeps track of the view's current angle (0 = the initial view direction) |
(package private) static javax.vecmath.Vector3d |
vLook
|
(package private) static javax.vecmath.Vector3d |
vPos
|
private World |
world
|
| Constructor Summary | |
|---|---|
Physics(MenuPanel mp,
World w)
Instantiates the class with the specified parent MenuPanel and World. |
|
| Method Summary | |
|---|---|
void |
keyPressed(java.awt.event.KeyEvent ke)
Handles keyboard input. |
void |
keyReleased(java.awt.event.KeyEvent ke)
Remnant of KeyListener interface; not used. |
void |
keyTyped(java.awt.event.KeyEvent ke)
Remnant of KeyListener interface; not used. |
void |
move()
Moves the camera forward. |
void |
run()
This method runs the Physics processing. |
void |
start()
Starts the thread. |
void |
stop()
Stops the thread. |
void |
turnLeft()
Turns left by rotating the camera counterclockwise. |
void |
turnRight()
Turns right by rotating the camera clockwise. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private MenuPanel menu
private World world
private java.lang.Thread t
private int flag
private int lastFlag
private boolean modflag
private int frame
private int animStart
private double viewAngle
static javax.media.j3d.TransformGroup tg
static javax.media.j3d.Transform3D t3d
static javax.vecmath.Matrix3d m3d
static javax.vecmath.Vector3d v3d
static javax.vecmath.Vector3d vPos
static javax.vecmath.Vector3d vLook
| Constructor Detail |
|---|
public Physics(MenuPanel mp,
World w)
| Method Detail |
|---|
public void start()
public void stop()
public void run()
run in interface java.lang.Runnablepublic void move()
public void turnRight()
public void turnLeft()
public void keyPressed(java.awt.event.KeyEvent ke)
keyPressed in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent ke)
keyTyped in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent ke)
keyReleased in interface java.awt.event.KeyListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||