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
-
Constructor Summary
ConstructorDescriptionAbstractVRMouseManager
(VREnvironment environment) Create a new AbstractVRMouseManager attached to the givenVR environment
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Center the mouse on the display.Get the actual cursor position.float
Get the move scale.float
Get the acceleration of the mouse.float
Get the sensitivity of the mouse.Get theVR Environment
to which this manager is attached.void
Initialize the VR mouse manager.boolean
Get if the VR device controller is used within thumb stick mode.void
Set the image to use as mouse cursor.void
setMouseMoveScale
(float set) Set the mouse move scale.void
setSpeed
(float sensitivity, float acceleration) Set the speed of the mouse.void
setThumbstickMode
(boolean set) Set if the VR device controller is used within thumb stick mode.void
setVRMouseEnabled
(boolean enabled) Set if the mouse cursor should be used in the VR view.void
update
(float tpf) Update the mouse manager.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 environment
that this manager is attached to.
-
-
Method Details
-
initialize
public void initialize()Description copied from interface:VRMouseManager
Initialize the VR mouse manager.- Specified by:
initialize
in interfaceVRMouseManager
-
getVREnvironment
Description copied from interface:VRMouseManager
Get theVR Environment
to which this manager is attached.- Specified by:
getVREnvironment
in interfaceVRMouseManager
- Returns:
- the
VR Environment
to which this manager is attached.
-
setVRMouseEnabled
public void setVRMouseEnabled(boolean enabled) Description copied from interface:VRMouseManager
Set if the mouse cursor should be used in the VR view.- Specified by:
setVRMouseEnabled
in interfaceVRMouseManager
- Parameters:
enabled
-true
if the mouse cursor should be displayed in VR andfalse
otherwise.
-
setThumbstickMode
public void setThumbstickMode(boolean set) Description copied from interface:VRMouseManager
Set if the VR device controller is used within thumb stick mode.- Specified by:
setThumbstickMode
in interfaceVRMouseManager
- Parameters:
set
-true
if the VR device controller is used within thumb stick mode andfalse
otherwise.
-
isThumbstickMode
public boolean isThumbstickMode()Description copied from interface:VRMouseManager
Get if the VR device controller is used within thumb stick mode.- Specified by:
isThumbstickMode
in interfaceVRMouseManager
- Returns:
true
if the VR device controller is used within thumb stick mode andfalse
otherwise.
-
setSpeed
public void setSpeed(float sensitivity, float acceleration) Description copied from interface:VRMouseManager
Set the speed of the mouse.- Specified by:
setSpeed
in interfaceVRMouseManager
- Parameters:
sensitivity
- the sensitivity of the mouse.acceleration
- the acceleration of the mouse.- See Also:
-
getSpeedSensitivity
public float getSpeedSensitivity()Description copied from interface:VRMouseManager
Get the sensitivity of the mouse.- Specified by:
getSpeedSensitivity
in interfaceVRMouseManager
- Returns:
- the sensitivity of the mouse.
- See Also:
-
getSpeedAcceleration
public float getSpeedAcceleration()Description copied from interface:VRMouseManager
Get the acceleration of the mouse.- Specified by:
getSpeedAcceleration
in interfaceVRMouseManager
- Returns:
- the acceleration of the mouse.
- See Also:
-
getMouseMoveScale
public float getMouseMoveScale()Description copied from interface:VRMouseManager
Get the move scale. return the move scale.- Specified by:
getMouseMoveScale
in interfaceVRMouseManager
- See Also:
-
setMouseMoveScale
public void setMouseMoveScale(float set) Description copied from interface:VRMouseManager
Set the mouse move scale.- Specified by:
setMouseMoveScale
in interfaceVRMouseManager
- Parameters:
set
- the mouse move scale.- See Also:
-
setImage
Description copied from interface:VRMouseManager
Set the image to use as mouse cursor. The given string describe an asset that the underlying application asset manager has to load.- Specified by:
setImage
in interfaceVRMouseManager
- Parameters:
texture
- the image to use as mouse cursor.
-
getCursorPosition
Description copied from interface:VRMouseManager
Get the actual cursor position.- Specified by:
getCursorPosition
in interfaceVRMouseManager
- Returns:
- the actual cursor position.
-
centerMouse
public void centerMouse()Description copied from interface:VRMouseManager
Center the mouse on the display.- Specified by:
centerMouse
in interfaceVRMouseManager
-
update
public void update(float tpf) Description copied from interface:VRMouseManager
Update the mouse manager. This method should not be called manually. The standard behavior for this method is to be called from theupdate method
of the attachedVR view manager
.- Specified by:
update
in interfaceVRMouseManager
- Parameters:
tpf
- the time per frame.
-