try harder to not do simple-simulation on things that have an avatar ancestor

This commit is contained in:
Seth Alves 2016-06-08 13:47:52 -07:00
parent a1766539f4
commit d7fc789ea7

View file

@ -261,11 +261,14 @@ void EntitySimulation::moveSimpleKinematics(const quint64& now) {
SetOfEntities::iterator itemItr = _simpleKinematicEntities.begin(); SetOfEntities::iterator itemItr = _simpleKinematicEntities.begin();
while (itemItr != _simpleKinematicEntities.end()) { while (itemItr != _simpleKinematicEntities.end()) {
EntityItemPointer entity = *itemItr; EntityItemPointer entity = *itemItr;
if (entity->isMovingRelativeToParent() &&
!entity->getPhysicsInfo() && // The entity-server doesn't know where avatars are, so don't attempt to do simple extrapolation for
// The entity-server doesn't know where avatars are, so don't attempt to do simple extrapolation for // children of avatars.
// children of avatars. bool ancestryIsKnown;
!entity->hasAncestorOfType(NestableType::Avatar)) { entity->getMaximumAACube(ancestryIsKnown);
bool hasAvatarAncestor = entity->hasAncestorOfType(NestableType::Avatar);
if (entity->isMovingRelativeToParent() && !entity->getPhysicsInfo() && ancestryIsKnown && !hasAvatarAncestor) {
entity->simulate(now); entity->simulate(now);
_entitiesToSort.insert(entity); _entitiesToSort.insert(entity);
++itemItr; ++itemItr;