don't forget to add detailedMotionStates to simulation

This commit is contained in:
Andrew Meadows 2019-05-02 13:24:25 -07:00
parent a0841c937c
commit af1f4364ef

View file

@ -471,13 +471,17 @@ void AvatarManager::rebuildAvatarPhysics(PhysicsEngine::Transaction& transaction
OtherAvatar::BodyLOD lod = avatar->getBodyLOD();
if (lod == OtherAvatar::BodyLOD::Sphere) {
auto dMotionState = createDetailedMotionState(avatar, -1);
detailedMotionStates.push_back(dMotionState);
if (dMotionState) {
detailedMotionStates.push_back(dMotionState);
transaction.objectsToAdd.push_back(dMotionState);
}
} else {
int32_t numJoints = avatar->getJointCount();
for (int32_t i = 0; i < numJoints; i++) {
auto dMotionState = createDetailedMotionState(avatar, i);
if (dMotionState) {
detailedMotionStates.push_back(dMotionState);
transaction.objectsToAdd.push_back(dMotionState);
}
}
}