Class MouseAppState

All Implemented Interfaces:
AppState, PickState

public class MouseAppState extends BasePickState
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.

  • Constructor Details

    • MouseAppState

      public MouseAppState(Application app)
  • Method Details

    • cleanup

      protected void cleanup(Application app)
      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 class BasePickState
      Parameters:
      app - the application
    • dispatchMotion

      protected void dispatchMotion()
      Specified by:
      dispatchMotion in class BasePickState
    • dispatch

      protected void dispatch(MouseButtonEvent evt)