Merge pull request #13215 from AndrewMeadows/activate-on-action-removal

activate RigidBody when removing physics Action
This commit is contained in:
John Conklin II 2018-05-31 11:20:03 -07:00 committed by GitHub
commit 4175825093
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -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([&]{

View file

@ -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() {};