mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
fix for bad contacts after changing avatar models
This commit is contained in:
parent
e35596428c
commit
c9cd336400
1 changed files with 5 additions and 0 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue