mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 04:07:11 +02:00
activate body before disconnecting action from entity
This commit is contained in:
parent
5d3502ed88
commit
bc57003cfb
3 changed files with 8 additions and 2 deletions
|
@ -159,6 +159,13 @@ void ObjectDynamic::removeFromSimulation(EntitySimulationPointer simulation) con
|
|||
simulation->removeDynamic(myID);
|
||||
}
|
||||
|
||||
void ObjectDynamic::setOwnerEntity(const EntityItemPointer ownerEntity) {
|
||||
if (!ownerEntity) {
|
||||
activateBody();
|
||||
}
|
||||
_ownerEntity = ownerEntity;
|
||||
}
|
||||
|
||||
EntityItemPointer ObjectDynamic::getEntityByID(EntityItemID entityID) const {
|
||||
EntityItemPointer ownerEntity;
|
||||
withReadLock([&]{
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
|
||||
virtual void removeFromSimulation(EntitySimulationPointer simulation) const override;
|
||||
virtual EntityItemWeakPointer getOwnerEntity() const override { return _ownerEntity; }
|
||||
virtual void setOwnerEntity(const EntityItemPointer ownerEntity) override { _ownerEntity = ownerEntity; }
|
||||
virtual void setOwnerEntity(const EntityItemPointer ownerEntity) override;
|
||||
|
||||
virtual void invalidate() {};
|
||||
|
||||
|
|
|
@ -776,7 +776,6 @@ void PhysicsEngine::removeDynamic(const QUuid dynamicID) {
|
|||
_objectDynamics.remove(dynamicID);
|
||||
foreach(btRigidBody* rigidBody, rigidBodies) {
|
||||
_objectDynamicsByBody[rigidBody].remove(dynamic->getID());
|
||||
rigidBody->activate();
|
||||
}
|
||||
dynamic->invalidate();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue