activate OtherAvarar in physics sim on position change

This commit is contained in:
Andrew Meadows 2018-09-24 16:27:37 -07:00
parent c1d65f5118
commit a3f946dee1
3 changed files with 5 additions and 4 deletions

View file

@ -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 {

View file

@ -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() {

View file

@ -43,7 +43,7 @@ public:
void setWorkloadRegion(uint8_t region);
bool shouldBeInPhysicsSimulation() const;
bool needsPhysicsShapeUpdate() const;
bool needsPhysicsUpdate() const;
friend AvatarManager;