com.jme.input
Class AbsoluteMouse

java.lang.Object
  extended by com.jme.scene.Spatial
      extended by com.jme.scene.Geometry
          extended by com.jme.scene.TriMesh
              extended by com.jme.scene.shape.Quad
                  extended by com.jme.input.Mouse
                      extended by com.jme.input.AbsoluteMouse
All Implemented Interfaces:
Savable, java.io.Serializable

public class AbsoluteMouse
extends Mouse

AbsoluteMouse defines a mouse object that maintains a position within the window. Each call to update adjusts the current position by the change in position since the previous update. The mouse is forced to be contained within the values provided during construction (typically these correspond to the width and height of the window).

Version:
$Id: AbsoluteMouse.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Mark Powell, Gregg Patton
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme.scene.TriMesh
TriMesh.Mode
 
Nested classes/interfaces inherited from class com.jme.scene.Spatial
Spatial.CullHint, Spatial.LightCombineMode, Spatial.NormalsMode, Spatial.TextureCombineMode
 
Field Summary
 
Fields inherited from class com.jme.input.Mouse
hasCursor, hotSpotLocation, hotSpotOffset, imageHeight, imageWidth
 
Fields inherited from class com.jme.scene.shape.Quad
height, width
 
Fields inherited from class com.jme.scene.TriMesh
indexBuffer, mode, triangleQuantity
 
Fields inherited from class com.jme.scene.Geometry
binormalBuf, bound, castsShadows, colorBuf, compVect, defaultColor, displayListID, enabled, fogBuf, hasDirtyVertices, normBuf, states, tangentBuf, texBuf, vboInfo, vertBuf, vertQuantity
 
Fields inherited from class com.jme.scene.Spatial
cullHint, frustrumIntersects, geometricalControllers, isCollidable, lightCombineMode, localRotation, localScale, localTranslation, LOCKED_BOUNDS, LOCKED_BRANCH, LOCKED_MESH_DATA, LOCKED_NONE, LOCKED_SHADOWS, LOCKED_TRANSFORMS, lockedMode, name, normalsMode, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder
 
Constructor Summary
AbsoluteMouse(java.lang.String name, int limitWidth, int limitHeight)
          Constructor instantiates a new AbsoluteMouse object.
 
Method Summary
 InputAction getXUpdateAction()
           
 InputAction getYUpdateAction()
           
 boolean isUsingDelta()
           
 void registerWithInputHandler(InputHandler inputHandler)
          Registers the xUpdateAction and the yUpdateAction with axis 0 and 1 of the mouse.
 void setLimit(int limitWidth, int limitHeight)
          set the mouse's limit.
 void setSpeed(float speed)
          Sets the speed multiplier for updating the cursor position
 void setUsingDelta(boolean usingDelta)
           
 
Methods inherited from class com.jme.input.Mouse
getHotSpotOffset, getHotSpotPosition, getImageHeight, getImageWidth, hasCursor, setHotSpotOffset, setRenderState
 
Methods inherited from class com.jme.scene.shape.Quad
getCenter, getHeight, getWidth, initialize, resize, updateGeometry
 
Methods inherited from class com.jme.scene.TriMesh
clearBuffers, draw, findCollisions, findTriangleCollision, findTrianglePick, getIndexBuffer, getMaxIndex, getMeshAsTriangles, getMeshAsTrianglesVertices, getMode, getTriangle, getTriangle, getTriangleCount, getTriangleIndices, getVertIndex, hasCollision, hasTriangleCollision, randomPointOnTriangles, read, recalcTriangleQuantity, reconstruct, setIndexBuffer, setMode, setTriangleQuantity, write
 
Methods inherited from class com.jme.scene.Geometry
addTextureCoordinates, addTextureCoordinates, applyRenderState, checkTextureCoordinates, clearTextureBuffers, copyTextureCoordinates, copyTextureCoordinates, findPick, getBinormalBuffer, getColorBuffer, getDefaultColor, getDisplayListID, getFogBuffer, getLightState, getModelBound, getNormalBuffer, getNumberOfUnits, getTangentBuffer, getTextureCoords, getTextureCoords, getVBOInfo, getVertexBuffer, getVertexCount, getWorldCoords, getWorldNormals, hasDirtyVertices, isCastsShadows, lockMeshes, postdraw, predraw, randomVertex, reconstruct, resizeTextureIds, rotateNormals, rotatePoints, scaleTextureCoordinates, scaleTextureCoordinates, setBinormalBuffer, setCastsShadows, setColorBuffer, setDefaultColor, setDisplayListID, setFogCoordBuffer, setHasDirtyVertices, setLightState, setModelBound, setNormalBuffer, setRandomColors, setSolidColor, setTangentBuffer, setTextureCoords, setTextureCoords, setTextureCoords, setVBOInfo, setVertexBuffer, setVertexCount, sortLights, translatePoints, translatePoints, unlockMeshes, updateModelBound, updateWorldBound
 
Methods inherited from class com.jme.scene.Spatial
addController, calculateCollisions, calculatePick, clearControllers, clearRenderState, clearRenderState, getClassTag, getController, getControllerCount, getControllers, getCullHint, getLastFrustumIntersection, getLightCombineMode, getLocalCullHint, getLocalLightCombineMode, getLocalNormalsMode, getLocalRenderQueueMode, getLocalRotation, getLocalScale, getLocalTextureCombineMode, getLocalToWorldMatrix, getLocalTranslation, getLocks, getName, getNormalsMode, getParent, getRenderQueueMode, getRenderState, getRenderState, getTextureCombineMode, getUserData, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, hasAncestor, isCollidable, localToWorld, lock, lock, lockBounds, lockBranch, lockMeshes, lockShadows, lockTransforms, lookAt, onDraw, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeController, removeFromParent, removeUserData, rotateUpTo, setCullHint, setIsCollidable, setLastFrustumIntersection, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setLocalTranslation, setLocks, setLocks, setName, setNormalsMode, setParent, setRenderQueueMode, setTextureCombineMode, setUserData, setZOrder, setZOrder, toString, unlock, unlock, unlockBounds, unlockBranch, unlockMeshes, unlockShadows, unlockTransforms, updateGeometricState, updateRenderState, updateRenderState, updateWorldData, updateWorldRotation, updateWorldScale, updateWorldTranslation, updateWorldVectors, updateWorldVectors, worldToLocal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.jme.util.export.Savable
getClassTag
 

Constructor Detail

AbsoluteMouse

public AbsoluteMouse(java.lang.String name,
                     int limitWidth,
                     int limitHeight)
Constructor instantiates a new AbsoluteMouse object. The limits of the mouse movements are provided.

Parameters:
name - the name of the scene element. This is required for identification and comparision purposes.
limitWidth - the width of the mouse's limit.
limitHeight - the height of the mouse's limit.
Method Detail

isUsingDelta

public boolean isUsingDelta()
Returns:
true if mouse position delta are used to compute the absolute position, false if the absolute mouse coordinates are used directly

setUsingDelta

public void setUsingDelta(boolean usingDelta)
Parameters:
usingDelta - true to compute the absolute position from mouse position delta, false to use the absolute mouse coordinates directly

setLimit

public void setLimit(int limitWidth,
                     int limitHeight)
set the mouse's limit.

Parameters:
limitWidth - the width of the mouse's limit.
limitHeight - the height of the mouse's limit.

setSpeed

public void setSpeed(float speed)
Description copied from class: Mouse
Sets the speed multiplier for updating the cursor position

Specified by:
setSpeed in class Mouse

registerWithInputHandler

public void registerWithInputHandler(InputHandler inputHandler)
Registers the xUpdateAction and the yUpdateAction with axis 0 and 1 of the mouse. Note: you can register the actions with other devices, too, instead of calling this method.

Specified by:
registerWithInputHandler in class Mouse
Parameters:
inputHandler - handler to register with (null to unregister)
See Also:
getXUpdateAction(), getYUpdateAction()

getXUpdateAction

public InputAction getXUpdateAction()

getYUpdateAction

public InputAction getYUpdateAction()