From 3b14988577f511f598db433717c80ba95c371f12 Mon Sep 17 00:00:00 2001 From: Anthony Thibault Date: Fri, 22 Jul 2016 16:27:43 -0700 Subject: [PATCH] Fix another crash if "Hips" joint is not found. --- 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 95ca493058..6ab4aa2127 100644 --- a/libraries/animation/src/AnimInverseKinematics.cpp +++ b/libraries/animation/src/AnimInverseKinematics.cpp @@ -428,7 +428,7 @@ const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars // shift hips according to the _hipsOffset from the previous frame float offsetLength = glm::length(_hipsOffset); const float MIN_HIPS_OFFSET_LENGTH = 0.03f; - if (offsetLength > MIN_HIPS_OFFSET_LENGTH) { + if (offsetLength > MIN_HIPS_OFFSET_LENGTH && _hipsIndex >= 0) { // but only if offset is long enough float scaleFactor = ((offsetLength - MIN_HIPS_OFFSET_LENGTH) / offsetLength); if (_hipsParentIndex == -1) {