Changeset 10624 for code/trunk/src/orxonox/collisionshapes
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/orxonox/collisionshapes/CollisionShape.cc
r10216 r10624 41 41 #include "CompoundCollisionShape.h" 42 42 #include "WorldEntityCollisionShape.h" 43 #include "Scene.h" 43 44 44 45 namespace orxonox 45 46 { 46 RegisterAbstractClass(CollisionShape).inheritsFrom (Class(BaseObject)).inheritsFrom(Class(Synchronisable));47 RegisterAbstractClass(CollisionShape).inheritsFrom<BaseObject>().inheritsFrom<Synchronisable>(); 47 48 48 49 /** … … 74 75 { 75 76 // Detach from parent CompoundCollisionShape. 76 if (this->isInitialized() && this->parent_) 77 this->parent_->detach(this); 77 if (this->isInitialized()) 78 { 79 if (this->getScene() && this->getScene()->isUpdatingPhysics()) 80 orxout(internal_error) << "Don't destroy collision shapes while the physics is updated! This will lead to crashes. Try to use destroyLater() instead" << endl; 81 82 if (this->parent_) 83 this->parent_->detach(this); 84 85 if (this->collisionShape_) 86 delete this->collisionShape_; 87 } 78 88 } 79 89 -
code/trunk/src/orxonox/collisionshapes/CompoundCollisionShape.cc
r9667 r10624 71 71 it->first->notifyDetached(); 72 72 it->first->destroy(); 73 if (this->collisionShape_ == it->second) 74 this->collisionShape_ = NULL; // don't destroy it twice 73 75 } 74 76 75 77 delete this->compoundShape_; 78 if (this->collisionShape_ == this->compoundShape_) 79 this->collisionShape_ = NULL; // don't destroy it twice 76 80 } 77 81 } -
code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.cc
r9667 r10624 37 37 namespace orxonox 38 38 { 39 RegisterClass(WorldEntityCollisionShape); 40 39 41 WorldEntityCollisionShape::WorldEntityCollisionShape(Context* context) : CompoundCollisionShape(context) 40 42 { … … 44 46 // suppress synchronisation 45 47 this->setSyncMode(ObjectDirection::None); 46 }47 48 WorldEntityCollisionShape::~WorldEntityCollisionShape()49 {50 // Called always by WE destructor51 48 } 52 49 -
code/trunk/src/orxonox/collisionshapes/WorldEntityCollisionShape.h
r9667 r10624 39 39 public: 40 40 WorldEntityCollisionShape(Context* context); 41 virtual ~WorldEntityCollisionShape();42 41 43 42 inline void setWorldEntityOwner(WorldEntity* worldEntityOwner)
Note: See TracChangeset
for help on using the changeset viewer.