Package com.simsilica.lemur.event
Class BasePickState
java.lang.Object
com.jme3.app.state.BaseAppState
com.simsilica.lemur.event.BasePickState
- Direct Known Subclasses:
MouseAppState,TouchAppState
Consolidates the PickEventSession management for doing
scene picking. This is the base class for the MouseAppState
and the TouchAppState.
-
Field Summary
Fields inherited from interface com.simsilica.lemur.event.PickState
PICK_LAYER_GUI, PICK_LAYER_SCENE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCollisionRoot(ViewPort viewPort) voidaddCollisionRoot(ViewPort viewPort, String layer) voidaddCollisionRoot(Spatial root, ViewPort viewPort) voidaddCollisionRoot(Spatial root, ViewPort viewPort, String layer) protected voidcleanup(Application app) Called after the app state is detached or during application shutdown if the state is still attached.protected abstract voidDeprecated.booleanString[]protected final PickEventSessionbooleanhasRequestedEnabled(Object owner) Returns true if the specified owner has an active request for picking to be enabled.protected voidinitialize(Application app) Called during initialization once the app state is attached and before onEnable() is called.protected voidCalled when the state was previously enabled but is now disabled either because setEnabled(false) was called or the state is being cleaned up.protected voidonEnable()Called when the state is fully enabled, ie: is attached and isEnabled() is true or when the setEnabled() status changes after the state is attached.booleanreleaseEnabled(Object owner) Signifies that the specified owner no longer needs the pick state to be enabled.voidremoveCollisionRoot(ViewPort viewPort) voidremoveCollisionRoot(Spatial root) voidrequestEnabled(Object owner) Signifies that the specified owner needs the pick state to be enabled.booleanRefreshes the enabled/disabled state based on the current request count.voidsetIncludeDefaultCollisionRoots(boolean b) voidsetPickLayerOrder(String... layers) Sets the order in which the pick layers will be checked for collisions.voidupdate(float tpf) Called to update theAppState.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, stateDetachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jme3.app.state.AppState
cleanup, getId, initialize, isEnabled, isInitialized, postRender, render, setEnabled, stateAttached, stateDetached
-
Constructor Details
-
BasePickState
protected BasePickState()
-
-
Method Details
-
getSession
-
requestEnabled
Signifies that the specified owner needs the pick state to be enabled.- Specified by:
requestEnabledin interfacePickState
-
releaseEnabled
Signifies that the specified owner no longer needs the pick state to be enabled. Will return true if the state is still enabled (because of other requests) or false if the state is now disabled.- Specified by:
releaseEnabledin interfacePickState
-
hasRequestedEnabled
Description copied from interface:PickStateReturns true if the specified owner has an active request for picking to be enabled.- Specified by:
hasRequestedEnabledin interfacePickState
-
resetEnabled
public boolean resetEnabled()Description copied from interface:PickStateRefreshes the enabled/disabled state based on the current request count. This is useful to reset the 'stack' if a forced enable/disable was previously done.- Specified by:
resetEnabledin interfacePickState
-
setIncludeDefaultCollisionRoots
public void setIncludeDefaultCollisionRoots(boolean b) - Specified by:
setIncludeDefaultCollisionRootsin interfacePickState
-
getIncludeDefaultCollisionRoots
public boolean getIncludeDefaultCollisionRoots()- Specified by:
getIncludeDefaultCollisionRootsin interfacePickState
-
findViewPort
Deprecated. -
addCollisionRoot
- Specified by:
addCollisionRootin interfacePickState
-
addCollisionRoot
- Specified by:
addCollisionRootin interfacePickState
-
addCollisionRoot
- Specified by:
addCollisionRootin interfacePickState
-
addCollisionRoot
- Specified by:
addCollisionRootin interfacePickState
-
removeCollisionRoot
- Specified by:
removeCollisionRootin interfacePickState
-
removeCollisionRoot
- Specified by:
removeCollisionRootin interfacePickState
-
setPickLayerOrder
Sets the order in which the pick layers will be checked for collisions. The default ordering is PICK_LAYER_GUI then PICK_LAYER_SCENE.- Specified by:
setPickLayerOrderin interfacePickState
-
getPickLayerOrder
- Specified by:
getPickLayerOrderin interfacePickState
-
initialize
Description copied from class:BaseAppStateCalled during initialization once the app state is attached and before onEnable() is called.- Specified by:
initializein classBaseAppState- Parameters:
app- the application
-
cleanup
Description copied from class:BaseAppStateCalled 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.- Specified by:
cleanupin classBaseAppState- Parameters:
app- the application
-
onEnable
protected void onEnable()Description copied from class:BaseAppStateCalled when the state is fully enabled, ie: is attached and isEnabled() is true or when the setEnabled() status changes after the state is attached.- Specified by:
onEnablein classBaseAppState
-
onDisable
protected void onDisable()Description copied from class:BaseAppStateCalled when the state was previously enabled but is now disabled either because setEnabled(false) was called or the state is being cleaned up.- Specified by:
onDisablein classBaseAppState
-
update
public void update(float tpf) Description copied from interface:AppStateCalled to update theAppState. This method will be called every render pass if theAppStateis both attached and enabled.- Specified by:
updatein interfaceAppState- Overrides:
updatein classBaseAppState- Parameters:
tpf- Time since the last call to update(), in seconds.
-
dispatchMotion
protected abstract void dispatchMotion()
-