Package com.jme3.input.vr
Interface VRMouseManager
- All Known Implementing Classes:
AbstractVRMouseManager
,LWJGLOpenVRMouseManager
,OculusMouseManager
,OpenVRMouseManager
,OSVRMouseManager
public interface VRMouseManager
A class dedicated to the handling of the mouse within VR 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.void
updateAnalogAsMouse
(int inputIndex, AnalogListener mouseListener, String mouseXName, String mouseYName, float tpf) Update analog controller as it was a mouse controller.
-
Method Details
-
initialize
void initialize()Initialize the VR mouse manager. -
getVREnvironment
VREnvironment getVREnvironment()Get theVR Environment
to which this manager is attached.- Returns:
- the
VR Environment
to which this manager is attached.
-
setVRMouseEnabled
void setVRMouseEnabled(boolean enabled) Set if the mouse cursor should be used in the VR view.- Parameters:
enabled
-true
if the mouse cursor should be displayed in VR andfalse
otherwise.
-
setThumbstickMode
void setThumbstickMode(boolean set) Set if the VR device controller is used within thumb stick mode.- Parameters:
set
-true
if the VR device controller is used within thumb stick mode andfalse
otherwise.
-
isThumbstickMode
boolean isThumbstickMode()Get if the VR device controller is used within thumb stick mode.- Returns:
true
if the VR device controller is used within thumb stick mode andfalse
otherwise.
-
setSpeed
void setSpeed(float sensitivity, float acceleration) Set the speed of the mouse.- Parameters:
sensitivity
- the sensitivity of the mouse.acceleration
- the acceleration of the mouse.- See Also:
-
getSpeedSensitivity
float getSpeedSensitivity()Get the sensitivity of the mouse.- Returns:
- the sensitivity of the mouse.
- See Also:
-
getSpeedAcceleration
float getSpeedAcceleration()Get the acceleration of the mouse.- Returns:
- the acceleration of the mouse.
- See Also:
-
getMouseMoveScale
float getMouseMoveScale()Get the move scale. return the move scale.- See Also:
-
setMouseMoveScale
void setMouseMoveScale(float set) Set the mouse move scale.- Parameters:
set
- the mouse move scale.- See Also:
-
setImage
Set the image to use as mouse cursor. The given string describe an asset that the underlying application asset manager has to load.- Parameters:
texture
- the image to use as mouse cursor.
-
updateAnalogAsMouse
void updateAnalogAsMouse(int inputIndex, AnalogListener mouseListener, String mouseXName, String mouseYName, float tpf) Update analog controller as it was a mouse controller.- Parameters:
inputIndex
- the index of the controller attached to the VR system.mouseListener
- the JMonkey mouse listener to trigger.mouseXName
- the mouseX identifier.mouseYName
- the mouseY identifiertpf
- the time per frame.
-
getCursorPosition
Vector2f getCursorPosition()Get the actual cursor position.- Returns:
- the actual cursor position.
-
centerMouse
void centerMouse()Center the mouse on the display. -
update
void update(float tpf) 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
.- Parameters:
tpf
- the time per frame.
-