mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 20:15:15 +02:00
Merge pull request #16208 from AndrewMeadows/ess-with-simulation-fallout-002
BUGZ-1487: bug fix for inability to pick entities after unowned kinematic motion
This commit is contained in:
commit
e801eab7bf
3 changed files with 19 additions and 1 deletions
|
@ -242,11 +242,21 @@ void EntitySimulation::moveSimpleKinematics(uint64_t now) {
|
|||
entity->getMaximumAACube(ancestryIsKnown);
|
||||
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);
|
||||
if (ancestryIsKnown && !hasAvatarAncestor) {
|
||||
entity->updateQueryAACube();
|
||||
}
|
||||
_entitiesToSort.insert(entity);
|
||||
++itemItr;
|
||||
} 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
|
||||
itemItr = _simpleKinematicEntities.erase(itemItr);
|
||||
}
|
||||
|
|
|
@ -122,6 +122,12 @@ void EntityMotionState::handleDeactivation() {
|
|||
_body->setWorldTransform(worldTrans);
|
||||
// no need to update velocities... should already be zero
|
||||
}
|
||||
if (!isLocallyOwned()) {
|
||||
// HACK: To allow the ESS to move entities around in a kinematic way we had to remove the requirement that
|
||||
// every moving+simulated entity has an authoritative simulation owner. As a result, we cannot rely
|
||||
// on a simulation owner to update the QueryAACube on the entity-server.
|
||||
_entity->updateQueryAACube();
|
||||
}
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
|
@ -528,6 +528,8 @@ void PhysicalEntitySimulation::handleChangedMotionStates(const VectorOfMotionSta
|
|||
addOwnership(entityState);
|
||||
} else if (entityState->shouldSendBid()) {
|
||||
addOwnershipBid(entityState);
|
||||
} else {
|
||||
entityState->getEntity()->updateQueryAACube();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue