Package com.simsilica.lemur.event
Class MouseAppState
java.lang.Object
com.jme3.app.state.BaseAppState
com.simsilica.lemur.event.BasePickState
com.simsilica.lemur.event.MouseAppState
Keeps track of a set of "collision roots" for mouse picking
and performs the pick event processing necessary to deliver
MouseEvents and CollisionEvents to spatials with either the
MouseEventControl or CursorEventControl attached. (The
actual event delivery is done by the PickEventSession class
for which this app state has one active session.)
PickEventSession behavior:
Collision roots may either be perspective or orthogonal and the appropriate type of collision is done. The ViewPort's camera is used to detect the difference.
Events are delivered in near to far order to any 'target' that the cursor ray collides with until the event is consumed. Enter and exit events are delivered as targets are acquired or lost.
If a button down event happens over a target then it is considered 'captured'. This spatial will be provided to subsequent events in addition to the normal target. Furthermore, any new motion events are always delivered to the captured spatial first.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface com.simsilica.lemur.event.PickState
PICK_LAYER_GUI, PICK_LAYER_SCENE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
cleanup
(Application app) Called after the app state is detached or during application shutdown if the state is still attached.protected void
dispatch
(MouseButtonEvent evt) protected void
Methods inherited from class com.simsilica.lemur.event.BasePickState
addCollisionRoot, addCollisionRoot, addCollisionRoot, addCollisionRoot, findViewPort, getIncludeDefaultCollisionRoots, getPickLayerOrder, getSession, hasRequestedEnabled, initialize, onDisable, onEnable, releaseEnabled, removeCollisionRoot, removeCollisionRoot, requestEnabled, resetEnabled, setIncludeDefaultCollisionRoots, setPickLayerOrder, update
Methods inherited from class com.jme3.app.state.BaseAppState
cleanup, getApplication, getId, getState, getState, getState, getState, getStateManager, initialize, isEnabled, isInitialized, postRender, render, setEnabled, setId, stateAttached, stateDetached
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jme3.app.state.AppState
cleanup, getId, initialize, isEnabled, isInitialized, postRender, render, setEnabled, stateAttached, stateDetached
-
Constructor Details
-
MouseAppState
-
-
Method Details
-
cleanup
Description copied from class:BaseAppState
Called after the app state is detached or during application shutdown if the state is still attached. onDisable() is called before this cleanup() method if the state is enabled at the time of cleanup.- Overrides:
cleanup
in classBasePickState
- Parameters:
app
- the application
-
dispatchMotion
protected void dispatchMotion()- Specified by:
dispatchMotion
in classBasePickState
-
dispatch
-