mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 19:52:26 +02:00
Fix another crash if "Hips" joint is not found.
This commit is contained in:
parent
a43e9a5710
commit
3b14988577
1 changed files with 1 additions and 1 deletions
|
@ -428,7 +428,7 @@ const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars
|
||||||
// shift hips according to the _hipsOffset from the previous frame
|
// shift hips according to the _hipsOffset from the previous frame
|
||||||
float offsetLength = glm::length(_hipsOffset);
|
float offsetLength = glm::length(_hipsOffset);
|
||||||
const float MIN_HIPS_OFFSET_LENGTH = 0.03f;
|
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
|
// but only if offset is long enough
|
||||||
float scaleFactor = ((offsetLength - MIN_HIPS_OFFSET_LENGTH) / offsetLength);
|
float scaleFactor = ((offsetLength - MIN_HIPS_OFFSET_LENGTH) / offsetLength);
|
||||||
if (_hipsParentIndex == -1) {
|
if (_hipsParentIndex == -1) {
|
||||||
|
|
Loading…
Reference in a new issue