|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.web3d.vrml.renderer.ogl.input.DefaultUserInputHandler
public class DefaultUserInputHandler
A complete handler for all user input information within a scene.
The handler takes care of all the handling needed for sensors, anchors, navigation and keyboard. However, it does not define a way of sourcing those events as it assumes that a user will either delegate or extend this class with more specific information such as an AWT listener or Java3D behavior.
The current key handling does not allow keyboard navigation of the world. It passes all key events directly through to the current key sensor if one is registered.
| Constructor Summary | |
|---|---|
DefaultUserInputHandler()
Create a new instance of this class so that we can process events and send them into the VRML scene. |
|
| Method Summary | |
|---|---|
void |
addNavigationStateListener(NavigationStateListener l)
Add a listener for navigation state changes. |
void |
addSensorStatusListener(SensorStatusListener l)
Add a listener for navigation state changes. |
void |
clear()
Clear all the values, listeners etc, except for the clock. |
boolean |
getNavigationEnabled()
Get the currently set navigation state. |
void |
getOrientation(javax.vecmath.AxisAngle4f ori)
Get the current user orientation. |
void |
getPosition(javax.vecmath.Vector3f pos)
Get the current user position. |
void |
notifyAvatarSizeChanged(float[] size,
int numValid)
Notification that the avatar size has changed on the current NavigationInfo node. |
void |
notifyHeadlightChanged(boolean enable)
Notification that headlight state has changed. |
void |
notifyNavigationModesChanged(java.lang.String[] newModes,
int numValid)
Notification that the navigation modes allowed has changed on the current NavigationInfo node. |
void |
notifyNavigationSpeedChanged(float newSpeed)
Notification that the navigation speed has changed on the current NavigationInfo node. |
void |
notifyVisibilityLimitChanged(float distance)
Notification that the visibility limit has been changed. |
void |
processNavigation()
Process any navigation velocity. |
void |
removeNavigationStateListener(NavigationStateListener l)
Remove a navigation state listener. |
void |
removeSensorStatusListener(SensorStatusListener l)
Remove a navigation state listener. |
void |
sendCurrentNavState()
The layer that contains this handler has just been made the active navigation layer, so send out to the navigation state listeners the current navigation state for this layer. |
void |
setActivateSensors(boolean val)
Sets whether this tracker is eligible to active a sensor. |
void |
setCenterOfRotation(float[] center)
Set the center of rotation explicitly to this place. |
void |
setCollisionListener(CollisionListener l)
Set the listener for collision notifications. |
void |
setNavigationEnabled(boolean state)
Enable or disable navigation processing sub-section of the user input processing. |
void |
setNavigationInfo(VRMLNavigationInfoNodeType navInfo)
Set the navigation info that is used for this scene. |
boolean |
setNavigationMode(java.lang.String mode)
Set the desired navigation mode. |
void |
setPickableScene(org.j3d.aviatrix3d.Group scene)
Set the world group that we are doing the picking on. |
void |
setTestPointingDevices(boolean enabled)
Should pointing devices be tested for. |
void |
setViewInfo(OGLViewpointNodeType vp,
org.j3d.aviatrix3d.TransformGroup tg,
org.j3d.aviatrix3d.SceneGraphPath path)
Set the view and it's related transform group to use and the path to get there from the root of the scene. |
void |
setVRMLClock(VRMLClock clk)
Set the clock we are going to operate from when generating events. |
void |
setWorldScale(float scale)
Set the world scale applied. |
void |
trackerButton(int tracker,
TrackerState state)
Process the buttons on a tracker. |
void |
trackerClicked(int tracker,
TrackerState state)
Process a tracker click event. |
void |
trackerDragged(int tracker,
TrackerState state)
Process a tracker press event. |
boolean |
trackerIntersected()
Did the last tracker interaction intersect any active sensors. |
void |
trackerMoved(int tracker,
TrackerState evt)
Process a tracker moved event. |
void |
trackerOrientation(int tracker,
TrackerState state)
Process tracker orientation events. |
void |
trackerPressed(int tracker,
TrackerState evt)
Process a tracker press event. |
void |
trackerReleased(int tracker,
TrackerState state)
Process a tracker press event. |
void |
trackerWheel(int tracker,
TrackerState state)
Process a tracker wheel event. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultUserInputHandler()
| Method Detail |
|---|
public void notifyNavigationModesChanged(java.lang.String[] newModes,
int numValid)
notifyNavigationModesChanged in interface NavigationInfoChangeListenernewModes - The new allowed navigation modesnumValid - number of valid modes in array
public void notifyAvatarSizeChanged(float[] size,
int numValid)
notifyAvatarSizeChanged in interface NavigationInfoChangeListenersize - The size parameters for the avatarnumValid - number of valid modes in arraypublic void notifyNavigationSpeedChanged(float newSpeed)
notifyNavigationSpeedChanged in interface NavigationInfoChangeListenernewSpeed - The new navigation speed.public void notifyVisibilityLimitChanged(float distance)
notifyVisibilityLimitChanged in interface NavigationInfoChangeListenerdistance - The new distance value to usepublic void notifyHeadlightChanged(boolean enable)
notifyHeadlightChanged in interface NavigationInfoChangeListenerenable - true if the headlight should now be onpublic boolean getNavigationEnabled()
getNavigationEnabled in interface UserInputHandlerpublic void setNavigationEnabled(boolean state)
setNavigationEnabled in interface UserInputHandlerstate - true to enable navigationpublic void setPickableScene(org.j3d.aviatrix3d.Group scene)
setPickableScene in interface OGLUserInputHandlerscene - The scene to pick against
public void setViewInfo(OGLViewpointNodeType vp,
org.j3d.aviatrix3d.TransformGroup tg,
org.j3d.aviatrix3d.SceneGraphPath path)
throws java.lang.IllegalArgumentException
This will also automatically set the center of rotation.
setViewInfo in interface OGLUserInputHandlervp - The current viewpointtg - The transform just about the viewpoint used to move it
around in response to the UI device inputpath - The path from the root to the transform to use
java.lang.IllegalArgumentException - The terminal node is not a viewpointpublic void setCenterOfRotation(float[] center)
setCenterOfRotation in interface UserInputHandlercenter - The new center to usepublic void setVRMLClock(VRMLClock clk)
setVRMLClock in interface UserInputHandlerclk - The new clock to usepublic void setCollisionListener(CollisionListener l)
setCollisionListener in interface OGLUserInputHandlerl - The listener to use for change updatespublic void setNavigationInfo(VRMLNavigationInfoNodeType navInfo)
setNavigationInfo in interface UserInputHandlernavInfo - The new navigation information to be usedpublic void setTestPointingDevices(boolean enabled)
setTestPointingDevices in interface UserInputHandlerenabled - Test for intersection when true
public void trackerButton(int tracker,
TrackerState state)
trackerButton in interface UserInputHandlertracker - The tracker generating the event.state - The current state.
public void trackerPressed(int tracker,
TrackerState evt)
trackerPressed in interface UserInputHandlerevt - The event that caused the method to be calledtracker - The id of the tracker calling this handler
public void trackerMoved(int tracker,
TrackerState evt)
trackerMoved in interface UserInputHandlerevt - The event that caused the method to be calledtracker - The id of the tracker calling this handlerpublic boolean trackerIntersected()
trackerIntersected in interface UserInputHandlerpublic void setActivateSensors(boolean val)
setActivateSensors in interface UserInputHandlerval - Whether its eligible
public void trackerDragged(int tracker,
TrackerState state)
trackerDragged in interface UserInputHandlertracker - The id of the tracker that was releasedstate - The state of the tracker right now
public void trackerWheel(int tracker,
TrackerState state)
trackerWheel in interface UserInputHandlertracker - The id of the tracker calling this handlerstate - The current state.
public void trackerReleased(int tracker,
TrackerState state)
trackerReleased in interface UserInputHandlertracker - The id of the tracker that was releasedstate - The state of the tracker right now
public void trackerClicked(int tracker,
TrackerState state)
trackerClicked in interface UserInputHandlertracker - The id of the tracker calling this handlerstate - The event that caused the method to be called
public void trackerOrientation(int tracker,
TrackerState state)
trackerOrientation in interface UserInputHandlertracker - Which tracker sourced the eventstate - The current statepublic void processNavigation()
processNavigation in interface UserInputHandlerpublic boolean setNavigationMode(java.lang.String mode)
setNavigationMode in interface UserInputHandlermode - The requested mode.
public void addNavigationStateListener(NavigationStateListener l)
addNavigationStateListener in interface UserInputHandlerl - The listener to addpublic void removeNavigationStateListener(NavigationStateListener l)
removeNavigationStateListener in interface UserInputHandlerl - The listener to removepublic void addSensorStatusListener(SensorStatusListener l)
addSensorStatusListener in interface UserInputHandlerl - The listener to addpublic void removeSensorStatusListener(SensorStatusListener l)
removeSensorStatusListener in interface UserInputHandlerl - The listener to removepublic void getOrientation(javax.vecmath.AxisAngle4f ori)
getOrientation in interface UserInputHandlerori - The orientation vector to fill inpublic void getPosition(javax.vecmath.Vector3f pos)
getPosition in interface UserInputHandlerpos - The position vector to fill inpublic void setWorldScale(float scale)
setWorldScale in interface UserInputHandlerscale - The new world scale.public void sendCurrentNavState()
sendCurrentNavState in interface UserInputHandlerpublic void clear()
clear in interface UserInputHandler
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||