mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
if an entity with an action has a motion-type of static, flag it so it gets updated in bullet
This commit is contained in:
parent
eecb5b91b2
commit
6f19093cb9
2 changed files with 10 additions and 0 deletions
|
@ -398,6 +398,7 @@ public:
|
|||
void getAllTerseUpdateProperties(EntityItemProperties& properties) const;
|
||||
|
||||
void flagForOwnership() { _dirtyFlags |= Simulation::DIRTY_SIMULATOR_OWNERSHIP; }
|
||||
void flagForMotionStateChange() { _dirtyFlags |= Simulation::DIRTY_MOTION_TYPE; }
|
||||
|
||||
bool addAction(EntitySimulation* simulation, EntityActionPointer action);
|
||||
bool updateAction(EntitySimulation* simulation, const QUuid& actionID, const QVariantMap& arguments);
|
||||
|
|
|
@ -244,6 +244,15 @@ void ObjectAction::activateBody() {
|
|||
if (rigidBody) {
|
||||
rigidBody->activate();
|
||||
}
|
||||
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() {
|
||||
|
|
Loading…
Reference in a new issue