mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 20:56:52 +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),
|
_accelerationNearlyGravityCount(0),
|
||||||
_numInactiveUpdates(1)
|
_numInactiveUpdates(1)
|
||||||
{
|
{
|
||||||
// EntityMotionState keeps a SharedPointer to its EntityItem which is only set in the CTOR
|
|
||||||
_type = MOTIONSTATE_TYPE_ENTITY;
|
_type = MOTIONSTATE_TYPE_ENTITY;
|
||||||
assert(_entity);
|
assert(_entity);
|
||||||
assert(entityTreeIsLocked());
|
assert(entityTreeIsLocked());
|
||||||
|
@ -81,7 +80,6 @@ EntityMotionState::EntityMotionState(btCollisionShape* shape, EntityItemPointer
|
||||||
|
|
||||||
EntityMotionState::~EntityMotionState() {
|
EntityMotionState::~EntityMotionState() {
|
||||||
if (_entity) {
|
if (_entity) {
|
||||||
// EntityMotionState keeps a SharedPointer to its EntityItem which is only cleared in the DTOR
|
|
||||||
assert(_entity->getPhysicsInfo() == this);
|
assert(_entity->getPhysicsInfo() == this);
|
||||||
_entity->setPhysicsInfo(nullptr);
|
_entity->setPhysicsInfo(nullptr);
|
||||||
_entity.reset();
|
_entity.reset();
|
||||||
|
|
|
@ -99,12 +99,8 @@ protected:
|
||||||
void setShape(const btCollisionShape* shape) override;
|
void setShape(const btCollisionShape* shape) override;
|
||||||
void setMotionType(PhysicsMotionType motionType) override;
|
void setMotionType(PhysicsMotionType motionType) override;
|
||||||
|
|
||||||
// In the glorious future (when entities lib depends on physics lib) the EntityMotionState will be
|
// EntityMotionState keeps a SharedPointer to its EntityItem which is only set in the CTOR
|
||||||
// properly "owned" by the EntityItem and will be deleted by it in the dtor. In pursuit of that
|
// and is only cleared in the DTOR
|
||||||
// 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).
|
|
||||||
EntityItemPointer _entity;
|
EntityItemPointer _entity;
|
||||||
|
|
||||||
bool _serverVariablesSet { false };
|
bool _serverVariablesSet { false };
|
||||||
|
|
Loading…
Reference in a new issue