apps.threedmanipulationexperiment.gestures
Class OjbectManipulation

java.lang.Object
  extended by synergynetframework.jme.cursorsystem.MultiTouchElement
      extended by synergynetframework.jme.cursorsystem.TwoDMultiTouchElement
          extended by apps.threedmanipulationexperiment.gestures.OjbectManipulation

public class OjbectManipulation
extends TwoDMultiTouchElement

The Class OjbectManipulation.

Author:
dcs0ah1, pwpp25, dcs2ima

Nested Class Summary
static interface OjbectManipulation.ExperimentEventListener
          The listener interface for receiving experimentEvent events.
static interface OjbectManipulation.RotateTranslateScaleListener
          The listener interface for receiving rotateTranslateScale events.
 
Field Summary
 
Fields inherited from class synergynetframework.jme.cursorsystem.MultiTouchElement
AXIS_Z, DIRECTION_UP
 
Constructor Summary
OjbectManipulation(com.jme.scene.Spatial pickingAndTargetSpatial, java.util.List<com.jme.scene.Spatial> manipulatableOjbects)
          Instantiates a new ojbect manipulation.
OjbectManipulation(com.jme.scene.Spatial pickingSpatial, com.jme.scene.Spatial targetSpatial)
          Instantiates a new ojbect manipulation.
 
Method Summary
 void addExperimentEventListener(OjbectManipulation.ExperimentEventListener l)
          Adds the experiment event listener.
 void addRotateTranslateScaleListener(OjbectManipulation.RotateTranslateScaleListener l)
          Adds the rotate translate scale listener.
 void allowMoreThanTwoToRotateAndScale(boolean b)
          Allow more than two to rotate and scale.
 void cursorChanged(ScreenCursor c, MultiTouchCursorEvent event)
          Cursor changed.
 void cursorClicked(ScreenCursor c, MultiTouchCursorEvent event)
          Cursor clicked.
 void cursorPressed(ScreenCursor c, MultiTouchCursorEvent event)
          Cursor pressed.
 void cursorReleased(ScreenCursor c, MultiTouchCursorEvent event)
          Cursor released.
 com.jme.scene.Spatial getControlledSpatial()
          Gets the controlled spatial.
 float getScreenAngle()
          Gets the screen angle.
 void removeExperimentEventListener(OjbectManipulation.ExperimentEventListener l)
          Removes the experiment event listener.
 void removeRotateTranslateScaleListener(OjbectManipulation.RotateTranslateScaleListener l)
          Removes the rotate translate scale listener.
 void resetTouchNumber()
          Reset touch number.
 void setControlledSpatial(com.jme.scene.Spatial controlledSpatial)
          Sets the controlled spatial.
 void setRotateLimits(float min, float max)
          Sets the rotate limits.
 void setRotationSpeed(int rotationSpeed)
          Sets the rotation speed.
 void setScaleLimits(float min, float max)
          Sets the scale limits.
 void setScreenAngle(float screenAngle)
          Sets the screen angle.
 
Methods inherited from class synergynetframework.jme.cursorsystem.TwoDMultiTouchElement
getCursorScreenPositionAtPick, getPickDataForCursorID, getPickResultFromCursorIndex, getSpatial2DWorldPositionAtPick, registerScreenCursor
 
Methods inherited from class synergynetframework.jme.cursorsystem.MultiTouchElement
addWorldCursorRecord, getCurrentScreenAngleDifferenceFromOrigin, getCurrentScreenCursorsAngle, getCurrentTargetSpatialRotationFromCursorChange, getName, getNumRegisteredCursors, getOriginScreenCursorsAngle, getPickingSpatial, getScaleAtOrigin, getScreenCursorByID, getScreenCursorByIndex, getScreenCursorOriginForCursorID, getTargetSpatial, getTranslationAtOrigin, getWorldLocations, isActive, isPickMeOnly, registerScreenCursor, setActive, setName, setPickMeOnly, unregisterScreenCursor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OjbectManipulation

public OjbectManipulation(com.jme.scene.Spatial pickingAndTargetSpatial,
                          java.util.List<com.jme.scene.Spatial> manipulatableOjbects)
Instantiates a new ojbect manipulation.

Parameters:
pickingAndTargetSpatial - the picking and target spatial
manipulatableOjbects - the manipulatable ojbects

OjbectManipulation

public OjbectManipulation(com.jme.scene.Spatial pickingSpatial,
                          com.jme.scene.Spatial targetSpatial)
Instantiates a new ojbect manipulation.

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

addExperimentEventListener

public void addExperimentEventListener(OjbectManipulation.ExperimentEventListener l)
Adds the experiment event listener.

Parameters:
l - the l

addRotateTranslateScaleListener

public void addRotateTranslateScaleListener(OjbectManipulation.RotateTranslateScaleListener l)
Adds the rotate translate scale listener.

Parameters:
l - the l

allowMoreThanTwoToRotateAndScale

public void allowMoreThanTwoToRotateAndScale(boolean b)
Allow more than two to rotate and scale.

Parameters:
b - the b

cursorChanged

public void cursorChanged(ScreenCursor c,
                          MultiTouchCursorEvent event)
Description copied from class: MultiTouchElement
Cursor changed.

Specified by:
cursorChanged in class MultiTouchElement
Parameters:
c - the c
event - the event

cursorClicked

public void cursorClicked(ScreenCursor c,
                          MultiTouchCursorEvent event)
Description copied from class: MultiTouchElement
Cursor clicked.

Specified by:
cursorClicked in class MultiTouchElement
Parameters:
c - the c
event - the event

cursorPressed

public void cursorPressed(ScreenCursor c,
                          MultiTouchCursorEvent event)
Description copied from class: MultiTouchElement
Cursor pressed.

Specified by:
cursorPressed in class MultiTouchElement
Parameters:
c - the c
event - the event

cursorReleased

public void cursorReleased(ScreenCursor c,
                           MultiTouchCursorEvent event)
Description copied from class: MultiTouchElement
Cursor released.

Specified by:
cursorReleased in class MultiTouchElement
Parameters:
c - the c
event - the event

getControlledSpatial

public com.jme.scene.Spatial getControlledSpatial()
Gets the controlled spatial.

Returns:
the controlled spatial

getScreenAngle

public float getScreenAngle()
Gets the screen angle.

Returns:
the screen angle

removeExperimentEventListener

public void removeExperimentEventListener(OjbectManipulation.ExperimentEventListener l)
Removes the experiment event listener.

Parameters:
l - the l

removeRotateTranslateScaleListener

public void removeRotateTranslateScaleListener(OjbectManipulation.RotateTranslateScaleListener l)
Removes the rotate translate scale listener.

Parameters:
l - the l

resetTouchNumber

public void resetTouchNumber()
Reset touch number.


setControlledSpatial

public void setControlledSpatial(com.jme.scene.Spatial controlledSpatial)
Sets the controlled spatial.

Parameters:
controlledSpatial - the new controlled spatial

setRotateLimits

public void setRotateLimits(float min,
                            float max)
Sets the rotate limits.

Parameters:
min - the min
max - the max

setRotationSpeed

public void setRotationSpeed(int rotationSpeed)
Sets the rotation speed.

Parameters:
rotationSpeed - the new rotation speed

setScaleLimits

public void setScaleLimits(float min,
                           float max)
Sets the scale limits.

Parameters:
min - the min
max - the max

setScreenAngle

public void setScreenAngle(float screenAngle)
Sets the screen angle.

Parameters:
screenAngle - the new screen angle