mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:48:56 +02:00
also update easy flags when rebuilding avatar shape
This commit is contained in:
parent
f60dbda25e
commit
c7432ffe5f
1 changed files with 9 additions and 14 deletions
|
@ -504,23 +504,18 @@ void AvatarManager::buildPhysicsTransaction(PhysicsEngine::Transaction& transact
|
||||||
}
|
}
|
||||||
} else if (isInPhysics) {
|
} else if (isInPhysics) {
|
||||||
AvatarMotionState* motionState = avatar->_motionState;
|
AvatarMotionState* motionState = avatar->_motionState;
|
||||||
|
uint32_t flags = motionState->getIncomingDirtyFlags();
|
||||||
|
if (flags & EASY_DIRTY_PHYSICS_FLAGS) {
|
||||||
|
motionState->handleEasyChanges(flags);
|
||||||
|
}
|
||||||
|
// NOTE: we don't call detailedMotionState->handleEasyChanges() here because they are KINEMATIC
|
||||||
|
// and Bullet will automagically call DetailedMotionState::getWorldTransform() on all that are active.
|
||||||
|
|
||||||
if (motionState->needsNewShape()) {
|
if (motionState->needsNewShape()) {
|
||||||
rebuildAvatarPhysics(transaction, avatar);
|
rebuildAvatarPhysics(transaction, avatar);
|
||||||
} else {
|
} else if (flags & (Simulation::DIRTY_MOTION_TYPE | Simulation::DIRTY_COLLISION_GROUP)) {
|
||||||
uint32_t flags = motionState->getIncomingDirtyFlags();
|
transaction.objectsToReinsert.push_back(motionState);
|
||||||
motionState->clearIncomingDirtyFlags();
|
motionState->clearIncomingDirtyFlags();
|
||||||
if (flags & EASY_DIRTY_PHYSICS_FLAGS) {
|
|
||||||
motionState->handleEasyChanges(flags);
|
|
||||||
}
|
|
||||||
// NOTE: we don't call detailedMotionState->handleEasyChanges() here because they are KINEMATIC
|
|
||||||
// and Bullet will automagically call DetailedMotionState::getWorldTransform() on all that are active.
|
|
||||||
|
|
||||||
if (flags & (Simulation::DIRTY_MOTION_TYPE | Simulation::DIRTY_COLLISION_GROUP)) {
|
|
||||||
transaction.objectsToReinsert.push_back(motionState);
|
|
||||||
for (auto detailedMotionState : avatar->getDetailedMotionStates()) {
|
|
||||||
transaction.objectsToReinsert.push_back(detailedMotionState);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue