mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 13:50:35 +02:00
fix for avatar models with multiple roots
This commit is contained in:
parent
96e81d5596
commit
0d18f2fbab
1 changed files with 7 additions and 4 deletions
|
@ -637,12 +637,15 @@ void SkeletonModel::computeBoundingShape(const FBXGeometry& geometry) {
|
||||||
|
|
||||||
// compute the default transforms and slam the ragdoll positions accordingly
|
// compute the default transforms and slam the ragdoll positions accordingly
|
||||||
// (which puts the shapes where we want them)
|
// (which puts the shapes where we want them)
|
||||||
transforms[0] = _jointStates[0].getTransform();
|
for (int i = 0; i < numJoints; i++) {
|
||||||
_ragdollPoints[0]._position = extractTranslation(transforms[0]);
|
|
||||||
_ragdollPoints[0]._lastPosition = _ragdollPoints[0]._position;
|
|
||||||
for (int i = 1; i < numJoints; i++) {
|
|
||||||
const FBXJoint& joint = geometry.joints.at(i);
|
const FBXJoint& joint = geometry.joints.at(i);
|
||||||
int parentIndex = joint.parentIndex;
|
int parentIndex = joint.parentIndex;
|
||||||
|
if (parentIndex == -1) {
|
||||||
|
transforms[i] = _jointStates[i].getTransform();
|
||||||
|
_ragdollPoints[i]._position = extractTranslation(transforms[i]);
|
||||||
|
_ragdollPoints[i]._lastPosition = _ragdollPoints[i]._position;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
assert(parentIndex != -1);
|
assert(parentIndex != -1);
|
||||||
|
|
||||||
glm::quat modifiedRotation = joint.preRotation * joint.rotation * joint.postRotation;
|
glm::quat modifiedRotation = joint.preRotation * joint.rotation * joint.postRotation;
|
||||||
|
|
Loading…
Reference in a new issue