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 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.voidupdateAnalogAsMouse(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 Environmentto which this manager is attached.- Returns:
- the
VR Environmentto which this manager is attached.
-
setVRMouseEnabled
void setVRMouseEnabled(boolean enabled) Set if the mouse cursor should be used in the VR view.- Parameters:
enabled-trueif the mouse cursor should be displayed in VR andfalseotherwise.
-
setThumbstickMode
void setThumbstickMode(boolean set) Set if the VR device controller is used within thumb stick mode.- Parameters:
set-trueif the VR device controller is used within thumb stick mode andfalseotherwise.
-
isThumbstickMode
boolean isThumbstickMode()Get if the VR device controller is used within thumb stick mode.- Returns:
trueif the VR device controller is used within thumb stick mode andfalseotherwise.
-
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 methodof the attachedVR view manager.- Parameters:
tpf- the time per frame.
-