synergynetframework.jme.cursorsystem
Class MultiTouchElement

java.lang.Object
  extended by synergynetframework.jme.cursorsystem.MultiTouchElement
Direct Known Subclasses:
MultiTouchButton, OrthoBringToTop, ThreeDMultiTouchElement, TwoDMultiTouchElement

public abstract class MultiTouchElement
extends java.lang.Object

Super class for elements that provide multi-touch interaction on a particular JME Spatial. A MultiTouch element allows the picking element to be different from the actual object manipulated, but for most applications, the picking elements will be the same as the manipulated object.

Author:
dcs0ah1

Field Summary
static com.jme.math.Vector3f AXIS_Z
          The Constant AXIS_Z.
static com.jme.math.Vector2f DIRECTION_UP
          The Constant DIRECTION_UP.
 
Constructor Summary
MultiTouchElement(com.jme.scene.Spatial pickingAndTargetSpatial)
          Instantiates a new multi touch element.
MultiTouchElement(com.jme.scene.Spatial pickingSpatial, com.jme.scene.Spatial targetSpatial)
          Instantiates a new multi touch element.
 
Method Summary
 void addWorldCursorRecord(WorldCursorRecord worldCursorRecord)
          Adds the world cursor record.
abstract  void cursorChanged(ScreenCursor c, MultiTouchCursorEvent event)
          Cursor changed.
abstract  void cursorClicked(ScreenCursor c, MultiTouchCursorEvent event)
          Cursor clicked.
abstract  void cursorPressed(ScreenCursor c, MultiTouchCursorEvent event)
          Cursor pressed.
abstract  void cursorReleased(ScreenCursor c, MultiTouchCursorEvent event)
          Cursor released.
 float getCurrentScreenAngleDifferenceFromOrigin()
          Gets the current screen angle difference from origin.
 float getCurrentScreenCursorsAngle()
          Gets the current screen cursors angle.
 com.jme.math.Quaternion getCurrentTargetSpatialRotationFromCursorChange()
          Gets the current target spatial rotation from cursor change.
 java.lang.String getName()
          Gets the name.
 int getNumRegisteredCursors()
          Gets the num registered cursors.
 float getOriginScreenCursorsAngle()
          Gets the origin screen cursors angle.
 PickResultData getPickDataForCursorID(long id)
          Gets the pick data for cursor id.
 com.jme.scene.Spatial getPickingSpatial()
          Gets the picking spatial.
 PickResultData getPickResultFromCursorIndex(int index)
          Gets the pick result from cursor index.
 com.jme.math.Vector3f getScaleAtOrigin()
          Gets the scale at origin.
 ScreenCursor getScreenCursorByID(long id)
          Get a screen cursor registered with this MultiTouchElement by its id.
 ScreenCursor getScreenCursorByIndex(int index)
          Get a screen cursor registered with this MultiTouchElement by its index.
 ScreenCursorRecord getScreenCursorOriginForCursorID(long id)
          Gets the screen cursor origin for cursor id.
 com.jme.scene.Spatial getTargetSpatial()
          Gets the target spatial.
 com.jme.math.Vector3f getTranslationAtOrigin()
          Gets the translation at origin.
 java.util.List<WorldCursorRecord> getWorldLocations()
          Gets the world locations.
 boolean isActive()
          Checks if is active.
 boolean isPickMeOnly()
          Checks if is pick me only.
 void registerScreenCursor(ScreenCursor c, PickResultData nodeloc)
          Register a cursor with this multi touch element.
 void setActive(boolean b)
          Sets the active.
 void setName(java.lang.String name)
          Sets the name.
 void setPickMeOnly(boolean pickMeOnly)
          Sets the pick me only.
 void unregisterScreenCursor(ScreenCursor c)
          Removes the screen cursor association with this MultiTouchElement.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AXIS_Z

public static final com.jme.math.Vector3f AXIS_Z
The Constant AXIS_Z.


DIRECTION_UP

public static final com.jme.math.Vector2f DIRECTION_UP
The Constant DIRECTION_UP.

Constructor Detail

MultiTouchElement

public MultiTouchElement(com.jme.scene.Spatial pickingAndTargetSpatial)
Instantiates a new multi touch element.

Parameters:
pickingAndTargetSpatial - the picking and target spatial

MultiTouchElement

public MultiTouchElement(com.jme.scene.Spatial pickingSpatial,
                         com.jme.scene.Spatial targetSpatial)
Instantiates a new multi touch element.

Parameters:
pickingSpatial - the picking spatial
targetSpatial - the target spatial
Method Detail

addWorldCursorRecord

public void addWorldCursorRecord(WorldCursorRecord worldCursorRecord)
Adds the world cursor record.

Parameters:
worldCursorRecord - the world cursor record

cursorChanged

public abstract void cursorChanged(ScreenCursor c,
                                   MultiTouchCursorEvent event)
Cursor changed.

Parameters:
c - the c
event - the event

cursorClicked

public abstract void cursorClicked(ScreenCursor c,
                                   MultiTouchCursorEvent event)
Cursor clicked.

Parameters:
c - the c
event - the event

cursorPressed

public abstract void cursorPressed(ScreenCursor c,
                                   MultiTouchCursorEvent event)
Cursor pressed.

Parameters:
c - the c
event - the event

cursorReleased

public abstract void cursorReleased(ScreenCursor c,
                                    MultiTouchCursorEvent event)
Cursor released.

Parameters:
c - the c
event - the event

getCurrentScreenAngleDifferenceFromOrigin

public float getCurrentScreenAngleDifferenceFromOrigin()
Gets the current screen angle difference from origin.

Returns:
the current screen angle difference from origin

getCurrentScreenCursorsAngle

public float getCurrentScreenCursorsAngle()
Gets the current screen cursors angle.

Returns:
the current screen cursors angle

getCurrentTargetSpatialRotationFromCursorChange

public com.jme.math.Quaternion getCurrentTargetSpatialRotationFromCursorChange()
Gets the current target spatial rotation from cursor change.

Returns:
the current target spatial rotation from cursor change

getName

public java.lang.String getName()
Gets the name.

Returns:
the name

getNumRegisteredCursors

public int getNumRegisteredCursors()
Gets the num registered cursors.

Returns:
the num registered cursors

getOriginScreenCursorsAngle

public float getOriginScreenCursorsAngle()
Gets the origin screen cursors angle.

Returns:
the origin screen cursors angle

getPickDataForCursorID

public PickResultData getPickDataForCursorID(long id)
Gets the pick data for cursor id.

Parameters:
id - the id
Returns:
the pick data for cursor id

getPickingSpatial

public com.jme.scene.Spatial getPickingSpatial()
Gets the picking spatial.

Returns:
the picking spatial

getPickResultFromCursorIndex

public PickResultData getPickResultFromCursorIndex(int index)
Gets the pick result from cursor index.

Parameters:
index - the index
Returns:
the pick result from cursor index

getScaleAtOrigin

public com.jme.math.Vector3f getScaleAtOrigin()
Gets the scale at origin.

Returns:
the scale at origin

getScreenCursorByID

public ScreenCursor getScreenCursorByID(long id)
Get a screen cursor registered with this MultiTouchElement by its id.

Parameters:
id - the id
Returns:
the screen cursor by id

getScreenCursorByIndex

public ScreenCursor getScreenCursorByIndex(int index)
Get a screen cursor registered with this MultiTouchElement by its index.

Parameters:
index - the index
Returns:
the screen cursor by index

getScreenCursorOriginForCursorID

public ScreenCursorRecord getScreenCursorOriginForCursorID(long id)
Gets the screen cursor origin for cursor id.

Parameters:
id - the id
Returns:
the screen cursor origin for cursor id

getTargetSpatial

public com.jme.scene.Spatial getTargetSpatial()
Gets the target spatial.

Returns:
the target spatial

getTranslationAtOrigin

public com.jme.math.Vector3f getTranslationAtOrigin()
Gets the translation at origin.

Returns:
the translation at origin

getWorldLocations

public java.util.List<WorldCursorRecord> getWorldLocations()
Gets the world locations.

Returns:
the world locations

isActive

public boolean isActive()
Checks if is active.

Returns:
true, if is active

isPickMeOnly

public boolean isPickMeOnly()
Checks if is pick me only.

Returns:
true, if is pick me only

registerScreenCursor

public void registerScreenCursor(ScreenCursor c,
                                 PickResultData nodeloc)
Register a cursor with this multi touch element.

Parameters:
c - the c
nodeloc - the nodeloc

setActive

public void setActive(boolean b)
Sets the active.

Parameters:
b - the new active

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name - the new name

setPickMeOnly

public void setPickMeOnly(boolean pickMeOnly)
Sets the pick me only.

Parameters:
pickMeOnly - the new pick me only

unregisterScreenCursor

public void unregisterScreenCursor(ScreenCursor c)
Removes the screen cursor association with this MultiTouchElement.

Parameters:
c - the c