fix for bad contacts after changing avatar models

This commit is contained in:
Andrew Meadows 2015-10-27 15:01:48 -07:00
parent e35596428c
commit c9cd336400

View file

@ -246,6 +246,11 @@ void PhysicsEngine::stepSimulation() {
// be done on the main thread during the pre-simulation stuff
if (_myAvatarController->needsRemoval()) {
_myAvatarController->setDynamicsWorld(nullptr);
// We must remove any existing contacts for the avatar so that any new contacts will have
// valid data. MyAvatar's RigidBody is the ONLY one in the simulation that does not yet
// have a MotionState so we pass nullptr to removeContacts().
removeContacts(nullptr);
}
_myAvatarController->updateShapeIfNecessary();
if (_myAvatarController->needsAddition()) {