- Timestamp:
- Dec 13, 2008, 4:14:36 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/collisionshapes/CollisionShape.cc
r2403 r2423 76 76 void CollisionShape::registerVariables() 77 77 { 78 REGISTERDATA(this->parentID_, network::direction::toclient, new network::NetworkCallback<CollisionShape>(this, &CollisionShape::updateParent)); 78 REGISTERDATA(this->parentID_, network::direction::toclient, new network::NetworkCallback<CollisionShape>(this, &CollisionShape::parentChanged)); 79 } 80 81 void CollisionShape::parentChanged() 82 { 83 CompoundCollisionShape* parent = dynamic_cast<CompoundCollisionShape*>(Synchronisable::getSynchronisable(this->parentID_)); 84 if (parent) 85 parent->addChildShape(this); 79 86 } 80 87 81 88 void CollisionShape::updateParent() 82 89 { 83 CompoundCollisionShape* parent = dynamic_cast<CompoundCollisionShape*>(Synchronisable::getSynchronisable(this->parentID_)); 84 if (parent) 85 parent->addChildShape(this); 90 if (this->parent_) 91 this->parent_->updateChildShape(this); 86 92 } 87 93 … … 95 101 { 96 102 ThrowException(NotImplemented, "Cannot set the scale of a collision shape: Not yet implemented."); 103 this->updateParent(); 97 104 } 98 105 … … 100 107 { 101 108 ThrowException(NotImplemented, "Cannot set the scale of a collision shape: Not yet implemented."); 109 this->updateParent(); 110 } 111 112 btVector3 CollisionShape::getLocalInertia(btScalar mass) const 113 { 114 btVector3 inertia(0, 0, 0); 115 if (this->collisionShape_) 116 this->collisionShape_->calculateLocalInertia(mass, inertia); 117 return inertia; 102 118 } 103 119 }
Note: See TracChangeset
for help on using the changeset viewer.