mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-30 13:22:55 +02:00
reduce log spam in Vive plugins
This commit is contained in:
parent
da74114b32
commit
39ff03cfb5
2 changed files with 24 additions and 8 deletions
|
@ -96,7 +96,9 @@ bool OpenVrDisplayPlugin::internalActivate() {
|
||||||
glm::vec3 uiPos(0.0f, UI_HEIGHT, UI_RADIUS - (0.5f * zSize) - UI_Z_OFFSET);
|
glm::vec3 uiPos(0.0f, UI_HEIGHT, UI_RADIUS - (0.5f * zSize) - UI_Z_OFFSET);
|
||||||
_sensorResetMat = glm::inverse(createMatFromQuatAndPos(glm::quat(), uiPos));
|
_sensorResetMat = glm::inverse(createMatFromQuatAndPos(glm::quat(), uiPos));
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "OpenVR: error could not get chaperone pointer";
|
#if DEV_BUILD
|
||||||
|
qDebug() << "OpenVR: error could not get chaperone pointer";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return Parent::internalActivate();
|
return Parent::internalActivate();
|
||||||
|
|
|
@ -64,17 +64,25 @@ vr::IVRSystem* acquireOpenVrSystem() {
|
||||||
if (hmdPresent) {
|
if (hmdPresent) {
|
||||||
Lock lock(mutex);
|
Lock lock(mutex);
|
||||||
if (!activeHmd) {
|
if (!activeHmd) {
|
||||||
qCDebug(displayplugins) << "OpenVR: No vr::IVRSystem instance active, building";
|
#if DEV_BUILD
|
||||||
|
qCDebug(displayplugins) << "OpenVR: No vr::IVRSystem instance active, building";
|
||||||
|
#endif
|
||||||
vr::EVRInitError eError = vr::VRInitError_None;
|
vr::EVRInitError eError = vr::VRInitError_None;
|
||||||
activeHmd = vr::VR_Init(&eError, vr::VRApplication_Scene);
|
activeHmd = vr::VR_Init(&eError, vr::VRApplication_Scene);
|
||||||
qCDebug(displayplugins) << "OpenVR display: HMD is " << activeHmd << " error is " << eError;
|
#if DEV_BUILD
|
||||||
|
qCDebug(displayplugins) << "OpenVR display: HMD is " << activeHmd << " error is " << eError;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (activeHmd) {
|
if (activeHmd) {
|
||||||
qCDebug(displayplugins) << "OpenVR: incrementing refcount";
|
#if DEV_BUILD
|
||||||
|
qCDebug(displayplugins) << "OpenVR: incrementing refcount";
|
||||||
|
#endif
|
||||||
++refCount;
|
++refCount;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qCDebug(displayplugins) << "OpenVR: no hmd present";
|
#if DEV_BUILD
|
||||||
|
qCDebug(displayplugins) << "OpenVR: no hmd present";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return activeHmd;
|
return activeHmd;
|
||||||
}
|
}
|
||||||
|
@ -82,10 +90,14 @@ vr::IVRSystem* acquireOpenVrSystem() {
|
||||||
void releaseOpenVrSystem() {
|
void releaseOpenVrSystem() {
|
||||||
if (activeHmd) {
|
if (activeHmd) {
|
||||||
Lock lock(mutex);
|
Lock lock(mutex);
|
||||||
qCDebug(displayplugins) << "OpenVR: decrementing refcount";
|
#if DEV_BUILD
|
||||||
|
qCDebug(displayplugins) << "OpenVR: decrementing refcount";
|
||||||
|
#endif
|
||||||
--refCount;
|
--refCount;
|
||||||
if (0 == refCount) {
|
if (0 == refCount) {
|
||||||
qCDebug(displayplugins) << "OpenVR: zero refcount, deallocate VR system";
|
#if DEV_BUILD
|
||||||
|
qCDebug(displayplugins) << "OpenVR: zero refcount, deallocate VR system";
|
||||||
|
#endif
|
||||||
vr::VR_Shutdown();
|
vr::VR_Shutdown();
|
||||||
activeHmd = nullptr;
|
activeHmd = nullptr;
|
||||||
}
|
}
|
||||||
|
@ -261,7 +273,9 @@ void handleOpenVrEvents() {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
qDebug() << "OpenVR: Event " << activeHmd->GetEventTypeNameFromEnum((vr::EVREventType)event.eventType) << "(" << event.eventType << ")";
|
#if DEV_BUILD
|
||||||
|
qDebug() << "OpenVR: Event " << activeHmd->GetEventTypeNameFromEnum((vr::EVREventType)event.eventType) << "(" << event.eventType << ")";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue