Moved MotionState deletes out of PhysicsEngine. EntityMotionStates are deleted by the PhysicsEntitySimulation. AvatarMotionStates are deleted in the Avatar dtor.
Showing the changes to libraries/physics/src/ObjectMotionState.cpp (1 of 25 files). Show all
Unified · Split
| @@ -71,9 +71,9 @@ ObjectMotionState::ObjectMotionState(btCollisionShape* shape) : · 70 unmodified lines | ||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | ObjectMotionState::~ObjectMotionState() { |
| 74 | − // adebug TODO: move shape release out of PhysicsEngine and into into the ObjectMotionState dtor | |
| 75 | 74 | assert(!_body); |
| 76 | − assert(!_shape); | |
| 75 | + releaseShape(); | |
| 76 | + _type = MOTIONSTATE_TYPE_INVALID; | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | void ObjectMotionState::setBodyLinearVelocity(const glm::vec3& velocity) const { |