Commit 87096296 authored by Ken Martin's avatar Ken Martin Committed by Kitware Robot

Merge topic 'openvr_fix_bases'

cc0501eb Fix error code with base stations
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !6252
parents 91595233 cc0501eb
Pipeline #153212 pending with stage
......@@ -125,7 +125,7 @@ void handleSaveCamera(vtkObject* caller, unsigned long eid, void* clientdata, vo
if (vr::VROverlay()->ShowMessageOverlay(s.str().c_str(), "Confirmation", "Yes", "No", nullptr,
nullptr) == vr::VRMessageOverlayResponse_ButtonPress_0)
{
ovl->SaveCameraPose(option - 1);
ovl->SaveCameraPose(option);
}
}
}
......@@ -137,7 +137,7 @@ void handleLoadCamera(vtkObject* caller, unsigned long eid, void* clientdata, vo
vtkOpenVRDefaultOverlay* ovl = static_cast<vtkOpenVRDefaultOverlay*>(caller);
// ovl->ReadCameraPoses();
int option = *(reinterpret_cast<int*>(&clientdata));
ovl->LoadCameraPose(option - 1);
ovl->LoadCameraPose(option);
}
}
......
......@@ -256,10 +256,20 @@ vtkOpenVRModel* vtkOpenVRRenderWindow::FindOrLoadRenderModel(const char* pchRend
pRenderModel->SetName(pchRenderModelName);
// start loading the model
if (vr::VRRenderModels()->LoadRenderModel_Async(pRenderModel->GetName().c_str(),
&pRenderModel->RawModel) > vr::EVRRenderModelError::VRRenderModelError_Loading)
auto status = vr::VRRenderModels()->LoadRenderModel_Async(
pRenderModel->GetName().c_str(), &pRenderModel->RawModel);
if (status == vr::EVRRenderModelError::VRRenderModelError_NoShapes)
{
vtkErrorMacro("Unable to load render model " << pRenderModel->GetName());
pRenderModel->SetVisibility(false);
this->VTKRenderModels.push_back(pRenderModel);
return pRenderModel;
}
if (status > vr::EVRRenderModelError::VRRenderModelError_Loading)
{
vtkErrorMacro(
"Unable to load render model " << pRenderModel->GetName() << " with status " << status);
pRenderModel->Delete();
return nullptr; // move on to the next tracked device
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment