org.jdesktop.wonderland.client.jme.input
Class MouseEvent3D

java.lang.Object
  extended by org.jdesktop.wonderland.client.input.Event
      extended by org.jdesktop.wonderland.client.jme.input.InputEvent3D
          extended by org.jdesktop.wonderland.client.jme.input.MouseEvent3D
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MouseButtonEvent3D, MouseEnterExitEvent3D, MouseMovedEvent3D, MouseWheelEvent3D

public abstract class MouseEvent3D
extends InputEvent3D

The abstract super class for all Wonderland mouse events.

Author:
deronj
See Also:
Serialized Form

Nested Class Summary
static class MouseEvent3D.ButtonId
          The supported button codes.
 
Nested classes/interfaces inherited from class org.jdesktop.wonderland.client.jme.input.InputEvent3D
InputEvent3D.ModifierId
 
Field Summary
protected  com.jme.math.Matrix4f world2Local
          A temporary used for getIntersectionPointLocal
 
Fields inherited from class org.jdesktop.wonderland.client.jme.input.InputEvent3D
awtEvent
 
Fields inherited from class org.jdesktop.wonderland.client.input.Event
entity, EVENT_CLASS_ID, isFocussed
 
Constructor Summary
protected MouseEvent3D()
          Default constructor (for cloning)
  MouseEvent3D(java.awt.event.MouseEvent awtEvent, org.jdesktop.mtgame.PickDetails pickDetails)
          Create an instance of MouseEvent3D.
 
Method Summary
 Event clone(Event event)
          Copy the members of this class into the given event.
 MouseEvent3D.ButtonId getButton()
          Returns which, if any, of the mouse buttons has changed state.
 float getDistance()
          Returns the distance from the eye to the intersection point, based on the destination pick details which were calculated by the input system.
 org.jdesktop.mtgame.Entity getEntity()
          Returns the entity hit by the event, based on the destination pick details which were calculated by the input system.
 com.jme.math.Vector3f getIntersectionPointLocal()
          Returns the intersection point in object (node) local coordinates, based on the destination pick details which were calculated by the input system.
 com.jme.math.Vector3f getIntersectionPointWorld()
          Returns the intersection point in world coordinates, based on the destination pick details which were calculated by the input system.
 com.jme.scene.Node getNode()
          Returns the node which the pick hit.
 org.jdesktop.mtgame.PickDetails getPickDetails()
          Returns the original pick details of the event.
 void setPickDetails(org.jdesktop.mtgame.PickDetails pickDetails)
          INTERNAL ONLY
Sets the original desination pick details of the event, as calculated by the input system, accounting for grabs.
 
Methods inherited from class org.jdesktop.wonderland.client.jme.input.InputEvent3D
getAwtEvent, getID, getModifiersEx, getPickInfo, getWhen, setPickInfo
 
Methods inherited from class org.jdesktop.wonderland.client.input.Event
allocateEventClassID, free, getClassID, isFocussed, setEntity, setFocussed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

world2Local

protected com.jme.math.Matrix4f world2Local
A temporary used for getIntersectionPointLocal

Constructor Detail

MouseEvent3D

protected MouseEvent3D()
Default constructor (for cloning)


MouseEvent3D

public MouseEvent3D(java.awt.event.MouseEvent awtEvent,
                    org.jdesktop.mtgame.PickDetails pickDetails)
Create an instance of MouseEvent3D.

Parameters:
awtEvent - The originating AWT mouse event
pickDetails - The pick details for the event.
Method Detail

getNode

public com.jme.scene.Node getNode()
Returns the node which the pick hit.


getPickDetails

public org.jdesktop.mtgame.PickDetails getPickDetails()
Returns the original pick details of the event.


setPickDetails

public void setPickDetails(org.jdesktop.mtgame.PickDetails pickDetails)
INTERNAL ONLY
Sets the original desination pick details of the event, as calculated by the input system, accounting for grabs.


getEntity

public org.jdesktop.mtgame.Entity getEntity()
Returns the entity hit by the event, based on the destination pick details which were calculated by the input system. Normally, this will be the pick hit entity unless previously overridden by the input system grab calculations.

Overrides:
getEntity in class Event

getButton

public MouseEvent3D.ButtonId getButton()
Returns which, if any, of the mouse buttons has changed state.

Returns:
one of the following enums: NOBUTTON, BUTTON1, BUTTON2 or BUTTON3.

getDistance

public float getDistance()
Returns the distance from the eye to the intersection point, based on the destination pick details which were calculated by the input system. (This distance is in world coordinates). If the event has no pick details, 0 is returned.


getIntersectionPointWorld

public com.jme.math.Vector3f getIntersectionPointWorld()
Returns the intersection point in world coordinates, based on the destination pick details which were calculated by the input system.


getIntersectionPointLocal

public com.jme.math.Vector3f getIntersectionPointLocal()
Returns the intersection point in object (node) local coordinates, based on the destination pick details which were calculated by the input system.


clone

public Event clone(Event event)
Copy the members of this class into the given event.

Overrides:
clone in class InputEvent3D


Open Wonderland - http://openwonderland.org