|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Leaf
javax.media.j3d.Behavior
com.vwp.j3d.utils.behaviors.keyboard.KeyNavigatorBehavior
public class KeyNavigatorBehavior
This class is a simple behavior that invokes the KeyNavigator to modify the view platform transform. This implementation bases partially on the KeyNavigatorBehaviour from Sun Inc.
| Field Summary | |
|---|---|
static int |
MODE_FREEFLY_SPACE
Mode flag: if this one is set using setmode() the underlying KeyNavigator acts like a spaceship which allowes changing of the altitude in case up- or downRotAngle are used. |
static int |
MODE_NOALTITUDE
Mode flag: if MODE_NOALTITUDE is set using setMode() the underlying KeyNavigator simulates an object which ich influenced by gravity and a ground below of it, the up- and downRotAngles don't affect the altitude but they simulate a heads position |
| Fields inherited from class javax.media.j3d.Node |
|---|
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING |
| Constructor Summary | |
|---|---|
KeyNavigatorBehavior(boolean handleLinuxBug,
javax.media.j3d.TransformGroup targetTG,
javax.media.j3d.Node armingNode)
Constructs a new key navigator behavior node that operates on the specified transform group and with the specified configuration |
|
KeyNavigatorBehavior(boolean handleLinuxBug,
javax.media.j3d.TransformGroup targetTG,
javax.media.j3d.Node armingNode,
double speedScalingFactor,
boolean flyingEnabled,
boolean inverseHeadAngle)
Constructs a new key navigator behavior node that operates on the specified transform group and with the specified configuration |
|
KeyNavigatorBehavior(boolean handleLinuxBug,
javax.media.j3d.TransformGroup targetTG,
javax.media.j3d.Node armingNode,
double speedScalingFactor,
boolean flyingEnabled,
boolean inverseHeadAngle,
FrameActionTrigger trigObj)
Constructs a new key navigator behavior node that operates on the specified transform group and with the specified configuration |
|
KeyNavigatorBehavior(boolean handleLinuxBug,
javax.media.j3d.TransformGroup targetTG,
javax.media.j3d.Node armingNode,
FrameActionTrigger trigObj)
Constructs a new key navigator behavior node that operates on the specified transform group and with the specified configuration |
|
| Method Summary | |
|---|---|
void |
emulateFrameSwitch(int framerate)
This method lets this Interpolator work also if no frame switching occurs |
void |
enableDeceleration(boolean set)
Enables or disables the deceleration, a delayed stopping of the movement when a direction key is released |
void |
fadeSpeedFactor(double speedScalingFactor,
double fadeTimeMSecs)
Fades the nominal speed of the KeyNavigator to a new value. |
float |
getFPS()
Because this Behaviour is called every frame, it implements an FPS counter too. |
void |
getLocation(javax.vecmath.Vector3d pos,
javax.vecmath.Point3f angle)
Gets the actual position and angle. |
void |
initialize()
Override Behavior's initialize method to setup wakeup criteria. |
boolean |
isMoving()
Specifies if currently a movement is handled |
void |
keyPressed(KeyEvent e)
|
void |
keyReleased(KeyEvent e)
|
void |
keyTyped(KeyEvent e)
|
void |
processStimulus(Enumeration criteria)
Override Behavior's stimulus method to handle the events. |
void |
setCheckCollisions(boolean checkCollisions,
XBranchGroup CollisionRootBranch)
Enables or disables the collision prevention algorithm. |
void |
setCollisionArmingNode(javax.media.j3d.Node armingNode)
Sets the node which is used for the WakeUpOnCollisionXxx conditions. |
void |
setFlyingEnabled(boolean flyingEnabled)
Enables or disables the possibility to fly using ALT+page up/down This method calls the corresponding method of the KeyNavigator directly. |
void |
setFollowTerrain(boolean followTerrain,
XBranchGroup CollisionRootBranch,
double terrainStepHeight)
Enables or disables the terrain following algorithm. |
void |
setFrameActionTrigger(FrameActionTrigger trigObj)
Here an object is handed over which has inherited from FramActionTrigger; it is called once per frame to perform several operations without creating an own behavior |
void |
setHeadAngle(boolean inverseHeadAngle,
float minHeadAngle,
float maxHeadAngle)
Configures the settings for the head-angle (=x-angle) in MODE_NOALTITUDE. |
void |
setLocation(javax.vecmath.Vector3d pos,
javax.vecmath.Point3f angle,
double EyeHeight)
(Re)Sets the actual position, angle and eyeheight This method calls the corresponding method of the KeyNavigator directly. |
void |
setMode(int Mode)
Changes the operational mode and the behaviour of the KeyNavigator. |
void |
setSkyObjectData(javax.media.j3d.TransformGroup skyTG,
float heightOffset)
In case a skybox, skyplane etc. has to be used it is possible to activate its control using this method. |
void |
setSpeedFactor(double speedScalingFactor)
Changes the nominal speed of the KeyNavigator. |
| Methods inherited from class javax.media.j3d.Behavior |
|---|
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences |
| Methods inherited from class javax.media.j3d.Node |
|---|
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
| Methods inherited from class javax.media.j3d.SceneGraphObject |
|---|
clearCapability, clearCapabilityIsFrequent, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MODE_FREEFLY_SPACE
public static final int MODE_NOALTITUDE
| Constructor Detail |
|---|
public KeyNavigatorBehavior(boolean handleLinuxBug,
javax.media.j3d.TransformGroup targetTG,
javax.media.j3d.Node armingNode,
double speedScalingFactor,
boolean flyingEnabled,
boolean inverseHeadAngle,
FrameActionTrigger trigObj)
handleLinuxBug - enables a workaround for a bug in the Linux JVMtargetTG - the target transform groupspeedScalingFactor - changes the nominal speed of the KeyNavigatorflyingEnabled - enables/disables flying (ALT+page up/down)inverseHeadAngle - inverts the direction of operation of the page
up/down keystrigObj - this class specifies an class which has inherited from
FramActionTrigger; it is called once per frame to perform several
operations without creating an own behavior
public KeyNavigatorBehavior(boolean handleLinuxBug,
javax.media.j3d.TransformGroup targetTG,
javax.media.j3d.Node armingNode,
double speedScalingFactor,
boolean flyingEnabled,
boolean inverseHeadAngle)
handleLinuxBug - enables a workaround for a bug in the Linux JVMtargetTG - the target transform groupspeedScalingFactor - changes the nominal speed of the KeyNavigatorflyingEnabled - enables/disables flying (ALT+page up/down)inverseHeadAngle - inverts the direction of operation of the page
up/down keys
public KeyNavigatorBehavior(boolean handleLinuxBug,
javax.media.j3d.TransformGroup targetTG,
javax.media.j3d.Node armingNode,
FrameActionTrigger trigObj)
handleLinuxBug - enables a workaround for a bug in the Linux JVMtargetTG - the target transform grouparmingNode - the node which arms the collision conditionstrigObj - this class specifies an class which has inherited from
FramActionTrigger; it is called once per frame to perform several
operations without creating an own behavior
public KeyNavigatorBehavior(boolean handleLinuxBug,
javax.media.j3d.TransformGroup targetTG,
javax.media.j3d.Node armingNode)
handleLinuxBug - enables a workaround for a bug in the Linux JVMtargetTG - the target transform grouparmingNode - the node which arms the collision conditions| Method Detail |
|---|
public void enableDeceleration(boolean set)
set - true if deceleration has to be enabled or false otherwise
public void setSkyObjectData(javax.media.j3d.TransformGroup skyTG,
float heightOffset)
skyTG - the TransformGroup which holds the sky-object and which has
to be modifiedheightOffset - specifies the y-offset for the sky-object; this value
influences the absolute height of the sky-object which is always
located at an y-value of y-position of the viewer + eye height +
this heightOffsetpublic void emulateFrameSwitch(int framerate)
framerate - the number of frames per second which have to be emulatedpublic void setFrameActionTrigger(FrameActionTrigger trigObj)
trigObj - the new object which has to be triggered once per frame or
null if none has to be usedpublic void setSpeedFactor(double speedScalingFactor)
speedScalingFactor - - factor which modifies the speed, values less
than 1 decrease the default speed
public void fadeSpeedFactor(double speedScalingFactor,
double fadeTimeMSecs)
speedScalingFactor - factor which modifies the speedfadeTimeMSecs - the time in millisecond the fading requires until the
new speedScalingFactor has to be set
public void setHeadAngle(boolean inverseHeadAngle,
float minHeadAngle,
float maxHeadAngle)
inverseHeadAngle - specifies if the functionality of the page
up/down keys has to be exchanged (true) or not (false)minHeadAngle - lower maximum the head can be rotated tomaxHeadAngle - upper maximum the head can be rotated topublic void setFlyingEnabled(boolean flyingEnabled)
flyingEnabled - enable flying (true) or disable it (false
public void setLocation(javax.vecmath.Vector3d pos,
javax.vecmath.Point3f angle,
double EyeHeight)
pos - specifies the actual positionangle - specifies the actual rotation anglesEyeHeight - specifies the actual EyeHeigt, that means the distance between the
camera position and the ground
public void getLocation(javax.vecmath.Vector3d pos,
javax.vecmath.Point3f angle)
pos - this vector is filled with the actual position informationangle - this Quat4d object is filled with the actual rotation angle
information
public void setCheckCollisions(boolean checkCollisions,
XBranchGroup CollisionRootBranch)
checkCollisions - specifies if collision prevention has to be
performed (true) or not (false)CollisionRootBranch - the branch group which has to be used for
collision detection
public void setFollowTerrain(boolean followTerrain,
XBranchGroup CollisionRootBranch,
double terrainStepHeight)
followTerrain - specifies if terrain following has to be performed
(true) or not (false)CollisionRootBranch - - the branch group which has to be used for
terrains collision detectionterrainStepHeight - maximum height which can be climbed; if terrain
following is enabled this value has to be greater than 0 to let it
take effect, elsewhere only down steps are possiblepublic void setMode(int Mode)
Mode - the value for the new operational modepublic float getFPS()
public void setCollisionArmingNode(javax.media.j3d.Node armingNode)
armingNode - the node which arms the conditionspublic void initialize()
initialize in class javax.media.j3d.Behaviorpublic void processStimulus(Enumeration criteria)
processStimulus in class javax.media.j3d.Behaviorpublic boolean isMoving()
public void keyPressed(KeyEvent e)
keyPressed in interface KeyListenerpublic void keyReleased(KeyEvent e)
keyReleased in interface KeyListenerpublic void keyTyped(KeyEvent e)
keyTyped in interface KeyListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||