Changeset 2374 for code/branches/physics/src/orxonox/objects/worldentities/collisionshapes/SphereCollisionShape.cc
- Timestamp:
- Dec 10, 2008, 1:38:17 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/collisionshapes/SphereCollisionShape.cc
r2304 r2374 46 46 this->sphereShape_ = new btSphereShape(1.0f); 47 47 this->collisionShape_ = this->sphereShape_; 48 49 this->registerVariables(); 48 50 } 49 51 … … 52 54 if (this->isInitialized()) 53 55 delete this->collisionShape_; 56 } 57 58 void SphereCollisionShape::registerVariables() 59 { 60 REGISTERDATA(this->radius_, network::direction::toclient, new network::NetworkCallback<SphereCollisionShape>(this, &SphereCollisionShape::radiusChanged)); 54 61 } 55 62 … … 61 68 } 62 69 63 btVector3 SphereCollisionShape::getTotalScaling()70 void SphereCollisionShape::setRadius(float radius) 64 71 { 65 return omni_cast<btVector3>(this->node_->getScale()) * this->radius_; 72 // TODO: Think about where this could be referenced already. 73 this->radius_ = radius; 74 delete this->sphereShape_; 75 this->sphereShape_ = new btSphereShape(radius); 66 76 } 67 77 }
Note: See TracChangeset
for help on using the changeset viewer.