Changeset 2469 for code/branches/presentation/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc
- Timestamp:
- Dec 15, 2008, 7:57:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/objects/collisionshapes/CompoundCollisionShape.cc
r2463 r2469 47 47 48 48 this->compoundShape_ = new btCompoundShape(); 49 this->worldEntityParent_ = 0; 49 50 } 50 51 … … 66 67 } 67 68 69 void CompoundCollisionShape::setWorldEntityParent(WorldEntity* parent) 70 { 71 // suppress synchronisation 72 this->setObjectMode(0x0); 73 74 this->worldEntityParent_ = parent; 75 } 76 68 77 void CompoundCollisionShape::addChildShape(CollisionShape* shape) 69 78 { … … 87 96 88 97 // network synchro 89 shape->setParent(this, this->getObjectID()); 98 if (this->worldEntityParent_) 99 { 100 // This compound collision shape belongs to a WE and doesn't get synchronised 101 // So set our parent to be the WE 102 shape->setParent(this, this->worldEntityParent_->getObjectID()); 103 } 104 else 105 shape->setParent(this, this->getObjectID()); 90 106 } 91 107 … … 176 192 if (this->parent_) 177 193 this->parent_->updateChildShape(this); 178 else 179 { 180 // We can do this, because the CompoundCollisionShape of a WorldEntity always belongs to it, 181 // as long as its lifetime. 182 WorldEntity* parent = dynamic_cast<WorldEntity*>(this->getCreator()); 183 if (parent) 184 parent->notifyCollisionShapeChanged(); 185 } 194 else if (this->worldEntityParent_) 195 this->worldEntityParent_->notifyCollisionShapeChanged(); 186 196 } 187 197
Note: See TracChangeset
for help on using the changeset viewer.