mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 01:36:56 +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 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);
|
||||||
|
|
|
@ -244,6 +244,15 @@ void ObjectAction::activateBody() {
|
||||||
if (rigidBody) {
|
if (rigidBody) {
|
||||||
rigidBody->activate();
|
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() {
|
bool ObjectAction::lifetimeIsOver() {
|
||||||
|
|
Loading…
Reference in a new issue