mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 08:26:36 +02:00
update QueryAACube of kinematic things with known parentage
This commit is contained in:
parent
1119b9f29c
commit
54d3ceda28
1 changed files with 11 additions and 1 deletions
|
@ -242,11 +242,21 @@ void EntitySimulation::moveSimpleKinematics(uint64_t now) {
|
||||||
entity->getMaximumAACube(ancestryIsKnown);
|
entity->getMaximumAACube(ancestryIsKnown);
|
||||||
bool hasAvatarAncestor = entity->hasAncestorOfType(NestableType::Avatar);
|
bool hasAvatarAncestor = entity->hasAncestorOfType(NestableType::Avatar);
|
||||||
|
|
||||||
if (entity->isMovingRelativeToParent() && !entity->getPhysicsInfo() && ancestryIsKnown && !hasAvatarAncestor) {
|
bool isMoving = entity->isMovingRelativeToParent();
|
||||||
|
if (isMoving && !entity->getPhysicsInfo() && ancestryIsKnown && !hasAvatarAncestor) {
|
||||||
entity->simulate(now);
|
entity->simulate(now);
|
||||||
|
if (ancestryIsKnown && !hasAvatarAncestor) {
|
||||||
|
entity->updateQueryAACube();
|
||||||
|
}
|
||||||
_entitiesToSort.insert(entity);
|
_entitiesToSort.insert(entity);
|
||||||
++itemItr;
|
++itemItr;
|
||||||
} else {
|
} else {
|
||||||
|
if (!isMoving && ancestryIsKnown && !hasAvatarAncestor) {
|
||||||
|
// HACK: This catches most cases where the entity's QueryAACube (and spatial sorting in the EntityTree)
|
||||||
|
// would otherwise be out of date at conclusion of its "unowned" simpleKinematicMotion.
|
||||||
|
entity->updateQueryAACube();
|
||||||
|
_entitiesToSort.insert(entity);
|
||||||
|
}
|
||||||
// the entity is no longer non-physical-kinematic
|
// the entity is no longer non-physical-kinematic
|
||||||
itemItr = _simpleKinematicEntities.erase(itemItr);
|
itemItr = _simpleKinematicEntities.erase(itemItr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue