From cb672b878caf608f125ac1e9c660e057feb3d0eb Mon Sep 17 00:00:00 2001 From: amantley Date: Mon, 17 Dec 2018 08:42:53 -0800 Subject: [PATCH] looking at vive user flag behaviour --- interface/src/Application.cpp | 2 +- interface/src/graphics/GraphicsEngine.cpp | 3 ++- libraries/animation/src/AnimClip.cpp | 2 +- libraries/fbx/src/FBXSerializer.cpp | 8 ++++++-- .../oculus/src/OculusBaseDisplayPlugin.cpp | 1 + plugins/openvr/src/OpenVrDisplayPlugin.cpp | 1 + plugins/openvr/src/OpenVrHelpers.cpp | 20 ++++++++++++++++++- 7 files changed, 31 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e4bfd47ee4..de7a78bdcd 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -8057,7 +8057,7 @@ void Application::windowMinimizedChanged(bool minimized) { getActiveDisplayPlugin()->activate(); } else if (minimized && getActiveDisplayPlugin()->isActive()) { getActiveDisplayPlugin()->deactivate(); - _minimizedWindowTimer.start(THROTTLED_SIM_FRAME_PERIOD_MS); + //_minimizedWindowTimer.start(THROTTLED_SIM_FRAME_PERIOD_MS); } } diff --git a/interface/src/graphics/GraphicsEngine.cpp b/interface/src/graphics/GraphicsEngine.cpp index c2137d3d97..6406d02ced 100644 --- a/interface/src/graphics/GraphicsEngine.cpp +++ b/interface/src/graphics/GraphicsEngine.cpp @@ -32,6 +32,7 @@ #include #include "ui/Stats.h" #include "Application.h" +#include "InterfaceLogging.h" GraphicsEngine::GraphicsEngine() { const QString SPLASH_SKYBOX { "{\"ProceduralEntity\":{ \"version\":2, \"shaderUrl\":\"qrc:///shaders/splashSkybox.frag\" } }" }; @@ -153,7 +154,7 @@ bool GraphicsEngine::shouldPaint() const { (static_cast(_renderEventHandler)->_lastTimeRendered.elapsed() < THROTTLED_SIM_FRAME_PERIOD_MS)) { return false; } - + // qCDebug(interfaceapp) << "we are now throttling!!!!!"; return true; } diff --git a/libraries/animation/src/AnimClip.cpp b/libraries/animation/src/AnimClip.cpp index 9dcf5822cd..be28fc93be 100644 --- a/libraries/animation/src/AnimClip.cpp +++ b/libraries/animation/src/AnimClip.cpp @@ -110,7 +110,7 @@ void AnimClip::copyFromNetworkAnim() { for (int i = 0; i < animJointCount; i++) { int skeletonJoint = _skeleton->nameToJointIndex(animSkeleton.getJointName(i)); if (skeletonJoint == -1) { - qCWarning(animation) << "animation contains joint =" << animSkeleton.getJointName(i) << " which is not in the skeleton"; + //qCWarning(animation) << "animation contains joint =" << animSkeleton.getJointName(i) << " which is not in the skeleton"; } jointMap.push_back(skeletonJoint); } diff --git a/libraries/fbx/src/FBXSerializer.cpp b/libraries/fbx/src/FBXSerializer.cpp index b425b6795d..7c0053223d 100644 --- a/libraries/fbx/src/FBXSerializer.cpp +++ b/libraries/fbx/src/FBXSerializer.cpp @@ -478,8 +478,8 @@ HFMModel* FBXSerializer::extractHFMModel(const QVariantHash& mapping, const QStr std::map lights; QVariantHash joints = mapping.value("joint").toHash(); - QString jointEyeLeftName = "EyeLeft"; - QString jointEyeRightName = "EyeRight"; + QString jointEyeLeftName = "LeftEye"; + QString jointEyeRightName = "RightEye"; QString jointNeckName = "Neck"; QString jointRootName = "Hips"; QString jointLeanName = "Spine"; @@ -603,6 +603,7 @@ HFMModel* FBXSerializer::extractHFMModel(const QVariantHash& mapping, const QStr } if (name == jointEyeLeftName || name == "EyeL" || name == "joint_Leye" || (hfmModel.hfmToHifiJointNameMapping.contains(jointEyeLeftName) && (name == hfmModel.hfmToHifiJointNameMapping[jointEyeLeftName]))) { + qDebug(modelformat) << "made it to left eye get id " << name << " " << jointEyeLeftName; jointEyeLeftID = getID(object.properties); } else if (name == jointEyeRightName || name == "EyeR" || name == "joint_Reye" || (hfmModel.hfmToHifiJointNameMapping.contains(jointEyeRightName) && (name == hfmModel.hfmToHifiJointNameMapping[jointEyeRightName]))) { @@ -1451,11 +1452,14 @@ HFMModel* FBXSerializer::extractHFMModel(const QVariantHash& mapping, const QStr // find our special joints hfmModel.leftEyeJointIndex = modelIDs.indexOf(jointEyeLeftID); + qDebug(modelformat) << "jointlefteye" << hfmModel.leftEyeJointIndex << " " << jointEyeLeftID; hfmModel.rightEyeJointIndex = modelIDs.indexOf(jointEyeRightID); + qDebug(modelformat) << "jointrighteye" << hfmModel.rightEyeJointIndex << " " << jointEyeRightID; hfmModel.neckJointIndex = modelIDs.indexOf(jointNeckID); hfmModel.rootJointIndex = modelIDs.indexOf(jointRootID); hfmModel.leanJointIndex = modelIDs.indexOf(jointLeanID); hfmModel.headJointIndex = modelIDs.indexOf(jointHeadID); + qDebug(modelformat) << "head joint" << hfmModel.headJointIndex; hfmModel.leftHandJointIndex = modelIDs.indexOf(jointLeftHandID); hfmModel.rightHandJointIndex = modelIDs.indexOf(jointRightHandID); hfmModel.leftToeJointIndex = modelIDs.indexOf(jointLeftToeID); diff --git a/plugins/oculus/src/OculusBaseDisplayPlugin.cpp b/plugins/oculus/src/OculusBaseDisplayPlugin.cpp index f10aba7920..b3212b63f8 100644 --- a/plugins/oculus/src/OculusBaseDisplayPlugin.cpp +++ b/plugins/oculus/src/OculusBaseDisplayPlugin.cpp @@ -39,6 +39,7 @@ bool OculusBaseDisplayPlugin::beginFrameRender(uint32_t frameIndex) { } if (ovr::hmdMounted(status) != _hmdMounted) { _hmdMounted = !_hmdMounted; + qCDebug(oculusLog) << "changed the hmd status" << _hmdMounted; emit hmdMountedChanged(); } if (ovr::isVisible(status) != _visible) { diff --git a/plugins/openvr/src/OpenVrDisplayPlugin.cpp b/plugins/openvr/src/OpenVrDisplayPlugin.cpp index 11ef222172..c44f0b27b5 100644 --- a/plugins/openvr/src/OpenVrDisplayPlugin.cpp +++ b/plugins/openvr/src/OpenVrDisplayPlugin.cpp @@ -686,6 +686,7 @@ void OpenVrDisplayPlugin::postPreview() { } if (isHmdMounted() != _hmdMounted) { + qDebug() << "changed hmd status " << isHmdMounted(); _hmdMounted = !_hmdMounted; emit hmdMountedChanged(); } diff --git a/plugins/openvr/src/OpenVrHelpers.cpp b/plugins/openvr/src/OpenVrHelpers.cpp index 9a57413f95..7f46b8d2fc 100644 --- a/plugins/openvr/src/OpenVrHelpers.cpp +++ b/plugins/openvr/src/OpenVrHelpers.cpp @@ -120,7 +120,7 @@ vr::IVRSystem* acquireOpenVrSystem() { } if (activeHmd) { #if DEV_BUILD - qCDebug(displayplugins) << "OpenVR: incrementing refcount"; + //qCDebug(displayplugins) << "OpenVR: incrementing refcount"; #endif ++refCount; } @@ -268,6 +268,15 @@ void handleOpenVrEvents() { _keyboardShown = false; DependencyManager::get()->unfocusWindows(); break; + + case vr::VREvent_TrackedDeviceUserInteractionStarted: + qDebug() << "Put on the headset"; + //hmdMountedChanged(); + break; + + case vr::VREvent_TrackedDeviceUserInteractionEnded: + qDebug() << "Took off the headset"; + break; default: break; @@ -418,6 +427,15 @@ void showMinSpecWarning() { } break; + case vr::VREvent_TrackedDeviceUserInteractionStarted: + qDebug() << "Put on the headset2"; + //hmdMountedChanged(); + break; + + case vr::VREvent_TrackedDeviceUserInteractionEnded: + qDebug() << "Took off the headset2"; + break; + default: break; }