WIP: OpenVR Support
-
Enable OpenVR for iMSTK on Windows
-
Able to launch any example in VR
-
Switch parameter (
VTKViewer::m_openVR
) added toggling between desktop/VR app. For instance, to enable VR, you just have to call from your main:SimulationManager::getViewer()::setVRMode(true)
-
VTK GIT_TAG
in order to have mainly the following features/fixes:- vtk/vtk!2549 (merged)
- vtk/vtk!2574 (merged)
- Merge Request needed to launch
MiddleButtonRelease/PressEvent()
onvr::EVRButtonId::k_EButton_Grip
invtkOpenVRRenderWindowInteractor::DoOneEvent()
--> [DONE]: vtk/vtk!2609 (merged)
-
ssh
issue fixed byhttps
( should maybe moved in a separate MR)
Infrastructure
-
imstkVTKViewer
initializes RenderWindow, Interactor and callbacks (InteractorStyle for NONopenVR / vtkCommand for OpenVR) -
imstkOpenVRCommand
is a subclass of vtkCommand which defines the callbacks on VR button -
imstkVTKRenderer
instantiates the Renderer and the Camera
Add Command for Vive Remote
- Trigger Button to switch run/pause simulation
- Home button to switch start/end simulation
- Use
vtkCommand::StartEvent
to do aVTKRenderer::updateRenderDelegates()
instead of overridingOpenVRRenderWindowInteractor::DoOneEvent()
- Grip Button to take a screen shot (Innerbuild/Examples/Sandbox/screenShot_X.png)
Camera handling
-
openVRCamera: ActiveCamera
in VR will always have to be them_defaultVtkCamera
. Them_sceneVtkCamera
is used to load its world coordinate position - Switching to simulation mode move you to the
m_sceneVtkCamera
camera position - Switching to debug mode (when simulation ended for example) move you to your previous debug mode position statement
TODO
-
Fix the CMake part to download the right VTK Version -
CMake part to fill various option when openVR enabled (it shouldn't make the build crash) + Doc -
Copy OpenVRDashboard.jpg from External/VTK/ to iMSTK-build/bin (same place where we run the .exe) -
Move m_openVR
outsideVTKViewer
constructor -
Trigger command bugs (start/stop simulation when translation/scaling multi-touch or during dashboard interactions) --> need to disable scaling in simulation mode -
In dashboard mode: do not allow to interact with the simulation (+ stop simulation if it was running) -
Move camera to debug/sim camera when toggling mode