mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0029384: Visualization, TKOpenGl - basic integration with OpenVR
V3d_View::AutoZFit() is now called only before redraw within methods V3d_View::Redraw() and V3d_View::Update(). Graphic3d_CView now holds Aspect_ExtendedRealitySession object. Aspect_OpenVRSession implements new interface via optional OpenVR library. Graphic3d_CView::ProcessInput() - added new interface method which should be called for processing positional input (head tracking). Graphic3d_Camera now allows setting custom stereoscopic Projection matrices. OpenGl_Context::Camera() - context now holds Camera object in addition to active camera matrices. genproj.tcl has been extended to handle optional CSF_OpenVR dependency.
This commit is contained in:
9
src/XRResources/FILES
Normal file
9
src/XRResources/FILES
Normal file
@@ -0,0 +1,9 @@
|
||||
srcinc:::occtvr_actions.json
|
||||
srcinc:::occtvr_bindings_generic.json
|
||||
srcinc:::occtvr_bindings_holographic_hmd.json
|
||||
srcinc:::occtvr_bindings_index_hmd.json
|
||||
srcinc:::occtvr_bindings_rift.json
|
||||
srcinc:::occtvr_bindings_vive.json
|
||||
srcinc:::occtvr_bindings_vive_controller.json
|
||||
srcinc:::occtvr_bindings_vive_cosmos.json
|
||||
srcinc:::occtvr_bindings_vive_pro.json
|
225
src/XRResources/occtvr_actions.json
Normal file
225
src/XRResources/occtvr_actions.json
Normal file
@@ -0,0 +1,225 @@
|
||||
{
|
||||
"actions": [
|
||||
{
|
||||
"name": "/actions/generic_head/in/headset_on_head",
|
||||
"type": "boolean",
|
||||
"requirement": "optional"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/pose_base",
|
||||
"type": "pose"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/pose_base",
|
||||
"type": "pose"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/pose_front",
|
||||
"type": "pose"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/pose_front",
|
||||
"type": "pose"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/pose_handgrip",
|
||||
"type": "pose"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/pose_handgrip",
|
||||
"type": "pose"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/pose_tip",
|
||||
"type": "pose"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/pose_tip",
|
||||
"type": "pose"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/out/haptic",
|
||||
"type": "vibration"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/out/haptic",
|
||||
"type": "vibration"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/appmenu_click",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/appmenu_click",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/sysmenu_click",
|
||||
"type": "boolean",
|
||||
"requirement": "optional"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/sysmenu_click",
|
||||
"type": "boolean",
|
||||
"requirement": "optional"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/trigger_click",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/trigger_click",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/trigger_pull",
|
||||
"type": "vector1"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/trigger_pull",
|
||||
"type": "vector1"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/grip_click",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/grip_click",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/trackpad_position",
|
||||
"type": "vector2"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/trackpad_position",
|
||||
"type": "vector2"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/trackpad_touch",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/trackpad_touch",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/trackpad_click",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/trackpad_click",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/thumbstick_position",
|
||||
"type": "vector2"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/thumbstick_position",
|
||||
"type": "vector2"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/thumbstick_touch",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/thumbstick_touch",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left/in/thumbstick_click",
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right/in/thumbstick_click",
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"action_sets": [
|
||||
{
|
||||
"name": "/actions/generic_head",
|
||||
"usage": "single"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_left",
|
||||
"usage": "leftright"
|
||||
},
|
||||
{
|
||||
"name": "/actions/generic_right",
|
||||
"usage": "leftright"
|
||||
}
|
||||
],
|
||||
"default_bindings": [
|
||||
{
|
||||
"controller_type": "vive_controller",
|
||||
"binding_url": "occtvr_bindings_vive_controller.json"
|
||||
},
|
||||
{
|
||||
"controller_type": "generic",
|
||||
"binding_url": "occtvr_bindings_generic.json"
|
||||
},
|
||||
{
|
||||
"controller_type": "holographic_controller",
|
||||
"binding_url": "occtvr_bindings_holographic_hmd.json"
|
||||
},
|
||||
{
|
||||
"controller_type": "indexhmd",
|
||||
"binding_url": "occtvr_bindings_index_hmd.json"
|
||||
},
|
||||
{
|
||||
"controller_type": "rift",
|
||||
"binding_url": "occtvr_bindings_rift.json"
|
||||
},
|
||||
{
|
||||
"controller_type": "vive",
|
||||
"binding_url": "occtvr_bindings_vive.json"
|
||||
},
|
||||
{
|
||||
"controller_type": "vive_cosmos",
|
||||
"binding_url": "occtvr_bindings_vive_cosmos.json"
|
||||
},
|
||||
{
|
||||
"controller_type": "vive_pro",
|
||||
"binding_url": "occtvr_bindings_vive_pro.json"
|
||||
}
|
||||
],
|
||||
"localization": [
|
||||
{
|
||||
"language_tag": "en_US",
|
||||
"/actions/generic_head/in/headset_on_head": "Headset is on head",
|
||||
"/actions/generic_left/in/appmenu_click": "Left app menu",
|
||||
"/actions/generic_left/in/sysmenu_click": "Left system menu",
|
||||
"/actions/generic_left/in/trigger_click": "Left trigger click",
|
||||
"/actions/generic_left/in/trigger_pull": "Left trigger squeeze",
|
||||
"/actions/generic_left/in/grip_click": "Left hand full grip",
|
||||
"/actions/generic_left/in/pose_base": "Left hand base",
|
||||
"/actions/generic_left/in/pose_front": "Left hand front",
|
||||
"/actions/generic_left/in/pose_handgrip": "Left handgrip pose",
|
||||
"/actions/generic_left/in/pose_tip": "Left forefinger tip",
|
||||
"/actions/generic_left/in/trackpad_position": "Left trackpad position",
|
||||
"/actions/generic_left/in/trackpad_touch": "Left trackpad touch",
|
||||
"/actions/generic_left/in/trackpad_click": "Left trackpad click",
|
||||
"/actions/generic_left/in/thumbstick_position": "Left thumbstick position",
|
||||
"/actions/generic_left/in/thumbstick_touch": "Left thumbstick touch",
|
||||
"/actions/generic_left/in/thumbstick_click": "Left thumbstick click",
|
||||
"/actions/generic_left/out/haptic": "Left hand haptic",
|
||||
"/actions/generic_right/in/appmenu_click": "Right app menu",
|
||||
"/actions/generic_right/in/sysmenu_click": "Right system menu",
|
||||
"/actions/generic_right/in/trigger_click": "Right trigger click",
|
||||
"/actions/generic_right/in/trigger_pull": "Right trigger squeeze",
|
||||
"/actions/generic_right/in/grip_click": "Right hand full grip",
|
||||
"/actions/generic_right/in/pose_base": "Right hand base",
|
||||
"/actions/generic_right/in/pose_front": "Right hand front",
|
||||
"/actions/generic_right/in/pose_handgrip": "Right handgrip pose",
|
||||
"/actions/generic_right/in/pose_tip": "Right forefinger tip",
|
||||
"/actions/generic_right/in/trackpad_position": "Right trackpad position",
|
||||
"/actions/generic_right/in/trackpad_touch": "Right trackpad touch",
|
||||
"/actions/generic_right/in/trackpad_click": "Right trackpad click",
|
||||
"/actions/generic_right/in/thumbstick_position": "Right thumbstick position",
|
||||
"/actions/generic_right/in/thumbstick_touch": "Right thumbstick touch",
|
||||
"/actions/generic_right/in/thumbstick_click": "Right thumbstick click",
|
||||
"/actions/generic_right/out/haptic": "Right hand haptic"
|
||||
}
|
||||
]
|
||||
}
|
87
src/XRResources/occtvr_bindings_generic.json
Normal file
87
src/XRResources/occtvr_bindings_generic.json
Normal file
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"bindings": {
|
||||
"/actions/generic_left": {
|
||||
"haptics": [
|
||||
{
|
||||
"output": "/actions/generic_left/out/haptic",
|
||||
"path": "/user/hand/left/output/haptic"
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_left/in/appmenu_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/left/input/application_menu"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_left/in/trigger_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/left/input/trigger"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_left/in/trackpad_click" },
|
||||
"touch": { "output": "/actions/generic_left/in/trackpad_touch" },
|
||||
"position": { "output": "/actions/generic_left/in/trackpad_position" }
|
||||
},
|
||||
"mode": "trackpad",
|
||||
"path": "/user/hand/left/input/trackpad"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_left/in/grip_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/left/input/grip"
|
||||
}
|
||||
]
|
||||
},
|
||||
"/actions/generic_right": {
|
||||
"haptics": [
|
||||
{
|
||||
"output": "/actions/generic_right/out/haptic",
|
||||
"path": "/user/hand/right/output/haptic"
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_right/in/appmenu_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/right/input/application_menu"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_right/in/trigger_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/right/input/trigger"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_right/in/trackpad_click" },
|
||||
"touch": { "output": "/actions/generic_right/in/trackpad_touch" },
|
||||
"position": { "output": "/actions/generic_right/in/trackpad_position" }
|
||||
},
|
||||
"mode": "trackpad",
|
||||
"path": "/user/hand/right/input/trackpad"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_right/in/grip_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/right/input/grip"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"controller_type": "generic",
|
||||
"description": "Standard Open CASCADE Technology VR bindings for a generic controller",
|
||||
"name": "OCCT VR bindings for a generic controller"
|
||||
}
|
18
src/XRResources/occtvr_bindings_holographic_hmd.json
Normal file
18
src/XRResources/occtvr_bindings_holographic_hmd.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"bindings": {
|
||||
"/actions/generic_head": {
|
||||
"sources": [
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_head/in/headset_on_head" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/head/proximity"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"controller_type": "holographic_hmd",
|
||||
"description": "",
|
||||
"name": "holographic_hmd defaults"
|
||||
}
|
18
src/XRResources/occtvr_bindings_index_hmd.json
Normal file
18
src/XRResources/occtvr_bindings_index_hmd.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"bindings": {
|
||||
"/actions/generic_head": {
|
||||
"sources": [
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_head/in/headset_on_head" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/head/proximity"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"controller_type": "indexhmd",
|
||||
"description": "",
|
||||
"name": "index hmd defaults"
|
||||
}
|
18
src/XRResources/occtvr_bindings_rift.json
Normal file
18
src/XRResources/occtvr_bindings_rift.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"bindings": {
|
||||
"/actions/generic_head": {
|
||||
"sources": [
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_head/in/headset_on_head" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/head/proximity"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"controller_type": "rift",
|
||||
"description": "",
|
||||
"name": "rift defaults"
|
||||
}
|
18
src/XRResources/occtvr_bindings_vive.json
Normal file
18
src/XRResources/occtvr_bindings_vive.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"bindings": {
|
||||
"/actions/generic_head": {
|
||||
"sources": [
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_head/in/headset_on_head" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/head/proximity"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"controller_type": "vive",
|
||||
"description": "",
|
||||
"name": "vive defaults"
|
||||
}
|
139
src/XRResources/occtvr_bindings_vive_controller.json
Normal file
139
src/XRResources/occtvr_bindings_vive_controller.json
Normal file
@@ -0,0 +1,139 @@
|
||||
{
|
||||
"bindings": {
|
||||
"/actions/generic_left": {
|
||||
"haptics": [
|
||||
{
|
||||
"output": "/actions/generic_left/out/haptic",
|
||||
"path": "/user/hand/left/output/haptic"
|
||||
}
|
||||
],
|
||||
"poses": [
|
||||
{
|
||||
"output": "/actions/generic_left/in/pose_base",
|
||||
"path": "/user/hand/left/pose/base"
|
||||
},
|
||||
{
|
||||
"output": "/actions/generic_left/in/pose_front",
|
||||
"path": "/user/hand/left/pose/front"
|
||||
},
|
||||
{
|
||||
"output": "/actions/generic_left/in/pose_handgrip",
|
||||
"path": "/user/hand/left/pose/handgrip"
|
||||
},
|
||||
{
|
||||
"output": "/actions/generic_left/in/pose_tip",
|
||||
"path": "/user/hand/left/pose/tip"
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_left/in/appmenu_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/left/input/application_menu"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_left/in/trigger_click" },
|
||||
"pull": { "output": "/actions/generic_left/in/trigger_pull" }
|
||||
},
|
||||
"mode": "trigger",
|
||||
"path": "/user/hand/left/input/trigger"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_left/in/trackpad_click" },
|
||||
"touch": { "output": "/actions/generic_left/in/trackpad_touch" },
|
||||
"position": { "output": "/actions/generic_left/in/trackpad_position" }
|
||||
},
|
||||
"mode": "trackpad",
|
||||
"path": "/user/hand/left/input/trackpad"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_left/in/grip_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/left/input/grip"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_left/in/sysmenu_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/left/input/system"
|
||||
}
|
||||
]
|
||||
},
|
||||
"/actions/generic_right": {
|
||||
"haptics": [
|
||||
{
|
||||
"output": "/actions/generic_right/out/haptic",
|
||||
"path": "/user/hand/right/output/haptic"
|
||||
}
|
||||
],
|
||||
"poses": [
|
||||
{
|
||||
"output": "/actions/generic_right/in/pose_base",
|
||||
"path": "/user/hand/right/pose/base"
|
||||
},
|
||||
{
|
||||
"output": "/actions/generic_right/in/pose_front",
|
||||
"path": "/user/hand/right/pose/front"
|
||||
},
|
||||
{
|
||||
"output": "/actions/generic_right/in/pose_handgrip",
|
||||
"path": "/user/hand/right/pose/handgrip"
|
||||
},
|
||||
{
|
||||
"output": "/actions/generic_right/in/pose_tip",
|
||||
"path": "/user/hand/right/pose/tip"
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_right/in/appmenu_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/right/input/application_menu"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_right/in/trigger_click" },
|
||||
"pull": { "output": "/actions/generic_right/in/trigger_pull" }
|
||||
},
|
||||
"mode": "trigger",
|
||||
"path": "/user/hand/right/input/trigger"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_right/in/trackpad_click" },
|
||||
"touch": { "output": "/actions/generic_right/in/trackpad_touch" },
|
||||
"position": { "output": "/actions/generic_right/in/trackpad_position" }
|
||||
},
|
||||
"mode": "trackpad",
|
||||
"path": "/user/hand/right/input/trackpad"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_right/in/grip_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/right/input/grip"
|
||||
},
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_right/in/sysmenu_click" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/hand/right/input/system"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"controller_type": "vive_controller",
|
||||
"description": "Standard Open CASCADE Technology VR bindings for the Vive controller",
|
||||
"name": "OCCT VR bindings for the Vive controller"
|
||||
}
|
18
src/XRResources/occtvr_bindings_vive_cosmos.json
Normal file
18
src/XRResources/occtvr_bindings_vive_cosmos.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"bindings": {
|
||||
"/actions/generic_head": {
|
||||
"sources": [
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_head/in/headset_on_head" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/head/proximity"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"controller_type": "vive_cosmos",
|
||||
"description": "",
|
||||
"name": "vive cosmos hmd defaults",
|
||||
}
|
18
src/XRResources/occtvr_bindings_vive_pro.json
Normal file
18
src/XRResources/occtvr_bindings_vive_pro.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"bindings": {
|
||||
"/actions/generic_head": {
|
||||
"sources": [
|
||||
{
|
||||
"inputs": {
|
||||
"click": { "output": "/actions/generic_head/in/headset_on_head" }
|
||||
},
|
||||
"mode": "button",
|
||||
"path": "/user/head/proximity"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"controller_type": "vive_pro",
|
||||
"description": "",
|
||||
"name": "vive_pro defaults"
|
||||
}
|
Reference in New Issue
Block a user