Package com.jme3.input.vr.oculus
Class OculusVRInput
java.lang.Object
com.jme3.input.vr.oculus.OculusVRInput
- All Implemented Interfaces:
- VRInputAPI
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassThe object form representation of a controller.
- 
Constructor SummaryConstructorsConstructorDescriptionOculusVRInput(OculusVR hardware, long session, org.lwjgl.ovr.OVRSessionStatus sessionStatus, org.lwjgl.ovr.OVRTrackingState trackingState) 
- 
Method SummaryModifier and TypeMethodDescriptionvoiddispose()getAngularVelocity(int controllerIndex) Get the controller angular velocity on all axes.getAxis(int controllerIndex, VRInputType forAxis) Get the axis value for the given input on the given controller.getAxisDeltaSinceLastCall(int controllerIndex, VRInputType forAxis) Get the controller axis delta from the last value.floatGet the controller axis multiplier.getAxisRaw(int controllerIndex, VRInputType forAxis) Get the axis value for the given input on the given controller.getFinalObserverPosition(int index) Get the position of the input after all positional tracking is complete.getFinalObserverRotation(int index) Get where is the controller pointing, after all rotations are combined.getOrientation(int index) Get the orientation of the input.getPosition(int index) Get the position of the input.getRawControllerState(int index) Get the native wrapping of a controller state.getTrackedController(int index) Get a tracked controller (for example, a hand controller) that is attached to the VR system.intGet the number of tracked controllers (for example, hand controllers) attached to the VR system.getVelocity(int controllerIndex) Get the controller velocity on all axes.booleaninit()Initialize the input.booleanisButtonDown(int controllerIndex, VRInputType checkButton) Check if the given button is down (more generally if the given input type is activated).booleanisButtonDownForStatus(int controllerIndex, VRInputType checkButton, int buttons, int touch) booleanisInputDeviceTracking(int index) Check if the input device is actually tracked (i-e if we can obtain a pose from the input).booleanCheck if the VR system has the focus and if it's not used by other process.voidReset the current activation of the inputs.voidsetAxisMultiplier(float axisMultiplier) Set the controller axis multiplier.voidSwap the two hands (exchange the hands' controller 1 and 2 indices).voidtriggerHapticPulse(int controllerIndex, float seconds) Trigger a haptic pulse on the selected controller for the duration given in parameters (in seconds).voidUpdate the connected controllers.voidUpdate the controller states.booleanwasButtonPressedSinceLastCall(int controllerIndex, VRInputType checkButton) Check if the given button / input from the given controller has been just pressed / activated.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jme3.input.vr.VRInputAPIgetAnalogActionState, getAnalogActionState, getDigitalActionState, getDigitalActionState, registerActionManifest, setActiveActionSet, triggerHapticAction, triggerHapticAction
- 
Constructor Details- 
OculusVRInputpublic OculusVRInput(OculusVR hardware, long session, org.lwjgl.ovr.OVRSessionStatus sessionStatus, org.lwjgl.ovr.OVRTrackingState trackingState) 
 
- 
- 
Method Details- 
disposepublic void dispose()
- 
updateControllerStatespublic void updateControllerStates()Description copied from interface:VRInputAPIUpdate the controller states. This method should be called before accessing any controller data.- Specified by:
- updateControllerStatesin interface- VRInputAPI
 
- 
getPositionDescription copied from interface:VRInputAPIGet the position of the input.- Specified by:
- getPositionin interface- VRInputAPI
- Parameters:
- index- the index of the controller.
- Returns:
- the position of the input.
 
- 
getVelocityDescription copied from interface:VRInputAPIGet the controller velocity on all axes.- Specified by:
- getVelocityin interface- VRInputAPI
- Parameters:
- controllerIndex- the index of the controller.
- Returns:
- the controller velocity on all axes.
- See Also:
 
- 
getOrientationDescription copied from interface:VRInputAPIGet the orientation of the input.- Specified by:
- getOrientationin interface- VRInputAPI
- Parameters:
- index- the index of the controller.
- Returns:
- the orientation of the input.
 
- 
getAngularVelocityDescription copied from interface:VRInputAPIGet the controller angular velocity on all axes.- Specified by:
- getAngularVelocityin interface- VRInputAPI
- Parameters:
- controllerIndex- the index of the controller.
- Returns:
- the controller angular velocity on all axes.
- See Also:
 
- 
getFinalObserverRotationDescription copied from interface:VRInputAPIGet where is the controller pointing, after all rotations are combined. This position should include observer rotation from the VR application.- Specified by:
- getFinalObserverRotationin interface- VRInputAPI
- Parameters:
- index- the index of the controller.
- Returns:
- the rotation of the input after all positional tracking is complete.
 
- 
getFinalObserverPositionDescription copied from interface:VRInputAPIGet the position of the input after all positional tracking is complete. This position should include observer position from the VR application.- Specified by:
- getFinalObserverPositionin interface- VRInputAPI
- Parameters:
- index- the index of the controller.
- Returns:
- the position of the input after all positional tracking is complete.
 
- 
isInputDeviceTrackingpublic boolean isInputDeviceTracking(int index) Description copied from interface:VRInputAPICheck if the input device is actually tracked (i-e if we can obtain a pose from the input).- Specified by:
- isInputDeviceTrackingin interface- VRInputAPI
- Parameters:
- index- the index of the controller.
- Returns:
- trueif the input device is actually tracked and- falseotherwise.
 
- 
getAxisDescription copied from interface:VRInputAPIGet the axis value for the given input on the given controller. This value is theraw valuemultiplied by theaxis multiplier.- Specified by:
- getAxisin interface- VRInputAPI
- Parameters:
- controllerIndex- the index of the controller.
- forAxis- the axis.
- Returns:
- the axis value for the given input on the given controller.
- See Also:
 
- 
getAxisRawDescription copied from interface:VRInputAPIGet the axis value for the given input on the given controller.- Specified by:
- getAxisRawin interface- VRInputAPI
- Parameters:
- controllerIndex- the index of the controller.
- forAxis- the axis.
- Returns:
- the axis value for the given input on the given controller.
- See Also:
 
- 
isButtonDownDescription copied from interface:VRInputAPICheck if the given button is down (more generally if the given input type is activated).- Specified by:
- isButtonDownin interface- VRInputAPI
- Parameters:
- controllerIndex- the index of the controller to check.
- checkButton- the button / input to check.
- Returns:
- trueif the button / input is down / activated and- falseotherwise.
 
- 
isButtonDownForStatuspublic boolean isButtonDownForStatus(int controllerIndex, VRInputType checkButton, int buttons, int touch) 
- 
resetInputSinceLastCallpublic void resetInputSinceLastCall()Description copied from interface:VRInputAPIReset the current activation of the inputs. After a call to this method, any input activation is considered a new activation.- Specified by:
- resetInputSinceLastCallin interface- VRInputAPI
- See Also:
 
- 
wasButtonPressedSinceLastCallDescription copied from interface:VRInputAPICheck if the given button / input from the given controller has been just pressed / activated.- Specified by:
- wasButtonPressedSinceLastCallin interface- VRInputAPI
- Parameters:
- controllerIndex- the index of the controller.
- checkButton- the button / input to check.
- Returns:
- trueif the given input from the given controller has just been activated,- falseotherwise.
 
- 
getAxisDeltaSinceLastCallDescription copied from interface:VRInputAPIGet the controller axis delta from the last value.- Specified by:
- getAxisDeltaSinceLastCallin interface- VRInputAPI
- Parameters:
- controllerIndex- the index of the controller.
- forAxis- the axis.
- Returns:
- the controller axis delta from the last call.
 
- 
initpublic boolean init()Description copied from interface:VRInputAPIInitialize the input.- Specified by:
- initin interface- VRInputAPI
- Returns:
- trueif the initialization is successful and- falseotherwise.
 
- 
updateConnectedControllerspublic void updateConnectedControllers()Description copied from interface:VRInputAPIUpdate the connected controllers. This method should be used just after the initialization of the input.- Specified by:
- updateConnectedControllersin interface- VRInputAPI
 
- 
getAxisMultiplierpublic float getAxisMultiplier()Description copied from interface:VRInputAPIGet the controller axis multiplier. The controller axis raw data (trackpad, trigger, ...) value is multiplied by the one given in parameter.- Specified by:
- getAxisMultiplierin interface- VRInputAPI
- Returns:
- the controller axis multiplier.
- See Also:
 
- 
setAxisMultiplierpublic void setAxisMultiplier(float axisMultiplier) Description copied from interface:VRInputAPISet the controller axis multiplier. The controller axis raw data (trackpad, trigger, ...) value is multiplied by the one given in parameter.- Specified by:
- setAxisMultiplierin interface- VRInputAPI
- Parameters:
- axisMultiplier- the controller axis multiplier.
- See Also:
 
- 
triggerHapticPulsepublic void triggerHapticPulse(int controllerIndex, float seconds) Description copied from interface:VRInputAPITrigger a haptic pulse on the selected controller for the duration given in parameters (in seconds).- Specified by:
- triggerHapticPulsein interface- VRInputAPI
- Parameters:
- controllerIndex- the index of the controller.
- seconds- the duration of the pulse in seconds.
 
- 
isInputFocusedpublic boolean isInputFocused()Description copied from interface:VRInputAPICheck if the VR system has the focus and if it's not used by other process.- Specified by:
- isInputFocusedin interface- VRInputAPI
- Returns:
- trueif the VR system has the focus and- falseotherwise.
 
- 
getRawControllerStateDescription copied from interface:VRInputAPIGet the native wrapping of a controller state.- Specified by:
- getRawControllerStatein interface- VRInputAPI
- Parameters:
- index- the index of the controller.
- Returns:
- the native wrapping of a controller state.
 
- 
swapHandspublic void swapHands()Description copied from interface:VRInputAPISwap the two hands (exchange the hands' controller 1 and 2 indices).- Specified by:
- swapHandsin interface- VRInputAPI
 
- 
getTrackedControllerCountpublic int getTrackedControllerCount()Description copied from interface:VRInputAPIGet the number of tracked controllers (for example, hand controllers) attached to the VR system.- Specified by:
- getTrackedControllerCountin interface- VRInputAPI
- Returns:
- the number of controllers attached to the VR system.
- See Also:
 
- 
getTrackedControllerDescription copied from interface:VRInputAPIGet a tracked controller (for example, a hand controller) that is attached to the VR system.- Specified by:
- getTrackedControllerin interface- VRInputAPI
- Parameters:
- index- the index of the controller.
- Returns:
- the tracked controller (for example, a hand controller) that is attached to the VR system.
- See Also:
 
 
-