From 2716a9f2b4ec049d1c2e8b934e5707f23e1799a4 Mon Sep 17 00:00:00 2001 From: "U-GAPOS\\andrew" Date: Mon, 9 Nov 2015 13:11:03 -0800 Subject: [PATCH 1/8] fix IK for feet targets --- libraries/animation/src/AnimInverseKinematics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp index 6355426dae..691197a651 100644 --- a/libraries/animation/src/AnimInverseKinematics.cpp +++ b/libraries/animation/src/AnimInverseKinematics.cpp @@ -160,7 +160,7 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vectorgetParentIndex(pivotIndex); - if (pivotsParentIndex == -1 || pivotIndex == _hipsIndex) { + if (pivotsParentIndex == -1) { // TODO?: handle case where tip's parent is root? continue; } @@ -173,7 +173,7 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vectorgetParentIndex(i); - if (parentIndex != -1 && parentIndex != _hipsIndex) { + if (parentIndex != -1) { absolutePoses[i] = absolutePoses[parentIndex] * _relativePoses[i]; } } @@ -295,7 +295,7 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vectorgetParentIndex(tipIndex); - if (parentIndex != -1 && parentIndex != _hipsIndex) { + if (parentIndex != -1) { const glm::quat& targetRotation = target.getRotation(); // compute tip's new parent-relative rotation // Q = Qp * q --> q' = Qp^ * Q From c07b97920e1152ea0e34dd0930b0e865b1c66d75 Mon Sep 17 00:00:00 2001 From: "U-GAPOS\\andrew" Date: Mon, 9 Nov 2015 14:11:45 -0800 Subject: [PATCH 2/8] fix for avatars created with blender --- libraries/animation/src/AnimInverseKinematics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp index 691197a651..c7d1a9d630 100644 --- a/libraries/animation/src/AnimInverseKinematics.cpp +++ b/libraries/animation/src/AnimInverseKinematics.cpp @@ -173,7 +173,7 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector Date: Mon, 9 Nov 2015 14:15:09 -0800 Subject: [PATCH 3/8] swap the order of checks --- libraries/animation/src/AnimInverseKinematics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp index c7d1a9d630..d5728b79b4 100644 --- a/libraries/animation/src/AnimInverseKinematics.cpp +++ b/libraries/animation/src/AnimInverseKinematics.cpp @@ -173,7 +173,7 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector Date: Mon, 9 Nov 2015 14:26:23 -0800 Subject: [PATCH 4/8] Fix warnings on OS X --- interface/src/avatar/MyAvatar.cpp | 3 --- tests/recording/src/main.cpp | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 57af9e732d..8595fa850e 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1608,7 +1608,6 @@ void MyAvatar::updateOrientation(float deltaTime) { // Comfort Mode: If you press any of the left/right rotation drive keys or input, you'll // get an instantaneous 15 degree turn. If you keep holding the key down you'll get another // snap turn every half second. - quint64 now = usecTimestampNow(); if (_driveKeys[STEP_YAW] != 0.0f) { totalBodyYaw += _driveKeys[STEP_YAW]; } @@ -1676,8 +1675,6 @@ glm::vec3 MyAvatar::applyKeyboardMotor(float deltaTime, const glm::vec3& localVe float motorEfficiency = glm::clamp(deltaTime / timescale, 0.0f, 1.0f); glm::vec3 newLocalVelocity = localVelocity; - float stepControllerInput = fabsf(_driveKeys[STEP_TRANSLATE_Z]) + fabsf(_driveKeys[STEP_TRANSLATE_Z]) + fabsf(_driveKeys[STEP_TRANSLATE_Z]); - quint64 now = usecTimestampNow(); // FIXME how do I implement step translation as well? diff --git a/tests/recording/src/main.cpp b/tests/recording/src/main.cpp index 836d8b5ac1..96c9a7f1a7 100644 --- a/tests/recording/src/main.cpp +++ b/tests/recording/src/main.cpp @@ -12,8 +12,6 @@ #include "Constants.h" -#define QVERIFY Q_ASSERT - using namespace recording; FrameType TEST_FRAME_TYPE { Frame::TYPE_INVALID }; @@ -30,7 +28,8 @@ void testFrameTypeRegistration() { auto backMap = recording::Frame::getFrameTypeNames(); QVERIFY(backMap.count(TEST_FRAME_TYPE) == 1); QVERIFY(backMap[TEST_FRAME_TYPE] == TEST_NAME); - QVERIFY(backMap[recording::Frame::TYPE_HEADER] == HEADER_NAME); + auto typeHeader = recording::Frame::TYPE_HEADER; + QVERIFY(backMap[typeHeader] == HEADER_NAME); } void testFilePersist() { From e47b049200c6679fb266a99777f229d77796611a Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Mon, 9 Nov 2015 16:41:40 -0800 Subject: [PATCH 5/8] fix render item leak on Model::reset() --- libraries/render-utils/src/Model.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 6aae7ad1cb..2cb380a8e2 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -135,9 +135,6 @@ void Model::reset() { const FBXGeometry& geometry = _geometry->getFBXGeometry(); _rig->reset(geometry.joints); } - _meshGroupsKnown = false; - _readyWhenAdded = false; // in case any of our users are using scenes - invalidCalculatedMeshBoxes(); // if we have to reload, we need to assume our mesh boxes are all invalid } bool Model::updateGeometry() { From 021a6e689d92c26a4d2a84c6f0426bc592d8b4e7 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Mon, 9 Nov 2015 17:09:17 -0800 Subject: [PATCH 6/8] added some asserts to test future mistakes that would cause render item leaks --- libraries/render-utils/src/Model.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 2cb380a8e2..5b9bfdca3d 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -1153,6 +1153,9 @@ void Model::segregateMeshGroups() { return; } + Q_ASSERT(_renderItems.isEmpty()); // We should not have any existing renderItems if we enter this section of code + Q_ASSERT(_renderItemsSet.isEmpty()); // We should not have any existing renderItemsSet if we enter this section of code + _renderItemsSet.clear(); // Run through all of the meshes, and place them into their segregated, but unsorted buckets From 0ea901fd721081dcfcd969bdd928da007666b3f6 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Tue, 10 Nov 2015 08:34:58 -0800 Subject: [PATCH 7/8] fix various warnings --- .../src/RenderableParticleEffectEntityItem.cpp | 1 - libraries/recording/src/recording/Deck.cpp | 5 ++++- libraries/recording/src/recording/Frame.cpp | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp index 6f3b40eb1e..41cf3b9bbf 100644 --- a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp @@ -218,7 +218,6 @@ void RenderableParticleEffectEntityItem::updateRenderItem() { _vertices.clear(); // build vertices from particle positions and radiuses - glm::vec3 frustumPosition = frustum->getPosition(); glm::vec3 dir = frustum->getDirection(); for (auto&& particle : particleDetails) { glm::vec3 right = glm::normalize(glm::cross(glm::vec3(0.0f, 1.0f, 0.0f), dir)); diff --git a/libraries/recording/src/recording/Deck.cpp b/libraries/recording/src/recording/Deck.cpp index a80fc43204..f0db37078b 100644 --- a/libraries/recording/src/recording/Deck.cpp +++ b/libraries/recording/src/recording/Deck.cpp @@ -6,4 +6,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include "Deck.h" + +// FIXME -- DO NOT include headers in empty CPP files, it produces warnings. Once we define new symbols +// and some actual code here, we can uncomment this include. +//#include "Deck.h" diff --git a/libraries/recording/src/recording/Frame.cpp b/libraries/recording/src/recording/Frame.cpp index 211f192c0a..aac8a4d9c3 100644 --- a/libraries/recording/src/recording/Frame.cpp +++ b/libraries/recording/src/recording/Frame.cpp @@ -80,6 +80,7 @@ FrameType Frame::registerFrameType(const QString& frameTypeName) { std::call_once(once, [&] { auto headerType = frameTypes.registerValue("com.highfidelity.recording.Header"); Q_ASSERT(headerType == Frame::TYPE_HEADER); + Q_UNUSED(headerType); // FIXME - build system on unix still not upgraded to Qt 5.5.1 so Q_ASSERT still produces warnings }); return frameTypes.registerValue(frameTypeName); } From 4a0a481ac6c654b205e4b7d43e6586ddc5fdf66b Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Tue, 10 Nov 2015 08:44:51 -0800 Subject: [PATCH 8/8] more fixes --- tests/recording/src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/recording/src/main.cpp b/tests/recording/src/main.cpp index 96c9a7f1a7..f4049b04b7 100644 --- a/tests/recording/src/main.cpp +++ b/tests/recording/src/main.cpp @@ -94,6 +94,7 @@ void testClipOrdering() { for (auto writeFrame = writeClip->nextFrame(); writeFrame; writeFrame = writeClip->nextFrame()) { QVERIFY(writeClip->position() >= lastFrameTimeOffset); } + Q_UNUSED(lastFrameTimeOffset); // FIXME - Unix build not yet upgraded to Qt 5.5.1 we can remove this once it is } #ifdef Q_OS_WIN32