Package openmw.vr
openmw.vr virtual reality interface.
Can be used only by menu scripts and local scripts, that are attached to a player. Much of the API is hidden, and exposed via the interface_vrinputs, interface_vrspaces, and interface_vrui interfaces.
Usage
local vr = require('openmw.uvr')
if not vr.isVr() then
return
end
Type vr
| vr.INTERACTION_VALUE_TYPES |
Interaction value types |
| vr.availableInteractions |
Supertable of all interactions supported by the runtime. |
| vr.controllerPaths |
Controller path values |
| vr.isControllerActive(controller) | |
| vr.isLeftHandedMode() | |
| vr.isVr() |
Type INTERACTION_VALUE_TYPE
| INTERACTION_VALUE_TYPE.Axis |
AXIS |
| INTERACTION_VALUE_TYPE.Boolean |
BOOLEAN |
| INTERACTION_VALUE_TYPE.Float |
FLOAT |
| INTERACTION_VALUE_TYPE.Pose |
POSE |
Type Pose
Type vr
Field(s)
- #INTERACTION_VALUE_TYPE vr.INTERACTION_VALUE_TYPES
-
Interaction value types
- #table vr.availableInteractions
-
Supertable of all interactions supported by the runtime.
The structure of the table is { interactionProfilePath = { controllerPath = { interactionPath = #INTERACTION_VALUE_TYPE,},}, } I recommend printing out the table yourself to see what's in it to understand it better.
Usage
local I = require('openmw.interfaces') local vr = require('openmw.vr') local function printAvailableInteractions(controller) local profile = I.vrinputs.getInteractionProfileOfController(controller) if not vr.availableInteractions[profile] then print('Profile '..tostring(profile)..' not supported') return end print('Available interactions for '..controller..' controller of '..profile..': ') for k,v in pairs(vr.availableInteractions[profile][controller]) do print(' - '..k..' [type:'..v..']') end end printAvailableInteractions(I.vrinputs.controllers.LEFT_HAND) printAvailableInteractions(I.vrinputs.controllers.RIGHT_HAND)
- #list<#string> vr.controllerPaths
-
Controller path values
- vr.isControllerActive(controller)
-
Parameter
-
#CONTROLLER_PATH controller:
Return value
#boolean:
-
- vr.isLeftHandedMode()
-
Return value
#boolean:
- vr.isVr()
-
Return value
#boolean:
Type CONTROLLER_PATH
Type INTERACTION_VALUE_TYPE
Available interaction value types in OpenXR
Field(s)
- INTERACTION_VALUE_TYPE.Boolean
-
BOOLEAN
Type Pose
A spatial pose, consisting of a position and an orientation