- Timestamp:
- Nov 28, 2008, 1:25:16 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/orxonox/objects/worldentities/pawns/SpaceShip.cc
r2087 r2292 30 30 #include "SpaceShip.h" 31 31 32 #include "util/Math.h" 33 #include "util/Exception.h" 32 34 #include "core/CoreIncludes.h" 33 35 #include "core/ConfigValueIncludes.h" 34 36 #include "core/XMLPort.h" 35 #include "util/Math.h"36 37 37 38 namespace orxonox … … 59 60 60 61 this->setDestroyWhenPlayerLeft(true); 62 63 // create a phyisical body 64 OrxAssert(this->physicalBody_ == 0, " Check why there is already a physical body in the space ship."); 65 this->createPhysicalBody(); 61 66 62 67 this->setConfigValues(); … … 165 170 void SpaceShip::moveFrontBack(const Vector2& value) 166 171 { 167 this->acceleration_.z = -this->translationAcceleration_ * value.x; 172 assert(this->physicalBody_); 173 this->physicalBody_->applyCentralForce(btVector3(0.0f, 0.0f, -1.0f/this->physicalBody_->getInvMass() * value.x)); 174 // this->acceleration_.z = -this->translationAcceleration_ * value.x; 168 175 } 169 176 170 177 void SpaceShip::moveRightLeft(const Vector2& value) 171 178 { 172 this->acceleration_.x = this->translationAcceleration_ * value.x; 179 this->physicalBody_->applyCentralForce(btVector3(1.0f/this->physicalBody_->getInvMass() * value.x, 0.0f, 0.0f)); 180 // this->acceleration_.x = this->translationAcceleration_ * value.x; 173 181 } 174 182 175 183 void SpaceShip::moveUpDown(const Vector2& value) 176 184 { 177 this->acceleration_.y = this->translationAcceleration_ * value.x; 185 this->physicalBody_->applyCentralForce(btVector3(0.0f, 1.0f/this->physicalBody_->getInvMass() * value.x, 0.0f)); 186 // this->acceleration_.y = this->translationAcceleration_ * value.x; 178 187 } 179 188
Note: See TracChangeset
for help on using the changeset viewer.