Package com.jme3.input.vr
Class AbstractVRMouseManager
java.lang.Object
com.jme3.input.vr.AbstractVRMouseManager
- All Implemented Interfaces:
VRMouseManager
- Direct Known Subclasses:
LWJGLOpenVRMouseManager,OculusMouseManager,OpenVRMouseManager,OSVRMouseManager
An abstract implementation of a
VRMouseManager. This class should be overridden by specific hardware implementation of VR devices.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractVRMouseManager(VREnvironment environment) Create a new AbstractVRMouseManager attached to the givenVR environment. -
Method Summary
Modifier and TypeMethodDescriptionvoidCenter the mouse on the display.Get the actual cursor position.floatGet the move scale.floatGet the acceleration of the mouse.floatGet the sensitivity of the mouse.Get theVR Environmentto which this manager is attached.voidInitialize the VR mouse manager.booleanGet if the VR device controller is used within thumb stick mode.voidSet the image to use as mouse cursor.voidsetMouseMoveScale(float set) Set the mouse move scale.voidsetSpeed(float sensitivity, float acceleration) Set the speed of the mouse.voidsetThumbstickMode(boolean set) Set if the VR device controller is used within thumb stick mode.voidsetVRMouseEnabled(boolean enabled) Set if the mouse cursor should be used in the VR view.voidupdate(float tpf) Update the mouse manager.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jme3.input.vr.VRMouseManager
updateAnalogAsMouse
-
Field Details
-
cursorPos
-
-
Constructor Details
-
AbstractVRMouseManager
Create a new AbstractVRMouseManager attached to the givenVR environment.- Parameters:
environment- theVR environmentthat this manager is attached to.
-
-
Method Details
-
initialize
public void initialize()Description copied from interface:VRMouseManagerInitialize the VR mouse manager.- Specified by:
initializein interfaceVRMouseManager
-
getVREnvironment
Description copied from interface:VRMouseManagerGet theVR Environmentto which this manager is attached.- Specified by:
getVREnvironmentin interfaceVRMouseManager- Returns:
- the
VR Environmentto which this manager is attached.
-
setVRMouseEnabled
public void setVRMouseEnabled(boolean enabled) Description copied from interface:VRMouseManagerSet if the mouse cursor should be used in the VR view.- Specified by:
setVRMouseEnabledin interfaceVRMouseManager- Parameters:
enabled-trueif the mouse cursor should be displayed in VR andfalseotherwise.
-
setThumbstickMode
public void setThumbstickMode(boolean set) Description copied from interface:VRMouseManagerSet if the VR device controller is used within thumb stick mode.- Specified by:
setThumbstickModein interfaceVRMouseManager- Parameters:
set-trueif the VR device controller is used within thumb stick mode andfalseotherwise.
-
isThumbstickMode
public boolean isThumbstickMode()Description copied from interface:VRMouseManagerGet if the VR device controller is used within thumb stick mode.- Specified by:
isThumbstickModein interfaceVRMouseManager- Returns:
trueif the VR device controller is used within thumb stick mode andfalseotherwise.
-
setSpeed
public void setSpeed(float sensitivity, float acceleration) Description copied from interface:VRMouseManagerSet the speed of the mouse.- Specified by:
setSpeedin interfaceVRMouseManager- Parameters:
sensitivity- the sensitivity of the mouse.acceleration- the acceleration of the mouse.- See Also:
-
getSpeedSensitivity
public float getSpeedSensitivity()Description copied from interface:VRMouseManagerGet the sensitivity of the mouse.- Specified by:
getSpeedSensitivityin interfaceVRMouseManager- Returns:
- the sensitivity of the mouse.
- See Also:
-
getSpeedAcceleration
public float getSpeedAcceleration()Description copied from interface:VRMouseManagerGet the acceleration of the mouse.- Specified by:
getSpeedAccelerationin interfaceVRMouseManager- Returns:
- the acceleration of the mouse.
- See Also:
-
getMouseMoveScale
public float getMouseMoveScale()Description copied from interface:VRMouseManagerGet the move scale. return the move scale.- Specified by:
getMouseMoveScalein interfaceVRMouseManager- See Also:
-
setMouseMoveScale
public void setMouseMoveScale(float set) Description copied from interface:VRMouseManagerSet the mouse move scale.- Specified by:
setMouseMoveScalein interfaceVRMouseManager- Parameters:
set- the mouse move scale.- See Also:
-
setImage
Description copied from interface:VRMouseManagerSet the image to use as mouse cursor. The given string describe an asset that the underlying application asset manager has to load.- Specified by:
setImagein interfaceVRMouseManager- Parameters:
texture- the image to use as mouse cursor.
-
getCursorPosition
Description copied from interface:VRMouseManagerGet the actual cursor position.- Specified by:
getCursorPositionin interfaceVRMouseManager- Returns:
- the actual cursor position.
-
centerMouse
public void centerMouse()Description copied from interface:VRMouseManagerCenter the mouse on the display.- Specified by:
centerMousein interfaceVRMouseManager
-
update
public void update(float tpf) Description copied from interface:VRMouseManagerUpdate the mouse manager. This method should not be called manually. The standard behavior for this method is to be called from theupdate methodof the attachedVR view manager.- Specified by:
updatein interfaceVRMouseManager- Parameters:
tpf- the time per frame.
-