|
j3d.org Code | ||||||||||
| 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
org.j3d.renderer.java3d.navigation.MouseViewBehavior
A Java3D Behavior based interface to drive navigation.
The behavior looks for AWTEvents for mouse move and mouse motion. It will automatically register itself and the bounds are set to infinity so that it will always run.
To set the classes needed by the underlying navigation handler, you can either ask for the instance and set the values directly, or ask the convenience methods here. These are just pass though and do not add any extra functionality.
| Field Summary |
| 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 | |
MouseViewBehavior()
Create a new behavior with default settings and creates its own NavigationHandler. |
|
MouseViewBehavior(NavigationHandler nav)
Create a new behavior with default settings and uses the supplied NavigationHandler for dealing with the input. |
|
| Method Summary | |
NavigationHandler |
getNavigationHandler()
Get the NavigationHandler instance that this class is using. |
void |
initialize()
Initialise the behavior to start running. |
void |
processStimulus(java.util.Enumeration why)
Process the event that builds the current time. |
void |
setAvatarInfo(float height,
float size,
float stepHeight)
Set the information about the avatar that is used for collisions and navigation information. |
void |
setButtonNavigation(int button,
int state)
Set the ability to use a given state within the handler for a specific mouse button (up to 3). |
void |
setCollisionListener(CollisionListener l)
Set the listener for collision notifications. |
void |
setFrameUpdateListener(FrameUpdateListener l)
Set the listener for frame update notifications. |
void |
setNavigationSpeed(float newSpeed)
Set the navigation speed to the new value. |
void |
setNavigationStateListener(NavigationStateListener l)
Set the listener for navigation state change notifications. |
void |
setViewInfo(javax.media.j3d.View view,
javax.media.j3d.TransformGroup tg)
Set the view and it's related transform group to use. |
void |
setWorldInfo(javax.media.j3d.BranchGroup terrainGroup,
javax.media.j3d.BranchGroup worldGroup)
Set the branchgroups to use for terrain and collision information. |
| Methods inherited from class javax.media.j3d.Behavior |
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOn |
| 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, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MouseViewBehavior()
NavigationHandler.
public MouseViewBehavior(NavigationHandler nav)
NavigationHandler for dealing with the input. If the supplied
reference is null it will create one itself.
nav - The handler for navigation to use| Method Detail |
public void initialize()
public void processStimulus(java.util.Enumeration why)
why - The list of conditions why this was wokenpublic NavigationHandler getNavigationHandler()
public void setWorldInfo(javax.media.j3d.BranchGroup terrainGroup,
javax.media.j3d.BranchGroup worldGroup)
Note For picking purposes, the code currently assumes that both groups do not have any parent transforms. That is, their world origin is the same as the transform group presented in the view information.
terrainGroup - The geometry to use as terrain for followingworldGroup - The geometry to use for collisions
public void setAvatarInfo(float height,
float size,
float stepHeight)
height - The heigth of the avatar above the terrainsize - The distance between the avatar and collidable objectsstepHeight - The height that an avatar can step overpublic void setNavigationSpeed(float newSpeed)
newSpeed - The new speed value to use
java.lang.IllegalArgumentException - The value was negative
public void setButtonNavigation(int button,
int state)
button - The mouse button value from
MouseEventstate - The navigation state to use for that button
public void setViewInfo(javax.media.j3d.View view,
javax.media.j3d.TransformGroup tg)
view - is the View object that we're modifying.tg - The transform group above the view object that should be usedpublic void setFrameUpdateListener(FrameUpdateListener l)
l - The listener to use for this transitionpublic void setCollisionListener(CollisionListener l)
l - The listener to use for updatespublic void setNavigationStateListener(NavigationStateListener l)
l - The listener to use for change updates
|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||