- Timestamp:
- Nov 30, 2008, 12:36:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/LinearEntity.cc
r2292 r2300 45 45 RegisterObject(LinearEntity); 46 46 47 this->velocity_ = Vector3::ZERO;48 47 this->acceleration_ = Vector3::ZERO; 49 48 this->rotationAxis_ = Vector3::ZERO; … … 65 64 SUPER(LinearEntity, XMLPort, xmlelement, mode); 66 65 67 XMLPortParamTemplate(LinearEntity, "velocity", setVelocity, getVelocity, xmlelement, mode, const Vector3&);68 66 XMLPortParamTemplate(LinearEntity, "rotationaxis", setRotationAxis, getRotationAxis, xmlelement, mode, const Vector3&); 69 67 XMLPortParamTemplate(LinearEntity, "rotationrate", setRotationRate, getRotationRate, xmlelement, mode, const Degree&); … … 129 127 void LinearEntity::positionChanged() 130 128 { 131 this->overwrite_position_ = this-> node_->getPosition();129 this->overwrite_position_ = this->getPosition(); 132 130 } 133 131 134 132 void LinearEntity::orientationChanged() 135 133 { 136 this->overwrite_orientation_ = this->node_->getOrientation(); 137 } 138 139 void LinearEntity::setVelocity(const Vector3& velocity) 140 { 141 if (!this->isDynamic()) 142 { 143 // no physics, we do it ourselves 144 internalSetVelocity(velocity); 145 } 146 else 147 { 148 this->physicalBody_->setLinearVelocity(btVector3(velocity.x, velocity.y, velocity.z)); 149 } 134 this->overwrite_orientation_ = this->getOrientation(); 150 135 } 151 136 }
Note: See TracChangeset
for help on using the changeset viewer.