Changeset 8588 for code/branches/bigships/src/orxonox/items/Engine.cc
- Timestamp:
- May 26, 2011, 12:04:42 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/bigships/src/orxonox/items/Engine.cc
r8426 r8588 47 47 this->ship_ = 0; 48 48 this->shipID_ = OBJECTID_UNKNOWN; 49 49 this->relativePosition_ = Vector3(0,0,0); 50 50 51 51 this->boostFactor_ = 1.5; … … 72 72 Engine::~Engine() 73 73 { 74 if (this->isInitialized() && this->ship_) 75 { 76 //this->ship_->setEngine(0); 77 78 //if (this->boostBlur_) 79 // this->boostBlur_->destroy(); 80 } 74 81 75 } 82 76 … … 98 92 XMLPortParam(Engine, "accelerationupdown", setAccelerationUpDown, setAccelerationUpDown, xmlelement, mode); 99 93 100 101 94 XMLPortParam(Engine, "position", setRelativePosition, getRelativePosition, xmlelement, mode); 95 XMLPortParam(Engine, "template", setEngineTemplate, getEngineTemplate, xmlelement, mode); 102 96 } 103 97 … … 199 193 } 200 194 201 195 // NOTE: Bullet always uses global coordinates. 202 196 this->ship_->addAcceleration(this->ship_->getOrientation() * (acceleration*this->getSpeedMultiply()+Vector3(0,0,-this->getSpeedAdd())), this->ship_->getOrientation() * this->relativePosition_); 203 197 204 205 // Hack to reset a temporary variable "direction" 206 this->ship_->oneEngineTickDone(); 207 if(!this->ship_->hasEngineTicksRemaining()) 208 { 209 this->ship_->setSteeringDirection(Vector3::ZERO); 210 this->ship_->resetEngineTicks(); 211 } 198 // Hack to reset a temporary variable "direction" 199 this->ship_->oneEngineTickDone(); 200 if(!this->ship_->hasEngineTicksRemaining()) 201 { 202 this->ship_->setSteeringDirection(Vector3::ZERO); 203 this->ship_->resetEngineTicks(); 204 } 212 205 } 213 206 … … 247 240 } 248 241 249 250 251 252 253 254 255 256 257 258 259 260 242 void Engine::loadEngineTemplate() 243 { 244 if(!this->engineTemplate_.empty()) 245 { 246 COUT(4)<<"Loading an engine template: "<<this->engineTemplate_<<"\n"; 247 Template *temp = Template::getTemplate(this->engineTemplate_); 248 if(temp) 249 { 250 this->addTemplate(temp); 251 } 252 } 253 } 261 254 }
Note: See TracChangeset
for help on using the changeset viewer.