Changeset 8554 for code/branches/pickup/src/orxonox
- Timestamp:
- May 23, 2011, 11:26:08 PM (13 years ago)
- Location:
- code/branches/pickup/src/orxonox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup/src/orxonox/collisionshapes/CompoundCollisionShape.cc
r8422 r8554 261 261 CollisionShape::changedScale(); 262 262 263 // Iterate through all attached CollisionShapes. 263 std::vector<CollisionShape*> shapes; 264 // Iterate through all attached CollisionShapes and add them to the list of shapes. 265 for(std::map<CollisionShape*, btCollisionShape*>::iterator it = this->attachedShapes_.begin(); it != this->attachedShapes_.end(); it++) 266 shapes.push_back(it->first); 267 268 // Delete the compound shape and create a new one. 269 delete this->compoundShape_; 270 this->compoundShape_ = new btCompoundShape(); 271 272 // Re-attach all CollisionShapes. 273 for(std::vector<CollisionShape*>::iterator it = shapes.begin(); it != shapes.end(); it++) 274 { 275 CollisionShape* shape = *it; 276 shape->setScale3D(this->getScale3D()); 277 // Only actually attach if we didn't pick a CompoundCollisionShape with no content. 278 if (shape->getCollisionShape()) 279 { 280 btTransform transf(multi_cast<btQuaternion>(shape->getOrientation()), multi_cast<btVector3>(shape->getPosition())); 281 // Add the btCollisionShape of the CollisionShape as a child shape to the btCompoundShape of the CompoundCollisionShape. 282 this->compoundShape_->addChildShape(transf, shape->getCollisionShape()); 283 } 284 } 285 286 this->updatePublicShape(); 287 288 /* 289 // Iterate through all attached CollisionShapes 264 290 for(std::map<CollisionShape*, btCollisionShape*>::const_iterator it = this->attachedShapes_.begin(); it != this->attachedShapes_.end(); it++) 265 291 { … … 269 295 } 270 296 271 this->updatePublicShape(); 297 this->updatePublicShape();*/ 272 298 } 273 299 } -
code/branches/pickup/src/orxonox/collisionshapes/CompoundCollisionShape.h
r8422 r8554 52 52 Reto Grieder 53 53 54 @see btCompoundShape 54 55 @ingroup Collisionshapes 55 56 */ -
code/branches/pickup/src/orxonox/worldentities/WorldEntity.cc
r8422 r8554 643 643 { 644 644 // If physics is enabled scale the attached CollisionShape. 645 if (false &&this->hasPhysics() && this->collisionShape_ != NULL)645 /*if (this->hasPhysics() && this->collisionShape_ != NULL) 646 646 { 647 647 this->collisionShape_->setScale3D(scale); 648 } 648 }*/ 649 649 650 650 this->node_->setScale(scale);
Note: See TracChangeset
for help on using the changeset viewer.