Showing the changes to libraries/render-utils/src/Model.cpp (1 of 2 files). Show all
Unified · Split
| @@ -1306,8 +1306,10 @@ void Model::updateJointState(int index) { · 1305 unmodified lines | ||
| 1306 | 1306 | glm::mat4 parentTransform = glm::scale(_scale) * glm::translate(_offset) * geometry.offset; |
| 1307 | 1307 | state.computeTransform(parentTransform); |
| 1308 | 1308 | } else { |
| 1309 | − const JointState& parentState = _jointStates.at(parentIndex); | |
| 1310 | − state.computeTransform(parentState.getTransform(), parentState.getTransformChanged()); | |
| 1309 | + if (joint.parentIndex >= 0 && joint.parentIndex < _jointStates.size()) { | |
| 1310 | + const JointState& parentState = _jointStates.at(parentIndex); | |
| 1311 | + state.computeTransform(parentState.getTransform(), parentState.getTransformChanged()); | |
| 1312 | + } | |
| 1311 | 1313 | } |
| 1312 | 1314 | } |
| 1313 | 1315 | |