mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 14:37:46 +02:00
Merge pull request #6463 from sethalves/fix-observers-dont-see-equip-motion
fix bug where observers don't see a held/equipped object moving
This commit is contained in:
commit
865729ef26
4 changed files with 16 additions and 0 deletions
|
@ -327,4 +327,6 @@ void AvatarActionHold::deserialize(QByteArray serializedArguments) {
|
||||||
|
|
||||||
_active = true;
|
_active = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
forceBodyNonStatic();
|
||||||
}
|
}
|
||||||
|
|
|
@ -398,6 +398,7 @@ public:
|
||||||
void getAllTerseUpdateProperties(EntityItemProperties& properties) const;
|
void getAllTerseUpdateProperties(EntityItemProperties& properties) const;
|
||||||
|
|
||||||
void flagForOwnership() { _dirtyFlags |= Simulation::DIRTY_SIMULATOR_OWNERSHIP; }
|
void flagForOwnership() { _dirtyFlags |= Simulation::DIRTY_SIMULATOR_OWNERSHIP; }
|
||||||
|
void flagForMotionStateChange() { _dirtyFlags |= Simulation::DIRTY_MOTION_TYPE; }
|
||||||
|
|
||||||
bool addAction(EntitySimulation* simulation, EntityActionPointer action);
|
bool addAction(EntitySimulation* simulation, EntityActionPointer action);
|
||||||
bool updateAction(EntitySimulation* simulation, const QUuid& actionID, const QVariantMap& arguments);
|
bool updateAction(EntitySimulation* simulation, const QUuid& actionID, const QVariantMap& arguments);
|
||||||
|
|
|
@ -246,6 +246,18 @@ void ObjectAction::activateBody() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectAction::forceBodyNonStatic() {
|
||||||
|
auto ownerEntity = _ownerEntity.lock();
|
||||||
|
if (!ownerEntity) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
void* physicsInfo = ownerEntity->getPhysicsInfo();
|
||||||
|
ObjectMotionState* motionState = static_cast<ObjectMotionState*>(physicsInfo);
|
||||||
|
if (motionState && motionState->getMotionType() == MOTION_TYPE_STATIC) {
|
||||||
|
ownerEntity->flagForMotionStateChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool ObjectAction::lifetimeIsOver() {
|
bool ObjectAction::lifetimeIsOver() {
|
||||||
if (_expires == 0) {
|
if (_expires == 0) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -63,6 +63,7 @@ protected:
|
||||||
virtual glm::vec3 getAngularVelocity();
|
virtual glm::vec3 getAngularVelocity();
|
||||||
virtual void setAngularVelocity(glm::vec3 angularVelocity);
|
virtual void setAngularVelocity(glm::vec3 angularVelocity);
|
||||||
virtual void activateBody();
|
virtual void activateBody();
|
||||||
|
virtual void forceBodyNonStatic();
|
||||||
|
|
||||||
EntityItemWeakPointer _ownerEntity;
|
EntityItemWeakPointer _ownerEntity;
|
||||||
QString _tag;
|
QString _tag;
|
||||||
|
|
Loading…
Reference in a new issue