mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 21:02:17 +02:00
better comments
This commit is contained in:
parent
c61a226bb5
commit
2be0f0fa22
2 changed files with 2 additions and 8 deletions
|
@ -67,7 +67,6 @@ EntityMotionState::EntityMotionState(btCollisionShape* shape, EntityItemPointer
|
|||
_accelerationNearlyGravityCount(0),
|
||||
_numInactiveUpdates(1)
|
||||
{
|
||||
// EntityMotionState keeps a SharedPointer to its EntityItem which is only set in the CTOR
|
||||
_type = MOTIONSTATE_TYPE_ENTITY;
|
||||
assert(_entity);
|
||||
assert(entityTreeIsLocked());
|
||||
|
@ -81,7 +80,6 @@ EntityMotionState::EntityMotionState(btCollisionShape* shape, EntityItemPointer
|
|||
|
||||
EntityMotionState::~EntityMotionState() {
|
||||
if (_entity) {
|
||||
// EntityMotionState keeps a SharedPointer to its EntityItem which is only cleared in the DTOR
|
||||
assert(_entity->getPhysicsInfo() == this);
|
||||
_entity->setPhysicsInfo(nullptr);
|
||||
_entity.reset();
|
||||
|
|
|
@ -99,12 +99,8 @@ protected:
|
|||
void setShape(const btCollisionShape* shape) override;
|
||||
void setMotionType(PhysicsMotionType motionType) override;
|
||||
|
||||
// In the glorious future (when entities lib depends on physics lib) the EntityMotionState will be
|
||||
// properly "owned" by the EntityItem and will be deleted by it in the dtor. In pursuit of that
|
||||
// state of affairs we can't keep a real EntityItemPointer as data member (it would produce a
|
||||
// recursive dependency). Instead we keep a EntityItemWeakPointer to break that dependency while
|
||||
// still granting us the capability to generate EntityItemPointers as necessary (for external data
|
||||
// structures that use the MotionState to get to the EntityItem).
|
||||
// EntityMotionState keeps a SharedPointer to its EntityItem which is only set in the CTOR
|
||||
// and is only cleared in the DTOR
|
||||
EntityItemPointer _entity;
|
||||
|
||||
bool _serverVariablesSet { false };
|
||||
|
|
Loading…
Reference in a new issue