mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
activate OtherAvarar in physics sim on position change
This commit is contained in:
parent
c1d65f5118
commit
a3f946dee1
3 changed files with 5 additions and 4 deletions
|
@ -238,7 +238,7 @@ void AvatarManager::updateOtherAvatars(float deltaTime) {
|
|||
if (avatar->getSkeletonModel()->isLoaded()) {
|
||||
// remove the orb if it is there
|
||||
avatar->removeOrb();
|
||||
if (avatar->needsPhysicsShapeUpdate()) {
|
||||
if (avatar->needsPhysicsUpdate()) {
|
||||
_avatarsToChangeInPhysics.insert(avatar);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -119,8 +119,9 @@ bool OtherAvatar::shouldBeInPhysicsSimulation() const {
|
|||
return (_workloadRegion < workload::Region::R3 && !isDead());
|
||||
}
|
||||
|
||||
bool OtherAvatar::needsPhysicsShapeUpdate() const {
|
||||
return (_motionState && (_motionState->getIncomingDirtyFlags() & (Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS)));
|
||||
bool OtherAvatar::needsPhysicsUpdate() const {
|
||||
constexpr uint32_t FLAGS_OF_INTEREST = Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS | Simulation::DIRTY_POSITION;
|
||||
return (_motionState && (bool)(_motionState->getIncomingDirtyFlags() & FLAGS_OF_INTEREST));
|
||||
}
|
||||
|
||||
void OtherAvatar::rebuildCollisionShape() {
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
|
||||
void setWorkloadRegion(uint8_t region);
|
||||
bool shouldBeInPhysicsSimulation() const;
|
||||
bool needsPhysicsShapeUpdate() const;
|
||||
bool needsPhysicsUpdate() const;
|
||||
|
||||
friend AvatarManager;
|
||||
|
||||
|
|
Loading…
Reference in a new issue