Changeset 10189 for code/trunk/src/modules/objects/collisionshapes/AbstractRadiusHeightCollisionShape.cc
- Timestamp:
- Jan 11, 2015, 3:40:41 PM (9 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/objects/collisionshapes/AbstractRadiusHeightCollisionShape.cc
r10184 r10189 23 23 * Reto Grieder 24 24 * Co-authors: 25 * ...25 * Fabian 'x3n' Landau 26 26 * 27 27 */ 28 28 29 29 /** 30 @file ConeCollisionShape.cc31 @brief Implementation of the ConeCollisionShape class.30 @file AbstractRadiusHeightCollisionShape.cc 31 @brief Implementation of the AbstractRadiusHeightCollisionShape class. 32 32 */ 33 33 34 #include "ConeCollisionShape.h" 35 36 #include <BulletCollision/CollisionShapes/btConeShape.h> 34 #include "AbstractRadiusHeightCollisionShape.h" 37 35 38 36 #include "core/CoreIncludes.h" … … 42 40 namespace orxonox 43 41 { 44 Register Class(ConeCollisionShape);42 RegisterAbstractClass(AbstractRadiusHeightCollisionShape).inheritsFrom(Class(CollisionShape)); 45 43 46 44 /** … … 48 46 Constructor. Registers and initializes the object. 49 47 */ 50 ConeCollisionShape::ConeCollisionShape(Context* context) : CollisionShape(context)48 AbstractRadiusHeightCollisionShape::AbstractRadiusHeightCollisionShape(Context* context) : CollisionShape(context) 51 49 { 52 RegisterObject( ConeCollisionShape);50 RegisterObject(AbstractRadiusHeightCollisionShape); 53 51 54 52 this->radius_ = 1.0f; 55 53 this->height_ = 1.0f; 56 updateShape();57 54 58 55 this->registerVariables(); 59 56 } 60 57 61 ConeCollisionShape::~ConeCollisionShape() 62 { 63 if (this->isInitialized()) 64 delete this->collisionShape_; 65 } 66 67 void ConeCollisionShape::registerVariables() 58 void AbstractRadiusHeightCollisionShape::registerVariables() 68 59 { 69 60 registerVariable(this->radius_, VariableDirection::ToClient, new NetworkCallback<CollisionShape>(this, &CollisionShape::updateShape)); … … 71 62 } 72 63 73 void ConeCollisionShape::XMLPort(Element& xmlelement, XMLPort::Mode mode)64 void AbstractRadiusHeightCollisionShape::XMLPort(Element& xmlelement, XMLPort::Mode mode) 74 65 { 75 SUPER( ConeCollisionShape, XMLPort, xmlelement, mode);66 SUPER(AbstractRadiusHeightCollisionShape, XMLPort, xmlelement, mode); 76 67 77 XMLPortParam( ConeCollisionShape, "radius", setRadius, getRadius, xmlelement, mode);78 XMLPortParam( ConeCollisionShape, "height", setHeight, getHeight, xmlelement, mode);68 XMLPortParam(AbstractRadiusHeightCollisionShape, "radius", setRadius, getRadius, xmlelement, mode); 69 XMLPortParam(AbstractRadiusHeightCollisionShape, "height", setHeight, getHeight, xmlelement, mode); 79 70 } 80 71 81 72 /** 82 73 @brief 83 Is called when the scale of the ConeCollisionShape has changed.74 Is called when the scale of the AbstractRadiusHeightCollisionShape has changed. 84 75 */ 85 void ConeCollisionShape::changedScale()76 void AbstractRadiusHeightCollisionShape::changedScale() 86 77 { 87 78 CollisionShape::changedScale(); … … 92 83 if(!this->hasUniformScaling()) 93 84 { 94 orxout(internal_error) << " ConeCollisionShape: Non-uniform scaling is not yet supported." << endl;85 orxout(internal_error) << "AbstractRadiusHeightCollisionShape: Non-uniform scaling is not yet supported." << endl; 95 86 return; 96 87 } … … 100 91 this->updateShape(); 101 92 } 102 103 /**104 @brief105 Creates a new internal collision shape for the ConeCollisionShape.106 @return107 Returns a pointer to the newly created btConeShape.108 */109 btCollisionShape* ConeCollisionShape::createNewShape() const110 {111 return new btConeShape(this->radius_, this->height_);112 }113 93 }
Note: See TracChangeset
for help on using the changeset viewer.