Package com.jme3.input.vr.lwjgl_openvr
Class LWJGLOpenVRInput
java.lang.Object
com.jme3.input.vr.lwjgl_openvr.LWJGLOpenVRInput
- All Implemented Interfaces:
- VRInputAPI
Deprecated.
The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR).
             For new Virtual Reality projects, use user libraries that provide OpenXR support.
             See Virtual Reality JME wiki section
             for more information.
A class that wraps an
 OpenVR
 input.
 
null values will be returned if no valid pose exists, or that
 input device isn't available user code should check for null
 values.- 
Constructor SummaryConstructorsConstructorDescriptionLWJGLOpenVRInput(VREnvironment environment) Deprecated.Create a new OpenVR input attached to the given VR environment.
- 
Method SummaryModifier and TypeMethodDescriptiongetAnalogActionState(String actionName, String restrictToInput) Deprecated.Gets the current state of the action (abstract version of a button press).getAngularVelocity(int controllerIndex) Deprecated.Get the controller angular velocity on all axes.getAxis(int controllerIndex, VRInputType forAxis) Deprecated.Get the axis value for the given input on the given controller.getAxisDeltaSinceLastCall(int controllerIndex, VRInputType forAxis) Deprecated.Get the controller axis delta from the last value.floatDeprecated.Get the controller axis multiplier.getAxisRaw(int controllerIndex, VRInputType forAxis) Deprecated.Get the axis value for the given input on the given controller.getDigitalActionState(String actionName, String restrictToInput) Deprecated.Gets the current state of the action (abstract version of a button press).getFinalObserverPosition(int index) Deprecated.Get the position of the input after all positional tracking is complete.getFinalObserverRotation(int index) Deprecated.Get where is the controller pointing, after all rotations are combined.longgetOrFetchInputHandle(String inputName) Deprecated.Given an input name returns the handle to address it.getOrientation(int index) Deprecated.Get the orientation of the input.getPosition(int index) Deprecated.Get the position of the input.org.lwjgl.openvr.VRControllerStategetRawControllerState(int index) Deprecated.Get the native wrapping of a controller state.getTrackedController(int index) Deprecated.Get a tracked controller (for example, a hand controller) that is attached to the VR system.intDeprecated.Get the number of tracked controllers (for example, hand controllers) attached to the VR system.getVelocity(int controllerIndex) Deprecated.Get the controller velocity on all axes.booleaninit()Deprecated.Initialize the input.booleanisButtonDown(int controllerIndex, VRInputType checkButton) Deprecated.Check if the given button is down (more generally if the given input type is activated).booleanisInputDeviceTracking(int index) Deprecated.Check if the input device is actually tracked (i-e if we can obtain a pose from the input).booleanDeprecated.Check if the VR system has the focus and if it's not used by other process.voidregisterActionManifest(String actionManifestAbsolutePath, String startingActiveActionSets) Deprecated.Registers an action manifest.voidDeprecated.Reset the current activation of the inputs.voidsetActiveActionSet(String actionSet) Deprecated.Updates the active action set (the action group that will have their states available to be polled).voidsetAxisMultiplier(float set) Deprecated.Set the controller axis multiplier.voidDeprecated.Swap the two hands (exchange the hands' controller 1 and 2 indices).voidtriggerHapticAction(String actionName, float duration, float frequency, float amplitude, String restrictToInput) Deprecated.Triggers a haptic action (aka a vibration) restricted to just one input (e.g.voidtriggerHapticPulse(int controllerIndex, float seconds) Deprecated.Trigger a haptic pulse on the selected controller for the duration given in parameters (in seconds).voidDeprecated.Update the connected controllers.voidDeprecated.Update the controller states.booleanwasButtonPressedSinceLastCall(int controllerIndex, VRInputType checkButton) Deprecated.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, getDigitalActionState, triggerHapticAction
- 
Constructor Details- 
LWJGLOpenVRInputDeprecated.Create a new OpenVR input attached to the given VR environment.- Parameters:
- environment- the VR environment to which the input is attached.
 
 
- 
- 
Method Details- 
registerActionManifestpublic void registerActionManifest(String actionManifestAbsolutePath, String startingActiveActionSets) Deprecated.Description copied from interface:VRInputAPIRegisters an action manifest. An action manifest is a file that defines "actions" a player can make. (An action is an abstract version of a button press). The action manifest may then also include references to further files that define default mappings between those actions and physical buttons on the VR controllers. Note that registering an actions manifest will deactivate legacy inputs. i.e. methods such asVRInputAPI.isButtonDown(int, com.jme3.input.vr.VRInputType)will no longer work See https://github.com/ValveSoftware/openvr/wiki/Action-manifest for documentation on how to create an action manifest This option is only relevant to OpenVR- Specified by:
- registerActionManifestin interface- VRInputAPI
- Parameters:
- actionManifestAbsolutePath- the absolute file path to an actions manifest
- startingActiveActionSets- the actions in the manifest are divided into action sets (groups) by their prefix (e.g. "/actions/main"). These action sets can be turned off and on per frame. This argument sets the action set that will be active now. The active action sets can be later be changed by calling- VRInputAPI.setActiveActionSet(java.lang.String). Note that at present only a single set at a time is supported
 
- 
setActiveActionSetDeprecated.Description copied from interface:VRInputAPIUpdates the active action set (the action group that will have their states available to be polled). Note that this update will not take effect until the next loop Note that at present only a single set at a time is supported- Specified by:
- setActiveActionSetin interface- VRInputAPI
- Parameters:
- actionSet- the actions in the manifest are divided into action sets (groups) by their prefix (e.g. "/actions/main"). These action sets can be turned off and on per frame. This argument sets the action set that will be active now.
 
- 
getDigitalActionStateDeprecated.Description copied from interface:VRInputAPIGets the current state of the action (abstract version of a button press). This is called for digital style actions (a button is pressed, or not) This method is commonly called when it is important which hand the action is found on. For example while holding a weapon a button may be bound to "eject magazine" to allow you to load a new one, but that would only want to take effect on the hand that is holding the weapon Note that restrictToInput only restricts, it must still be bound to the input you want to receive the input from in the action manifest default bindings.VRInputAPI.registerActionManifest(java.lang.String, java.lang.String)must have been called before using this method.- Specified by:
- getDigitalActionStatein interface- VRInputAPI
- Parameters:
- actionName- The name of the action. E.g. /actions/main/in/openInventory
- restrictToInput- the input to restrict the action to. E.g. /user/hand/right. Or null, which means "any input"
- Returns:
- the DigitalActionState that has details on if the state has changed, what the state is etc.
 
- 
getAnalogActionStateDeprecated.Description copied from interface:VRInputAPIGets the current state of the action (abstract version of a button press). This is called for analog style actions (most commonly joysticks, but button pressure can also be mapped in analog). This method is commonly called when it is important which hand the action is found on. For example an "in universe" joystick that has a hat control might (while you are holding it) bind to the on-controller hat, but only on the hand holding it Note that restrictToInput only restricts, it must still be bound to the input you want to receive the input from in the action manifest default bindings.VRInputAPI.registerActionManifest(java.lang.String, java.lang.String)must have been called before using this method.- Specified by:
- getAnalogActionStatein interface- VRInputAPI
- Parameters:
- actionName- The name of the action. E.g. /actions/main/in/openInventory
- restrictToInput- the input to restrict the action to. E.g. /user/hand/right. Or null, which means "any input"
- Returns:
- the DigitalActionState that has details on if the state has changed, what the state is etc.
 
- 
getAxisMultiplierpublic float getAxisMultiplier()Deprecated.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 set) Deprecated.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:
- set- the controller axis multiplier.
- See Also:
 
- 
swapHandspublic void swapHands()Deprecated.Description copied from interface:VRInputAPISwap the two hands (exchange the hands' controller 1 and 2 indices).- Specified by:
- swapHandsin interface- VRInputAPI
 
- 
isButtonDownDeprecated.Description 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.
 
- 
wasButtonPressedSinceLastCallDeprecated.Description 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.
 
- 
resetInputSinceLastCallpublic void resetInputSinceLastCall()Deprecated.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:
 
- 
getAxisDeltaSinceLastCallDeprecated.Description 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.
 
- 
getVelocityDeprecated.Description 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:
 
- 
getAngularVelocityDeprecated.Description 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:
 
- 
getAxisRawDeprecated.Description 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:
 
- 
getAxisDeprecated.Description 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:
 
- 
initpublic boolean init()Deprecated.Description copied from interface:VRInputAPIInitialize the input.- Specified by:
- initin interface- VRInputAPI
- Returns:
- trueif the initialization is successful and- falseotherwise.
 
- 
getTrackedControllerDeprecated.Description 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:
 
- 
getTrackedControllerCountpublic int getTrackedControllerCount()Deprecated.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:
 
- 
getRawControllerStatepublic org.lwjgl.openvr.VRControllerState getRawControllerState(int index) Deprecated.Description 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.
 
- 
isInputFocusedpublic boolean isInputFocused()Deprecated.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.
 
- 
isInputDeviceTrackingpublic boolean isInputDeviceTracking(int index) Deprecated.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.
 
- 
getOrientationDeprecated.Description 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.
 
- 
getPositionDeprecated.Description 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.
 
- 
getFinalObserverRotationDeprecated.Description 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.
 
- 
getFinalObserverPositionDeprecated.Description 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.
 
- 
triggerHapticPulsepublic void triggerHapticPulse(int controllerIndex, float seconds) Deprecated.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.
 
- 
triggerHapticActionpublic void triggerHapticAction(String actionName, float duration, float frequency, float amplitude, String restrictToInput) Deprecated.Description copied from interface:VRInputAPITriggers a haptic action (aka a vibration) restricted to just one input (e.g. left or right hand). Note: restrictToInput only restricts which input is used at runtime. You must still bind the input you want to send the haptic to in the action manifest default bindings. This method is typically used by binding the haptic to both hands, and then deciding at runtime which hand it should be sent to.- Specified by:
- triggerHapticActionin interface- VRInputAPI
- Parameters:
- actionName- The name of the action. Will be something like /actions/main/out/vibrate
- duration- how long in seconds the
- frequency- in cycles per second
- amplitude- between 0 and 1
- restrictToInput- the input to restrict the action to, such as- /user/hand/rightor- /user/hand/left.- nullmeans "any input".
 
- 
updateConnectedControllerspublic void updateConnectedControllers()Deprecated.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
 
- 
updateControllerStatespublic void updateControllerStates()Deprecated.Description copied from interface:VRInputAPIUpdate the controller states. This method should be called before accessing any controller data.- Specified by:
- updateControllerStatesin interface- VRInputAPI
 
- 
getOrFetchInputHandleDeprecated.Given an input name returns the handle to address it. If a cached handle is available it is returned, if not it is fetched from openVr- Parameters:
- inputName- the input name, e.g. /user/hand/right. Or null, which means "any input"
- Returns:
- the input handle
 
 
-