|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.animation.VJointMoveControl
public class VJointMoveControl
This class uses keyboard input to move an object around. The keyboard input is taken from a keystate determined by a certain Component. Keys: A and D move left and right, W and S move back and forth, Left and right "arrow" keys rotate, Up and down "arrow" keys move back and forth. PageUp and PageDown move up and down. This object is initialized with the VJoint it is supposed to move around. Also, at init time you say whether the keys should be inverted -- this makes the VJointMoveControl usable as a navigationcontrol (moving the scene in inverted way means moving the person view in normal way...) One can pass required keymodifiers KeyEvent.VK_CONTROL/VK_ALT/VK_SHIFT at construction time The control should be connected to a clock -- every clock tick, the controlled VJoint is updated
| Field Summary | |
|---|---|
(package private) float |
angVel
|
private boolean |
bListening
|
private static float |
conv
|
(package private) double |
currentDoubleTime
|
static double |
degToRad
|
private float |
inversionFactor
|
private KeyState |
keyState
|
(package private) double |
lastTime
|
(package private) float |
linVel
|
private float |
maxX
|
private float |
maxY
|
private float |
maxZ
|
private float |
minX
|
private float |
minY
|
private float |
minZ
|
(package private) float[] |
orientation
|
(package private) float[] |
position
|
private float[] |
rotation
|
private float[] |
rotationMatrix
|
(package private) float |
strafeVel
|
private List<Integer> |
theKeyModifiers
|
private VJoint |
theVJoint
|
private float[] |
transformMatrix
|
private float[] |
translation
|
private float[] |
translationMatrix
|
private boolean |
useLimits
|
(package private) float |
vertVel
|
| Constructor Summary | |
|---|---|
VJointMoveControl(Component c,
VJoint joint,
boolean invert,
int[] keyModifiers)
Creates a new VJointMoveControl, listening to Component c for key and mouse events and controlling object 'joint' |
|
VJointMoveControl(Component c,
VJoint joint,
boolean invert,
int[] keyModifiers,
float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ)
Creates a new VJointMoveControl, listening to Component c for key and mouse events and controlling object 'joint', and given limits |
|
| Method Summary | |
|---|---|
protected void |
applyLimits()
|
private boolean |
correctModifiers(KeyState keyState)
Returns true if the keystate contains exactly those modifiers with which this control was initialized |
void |
initTime(double time)
initTime() is called before the Clock starts running, and sends some initial time value. |
void |
setLimits(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ)
|
void |
setListening(boolean l)
|
void |
setOrientation(float xrot,
float yrot,
float zrot)
set the three Euler angles |
void |
setPosition(float[] pos)
set the position vector |
void |
setPosition(float x,
float y,
float z)
set the position vector |
void |
setRollPitchYaw(float roll,
float pitch,
float yaw)
|
void |
setTranslation(float tx,
float ty,
float tz)
|
void |
setVJoint(VJoint newVJoint)
|
void |
time(double currentTime)
Every clock tick, - check the new movements from the keystate, depending on the pressed keys - update the position and orientation of the controlled object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private VJoint theVJoint
private KeyState keyState
private float inversionFactor
private List<Integer> theKeyModifiers
private boolean bListening
private boolean useLimits
private float minX
private float minY
private float minZ
private float maxX
private float maxY
private float maxZ
double currentDoubleTime
double lastTime
float[] position
float[] orientation
private float[] rotation
private float[] translation
private float[] transformMatrix
private float[] rotationMatrix
private float[] translationMatrix
float linVel
float vertVel
float strafeVel
float angVel
public static final double degToRad
private static final float conv
| Constructor Detail |
|---|
public VJointMoveControl(Component c,
VJoint joint,
boolean invert,
int[] keyModifiers,
float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ)
public VJointMoveControl(Component c,
VJoint joint,
boolean invert,
int[] keyModifiers)
| Method Detail |
|---|
public void setLimits(float minX,
float minY,
float minZ,
float maxX,
float maxY,
float maxZ)
public void setVJoint(VJoint newVJoint)
public void setPosition(float[] pos)
public void setPosition(float x,
float y,
float z)
public void setOrientation(float xrot,
float yrot,
float zrot)
public void setRollPitchYaw(float roll,
float pitch,
float yaw)
public void setTranslation(float tx,
float ty,
float tz)
public void setListening(boolean l)
protected void applyLimits()
private boolean correctModifiers(KeyState keyState)
public void initTime(double time)
ClockListener
initTime in interface ClockListenerpublic void time(double currentTime)
time in interface ClockListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||