[608] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * |
---|
| 4 | * |
---|
| 5 | * License notice: |
---|
| 6 | * |
---|
| 7 | * This program is free software; you can redistribute it and/or |
---|
| 8 | * modify it under the terms of the GNU General Public License |
---|
| 9 | * as published by the Free Software Foundation; either version 2 |
---|
| 10 | * of the License, or (at your option) any later version. |
---|
| 11 | * |
---|
| 12 | * This program is distributed in the hope that it will be useful, |
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 15 | * GNU General Public License for more details. |
---|
| 16 | * |
---|
| 17 | * You should have received a copy of the GNU General Public License |
---|
| 18 | * along with this program; if not, write to the Free Software |
---|
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 20 | * |
---|
| 21 | * Author: |
---|
| 22 | * ... |
---|
| 23 | * Co-authors: |
---|
| 24 | * ... |
---|
| 25 | * |
---|
| 26 | */ |
---|
| 27 | |
---|
| 28 | #include "SpaceShip.h" |
---|
| 29 | |
---|
| 30 | #include "../../tinyxml/tinyxml.h" |
---|
| 31 | #include "../../misc/String2Number.h" |
---|
| 32 | #include "../core/CoreIncludes.h" |
---|
[614] | 33 | #include "../Orxonox.h" |
---|
[608] | 34 | |
---|
| 35 | #include "OgreCamera.h" |
---|
| 36 | #include <OgreRenderWindow.h> |
---|
| 37 | |
---|
| 38 | namespace orxonox |
---|
| 39 | { |
---|
| 40 | CreateFactory(SpaceShip); |
---|
| 41 | |
---|
| 42 | SpaceShip::SpaceShip() |
---|
| 43 | { |
---|
| 44 | RegisterObject(SpaceShip); |
---|
| 45 | |
---|
| 46 | SetConfigValue(bInvertMouse_, true); |
---|
| 47 | |
---|
| 48 | this->setMouseEventCallback_ = false; |
---|
| 49 | |
---|
[633] | 50 | this->tt_ = 0; |
---|
| 51 | this->redNode_ = 0; |
---|
| 52 | this->greenNode_ = 0; |
---|
| 53 | this->blinkTime_ = 0; |
---|
[623] | 54 | |
---|
[608] | 55 | this->moveForward_ = 0; |
---|
| 56 | this->rotateUp_ = 0; |
---|
| 57 | this->rotateDown_ = 0; |
---|
| 58 | this->rotateRight_ = 0; |
---|
| 59 | this->rotateLeft_ = 0; |
---|
| 60 | this->loopRight_ = 0; |
---|
| 61 | this->loopLeft_ = 0; |
---|
| 62 | this->brakeForward_ = 0; |
---|
| 63 | this->brakeRotate_ = 0; |
---|
| 64 | this->brakeLoop_ = 0; |
---|
| 65 | this->speedForward_ = 0; |
---|
| 66 | this->speedRotateUpDown_ = 0; |
---|
| 67 | this->speedRotateRightLeft_ = 0; |
---|
| 68 | this->speedLoopRightLeft_ = 0; |
---|
| 69 | this->maxSpeedForward_ = 0; |
---|
| 70 | this->maxSpeedRotateUpDown_ = 0; |
---|
| 71 | this->maxSpeedRotateRightLeft_ = 0; |
---|
| 72 | this->maxSpeedLoopRightLeft_ = 0; |
---|
| 73 | this->accelerationForward_ = 0; |
---|
| 74 | this->accelerationRotateUpDown_ = 0; |
---|
| 75 | this->accelerationRotateRightLeft_ = 0; |
---|
| 76 | this->accelerationLoopRightLeft_ = 0; |
---|
| 77 | |
---|
| 78 | this->speed = 250; |
---|
| 79 | this->loop = 100; |
---|
| 80 | this->rotate = 10; |
---|
| 81 | this->mouseX = 0; |
---|
| 82 | this->mouseY = 0; |
---|
| 83 | this->maxMouseX = 0; |
---|
| 84 | this->minMouseX = 0; |
---|
| 85 | this->moved = false; |
---|
| 86 | |
---|
| 87 | this->brakeRotate(rotate*10); |
---|
| 88 | this->brakeLoop(loop); |
---|
| 89 | |
---|
| 90 | COUT(3) << "Info: SpaceShip was loaded" << std::endl; |
---|
| 91 | } |
---|
| 92 | |
---|
| 93 | SpaceShip::~SpaceShip() |
---|
| 94 | { |
---|
[633] | 95 | if (tt_) |
---|
| 96 | delete tt_; |
---|
[608] | 97 | } |
---|
| 98 | |
---|
| 99 | void SpaceShip::setMaxSpeedValues(float maxSpeedForward, float maxSpeedRotateUpDown, float maxSpeedRotateRightLeft, float maxSpeedLoopRightLeft) |
---|
| 100 | { |
---|
| 101 | this->maxSpeedForward_ = maxSpeedForward; |
---|
| 102 | this->maxSpeedRotateUpDown_ = maxSpeedRotateUpDown; |
---|
| 103 | this->maxSpeedRotateRightLeft_ = maxSpeedRotateRightLeft; |
---|
| 104 | this->maxSpeedLoopRightLeft_ = maxSpeedLoopRightLeft; |
---|
| 105 | } |
---|
| 106 | |
---|
| 107 | void SpaceShip::loadParams(TiXmlElement* xmlElem) |
---|
| 108 | { |
---|
| 109 | Model::loadParams(xmlElem); |
---|
| 110 | |
---|
[633] | 111 | |
---|
| 112 | // START CREATING THRUSTER |
---|
| 113 | tt_ = new particle::ParticleInterface(Orxonox::getSingleton()->getSceneManager(),"twinthruster" + this->getName(),"Orxonox/engineglow"); |
---|
| 114 | tt_->getParticleSystem()->setParameter("local_space","true"); |
---|
| 115 | tt_->newEmitter(); |
---|
[608] | 116 | /* |
---|
[633] | 117 | tt_->setDirection(Vector3(0,0,1)); |
---|
| 118 | tt_->setPositionOfEmitter(0, Vector3(20,-1,-15)); |
---|
| 119 | tt_->setPositionOfEmitter(1, Vector3(-20,-1,-15)); |
---|
[608] | 120 | */ |
---|
[633] | 121 | tt_->setDirection(Vector3(-1,0,0)); |
---|
| 122 | tt_->setPositionOfEmitter(0, Vector3(-15,20,-1)); |
---|
| 123 | tt_->setPositionOfEmitter(1, Vector3(-15,-20,-1)); |
---|
| 124 | tt_->setVelocity(50); |
---|
[608] | 125 | |
---|
[633] | 126 | emitterRate_ = tt_->getRate(); |
---|
[626] | 127 | |
---|
[633] | 128 | Ogre::SceneNode* node2 = this->getNode()->createChildSceneNode(this->getName() + "particle2"); |
---|
| 129 | node2->setInheritScale(false); |
---|
| 130 | tt_->addToSceneNode(node2); |
---|
| 131 | // END CREATING THRUSTER |
---|
[608] | 132 | |
---|
[633] | 133 | // START CREATING BLINKING LIGHTS |
---|
| 134 | this->redBillboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1); |
---|
| 135 | this->greenBillboard_.setBillboardSet("Examples/Flare", ColourValue(0.0, 1.0, 0.0), 1); |
---|
[608] | 136 | |
---|
[633] | 137 | this->redNode_ = this->getNode()->createChildSceneNode(this->getName() + "red", Vector3(0.1, 4.6, -0.3)); |
---|
| 138 | this->redNode_->setInheritScale(false); |
---|
| 139 | this->greenNode_ = this->getNode()->createChildSceneNode(this->getName() + "green", Vector3(0.1, -4.6, -0.3)); |
---|
| 140 | this->greenNode_->setInheritScale(false); |
---|
[608] | 141 | |
---|
[633] | 142 | this->redNode_->attachObject(this->redBillboard_.getBillboardSet()); |
---|
| 143 | this->redNode_->setScale(0.3, 0.3, 0.3); |
---|
[608] | 144 | |
---|
[633] | 145 | this->greenNode_->attachObject(this->greenBillboard_.getBillboardSet()); |
---|
| 146 | this->greenNode_->setScale(0.3, 0.3, 0.3); |
---|
| 147 | // END CREATING BLINKING LIGHTS |
---|
[608] | 148 | |
---|
| 149 | |
---|
| 150 | if (xmlElem->Attribute("forward") && xmlElem->Attribute("rotateupdown") && xmlElem->Attribute("rotaterightleft") && xmlElem->Attribute("looprightleft")) |
---|
| 151 | { |
---|
| 152 | std::string forwardStr = xmlElem->Attribute("forward"); |
---|
| 153 | std::string rotateupdownStr = xmlElem->Attribute("rotateupdown"); |
---|
| 154 | std::string rotaterightleftStr = xmlElem->Attribute("rotaterightleft"); |
---|
| 155 | std::string looprightleftStr = xmlElem->Attribute("looprightleft"); |
---|
| 156 | |
---|
| 157 | String2Number<float>(this->maxSpeedForward_, forwardStr); |
---|
| 158 | String2Number<float>(this->maxSpeedRotateUpDown_, rotateupdownStr); |
---|
| 159 | String2Number<float>(this->maxSpeedRotateRightLeft_, rotaterightleftStr); |
---|
| 160 | String2Number<float>(this->maxSpeedLoopRightLeft_, looprightleftStr); |
---|
| 161 | |
---|
| 162 | COUT(4) << "Loader: Initialized spaceship steering with values " << maxSpeedForward_ << " " << maxSpeedRotateUpDown_ << " " << maxSpeedRotateRightLeft_ << " " << maxSpeedLoopRightLeft_ << " " << std::endl; |
---|
| 163 | } |
---|
| 164 | |
---|
| 165 | if (xmlElem->Attribute("camera")) |
---|
| 166 | { |
---|
| 167 | Ogre::Camera *cam = Orxonox::getSingleton()->getSceneManager()->createCamera("ShipCam"); |
---|
| 168 | Ogre::SceneNode *node = this->getNode()->createChildSceneNode("CamNode"); |
---|
| 169 | /* |
---|
| 170 | // node->setInheritOrientation(false); |
---|
| 171 | cam->setPosition(Vector3(0,50,-150)); |
---|
| 172 | cam->lookAt(Vector3(0,20,0)); |
---|
| 173 | cam->roll(Degree(0)); |
---|
| 174 | */ |
---|
| 175 | |
---|
| 176 | cam->setPosition(Vector3(-150,0,50)); |
---|
| 177 | // cam->setPosition(Vector3(0,-350,0)); |
---|
| 178 | cam->lookAt(Vector3(0,0,20)); |
---|
| 179 | cam->roll(Degree(-90)); |
---|
| 180 | |
---|
| 181 | node->attachObject(cam); |
---|
| 182 | Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam); |
---|
| 183 | } |
---|
| 184 | } |
---|
| 185 | |
---|
| 186 | bool SpaceShip::mouseMoved(const OIS::MouseEvent &e) |
---|
| 187 | { |
---|
| 188 | this->mouseX += e.state.X.rel; |
---|
| 189 | if (this->bInvertMouse_) |
---|
| 190 | this->mouseY += e.state.Y.rel; |
---|
| 191 | else |
---|
| 192 | this->mouseY -= e.state.Y.rel; |
---|
| 193 | |
---|
| 194 | // if(mouseX>maxMouseX) maxMouseX = mouseX; |
---|
| 195 | // if(mouseX<minMouseX) minMouseX = mouseX; |
---|
| 196 | // cout << "mouseX: " << mouseX << "\tmouseY: " << mouseY << endl; |
---|
| 197 | |
---|
| 198 | this->moved = true; |
---|
| 199 | |
---|
| 200 | return true; |
---|
| 201 | } |
---|
| 202 | |
---|
| 203 | void SpaceShip::tick(float dt) |
---|
| 204 | { |
---|
| 205 | if (!this->setMouseEventCallback_) |
---|
| 206 | { |
---|
| 207 | if (Orxonox::getSingleton()->getMouse()) |
---|
| 208 | { |
---|
| 209 | Orxonox::getSingleton()->getMouse()->setEventCallback(this); |
---|
| 210 | this->setMouseEventCallback_ = true; |
---|
| 211 | } |
---|
| 212 | } |
---|
| 213 | |
---|
| 214 | WorldEntity::tick(dt); |
---|
| 215 | |
---|
[633] | 216 | if (this->redNode_ && this->greenNode_) |
---|
| 217 | { |
---|
| 218 | this->blinkTime_ += dt; |
---|
| 219 | float redScale = 0.15 + 0.15 * sin(this->blinkTime_ * 10.0); |
---|
| 220 | float greenScale = 0.15 - 0.15 * sin(this->blinkTime_ * 10.0); |
---|
| 221 | this->redNode_->setScale(redScale, redScale, redScale); |
---|
| 222 | this->greenNode_->setScale(greenScale, greenScale, greenScale); |
---|
| 223 | } |
---|
| 224 | |
---|
[608] | 225 | OIS::Keyboard* mKeyboard = Orxonox::getSingleton()->getKeyboard(); |
---|
| 226 | OIS::Mouse* mMouse = Orxonox::getSingleton()->getMouse(); |
---|
| 227 | |
---|
| 228 | mKeyboard->capture(); |
---|
| 229 | mMouse->capture(); |
---|
| 230 | |
---|
| 231 | if (mKeyboard->isKeyDown(OIS::KC_UP) || mKeyboard->isKeyDown(OIS::KC_W)) |
---|
| 232 | this->moveForward(speed); |
---|
| 233 | else |
---|
| 234 | this->moveForward(0); |
---|
| 235 | |
---|
| 236 | if(mKeyboard->isKeyDown(OIS::KC_DOWN) || mKeyboard->isKeyDown(OIS::KC_S)) |
---|
| 237 | this->brakeForward(speed); |
---|
| 238 | else |
---|
| 239 | this->brakeForward(speed/10); |
---|
| 240 | |
---|
| 241 | if (mKeyboard->isKeyDown(OIS::KC_RIGHT) || mKeyboard->isKeyDown(OIS::KC_D)) |
---|
| 242 | this->loopRight(loop); |
---|
| 243 | else |
---|
| 244 | this->loopRight(0); |
---|
| 245 | |
---|
| 246 | if (mKeyboard->isKeyDown(OIS::KC_LEFT) || mKeyboard->isKeyDown(OIS::KC_A)) |
---|
| 247 | this->loopLeft(loop); |
---|
| 248 | else |
---|
| 249 | this->loopLeft(0); |
---|
| 250 | |
---|
| 251 | if(moved) |
---|
| 252 | { |
---|
| 253 | if (mouseY<=0) |
---|
| 254 | this->rotateUp(-mouseY*rotate); |
---|
| 255 | if (mouseY>0) |
---|
| 256 | this->rotateDown(mouseY*rotate); |
---|
| 257 | if (mouseX>0) |
---|
| 258 | this->rotateRight(mouseX*rotate); |
---|
| 259 | if (mouseX<=0) |
---|
| 260 | this->rotateLeft(-mouseX*rotate); |
---|
| 261 | |
---|
| 262 | mouseY = 0; |
---|
| 263 | mouseX = 0; |
---|
| 264 | moved = false; |
---|
| 265 | } |
---|
| 266 | else |
---|
| 267 | { |
---|
| 268 | this->rotateUp(0); |
---|
| 269 | this->rotateDown(0); |
---|
| 270 | this->rotateRight(0); |
---|
| 271 | this->rotateLeft(0); |
---|
| 272 | } |
---|
| 273 | |
---|
| 274 | if(moveForward_ > 0) |
---|
| 275 | { |
---|
| 276 | accelerationForward_ = moveForward_; |
---|
| 277 | if(speedForward_ < maxSpeedForward_) |
---|
| 278 | speedForward_ += accelerationForward_*dt; |
---|
| 279 | if(speedForward_ > maxSpeedForward_) |
---|
| 280 | speedForward_ = maxSpeedForward_; |
---|
| 281 | } |
---|
| 282 | |
---|
| 283 | if(moveForward_ <= 0) |
---|
| 284 | { |
---|
[626] | 285 | accelerationForward_ = -brakeForward_; |
---|
[608] | 286 | if(speedForward_ > 0) |
---|
[626] | 287 | speedForward_ += accelerationForward_*dt; |
---|
[608] | 288 | if(speedForward_ < 0) |
---|
| 289 | speedForward_ = 0; |
---|
| 290 | } |
---|
| 291 | |
---|
| 292 | if(rotateUp_ > 0) |
---|
| 293 | { |
---|
| 294 | accelerationRotateUpDown_ = rotateUp_; |
---|
| 295 | if(speedRotateUpDown_ < maxSpeedRotateUpDown_) |
---|
| 296 | speedRotateUpDown_ += accelerationRotateUpDown_*dt; |
---|
| 297 | if(speedRotateUpDown_ > maxSpeedRotateUpDown_) |
---|
| 298 | speedRotateUpDown_ = maxSpeedRotateUpDown_; |
---|
| 299 | } |
---|
| 300 | |
---|
| 301 | if(rotateDown_ > 0) |
---|
| 302 | { |
---|
| 303 | accelerationRotateUpDown_ = rotateDown_; |
---|
| 304 | if(speedRotateUpDown_ > -maxSpeedRotateUpDown_) |
---|
| 305 | speedRotateUpDown_ -= accelerationRotateUpDown_*dt; |
---|
| 306 | if(speedRotateUpDown_ < -maxSpeedRotateUpDown_) |
---|
| 307 | speedRotateUpDown_ = -maxSpeedRotateUpDown_; |
---|
| 308 | } |
---|
| 309 | |
---|
| 310 | if(rotateUp_ == 0 && rotateDown_ == 0) |
---|
| 311 | { |
---|
| 312 | accelerationRotateUpDown_ = brakeRotate_; |
---|
| 313 | if(speedRotateUpDown_ > 0) |
---|
| 314 | speedRotateUpDown_ -= accelerationRotateUpDown_*dt; |
---|
| 315 | if(speedRotateUpDown_ < 0) |
---|
| 316 | speedRotateUpDown_ += accelerationRotateUpDown_*dt; |
---|
| 317 | if(fabs(speedRotateUpDown_) < accelerationRotateUpDown_*dt) |
---|
| 318 | speedRotateUpDown_ = 0; |
---|
| 319 | } |
---|
| 320 | |
---|
| 321 | if(rotateRight_ > 0) |
---|
| 322 | { |
---|
| 323 | accelerationRotateRightLeft_ = rotateRight_; |
---|
| 324 | if(speedRotateRightLeft_ > -maxSpeedRotateRightLeft_) |
---|
| 325 | speedRotateRightLeft_ -= accelerationRotateRightLeft_*dt; |
---|
| 326 | if(speedRotateRightLeft_ < -maxSpeedRotateRightLeft_) |
---|
| 327 | speedRotateRightLeft_ = -maxSpeedRotateRightLeft_; |
---|
| 328 | } |
---|
| 329 | |
---|
| 330 | if(rotateLeft_ > 0) |
---|
| 331 | { |
---|
| 332 | accelerationRotateRightLeft_ = rotateLeft_; |
---|
| 333 | if(speedRotateRightLeft_ < maxSpeedRotateRightLeft_) |
---|
| 334 | speedRotateRightLeft_ += accelerationRotateRightLeft_*dt; |
---|
| 335 | if(speedRotateRightLeft_ > maxSpeedRotateRightLeft_) |
---|
| 336 | speedRotateRightLeft_ = maxSpeedRotateRightLeft_; |
---|
| 337 | } |
---|
| 338 | |
---|
| 339 | if(rotateRight_ == 0 && rotateLeft_ == 0) |
---|
| 340 | { |
---|
| 341 | accelerationRotateRightLeft_ = brakeRotate_; |
---|
| 342 | if(speedRotateRightLeft_ > 0) |
---|
| 343 | speedRotateRightLeft_ -= accelerationRotateRightLeft_*dt; |
---|
| 344 | if(speedRotateRightLeft_ < 0) |
---|
| 345 | speedRotateRightLeft_ += accelerationRotateRightLeft_*dt; |
---|
| 346 | if(fabs(speedRotateRightLeft_) < accelerationRotateRightLeft_*dt) |
---|
| 347 | speedRotateRightLeft_ = 0; |
---|
| 348 | } |
---|
| 349 | |
---|
| 350 | if(loopRight_ > 0) |
---|
| 351 | { |
---|
| 352 | accelerationLoopRightLeft_ = loopRight_; |
---|
| 353 | if(speedLoopRightLeft_ < maxSpeedLoopRightLeft_) |
---|
| 354 | speedLoopRightLeft_ += accelerationLoopRightLeft_*dt; |
---|
| 355 | if(speedLoopRightLeft_ > maxSpeedLoopRightLeft_) |
---|
| 356 | speedLoopRightLeft_ = maxSpeedLoopRightLeft_; |
---|
| 357 | } |
---|
| 358 | |
---|
| 359 | if(loopLeft_ > 0) |
---|
| 360 | { |
---|
| 361 | accelerationLoopRightLeft_ = loopLeft_; |
---|
| 362 | if(speedLoopRightLeft_ > -maxSpeedLoopRightLeft_) |
---|
| 363 | speedLoopRightLeft_ -= accelerationLoopRightLeft_*dt; |
---|
| 364 | if(speedLoopRightLeft_ < -maxSpeedLoopRightLeft_) |
---|
| 365 | speedLoopRightLeft_ = -maxSpeedLoopRightLeft_; |
---|
| 366 | } |
---|
| 367 | |
---|
| 368 | if(loopLeft_ == 0 && loopRight_ == 0) |
---|
| 369 | { |
---|
| 370 | accelerationLoopRightLeft_ = brakeLoop_; |
---|
| 371 | if(speedLoopRightLeft_ > 0) |
---|
| 372 | speedLoopRightLeft_ -= accelerationLoopRightLeft_*dt; |
---|
| 373 | if(speedLoopRightLeft_ < 0) |
---|
| 374 | speedLoopRightLeft_ += accelerationLoopRightLeft_*dt; |
---|
| 375 | if(fabs(speedLoopRightLeft_) < accelerationLoopRightLeft_*dt) |
---|
| 376 | speedLoopRightLeft_ = 0; |
---|
| 377 | } |
---|
| 378 | |
---|
| 379 | Vector3 transVector = Vector3::ZERO; |
---|
| 380 | /* |
---|
| 381 | transVector.z = 1; |
---|
| 382 | this->translate(transVector*speedForward_*dt, Ogre::Node::TS_LOCAL); |
---|
| 383 | this->pitch(Degree(speedRotateUpDown_*dt), Ogre::Node::TS_LOCAL); |
---|
| 384 | this->yaw(Degree(speedRotateRightLeft_*dt), Ogre::Node::TS_LOCAL); |
---|
| 385 | this->roll(Degree(speedLoopRightLeft_*dt), Ogre::Node::TS_LOCAL); |
---|
| 386 | */ |
---|
| 387 | |
---|
| 388 | transVector.x = 1; |
---|
| 389 | this->translate(transVector*speedForward_*dt, Ogre::Node::TS_LOCAL); |
---|
| 390 | this->yaw(Degree(speedRotateUpDown_*dt), Ogre::Node::TS_LOCAL); |
---|
| 391 | this->roll(Degree(speedRotateRightLeft_*dt), Ogre::Node::TS_LOCAL); |
---|
| 392 | this->pitch(Degree(speedLoopRightLeft_*dt), Ogre::Node::TS_LOCAL); |
---|
| 393 | |
---|
[626] | 394 | if (accelerationForward_ > 25.0) |
---|
| 395 | { |
---|
[633] | 396 | this->tt_->setRate(emitterRate_); |
---|
[626] | 397 | } |
---|
| 398 | else |
---|
| 399 | { |
---|
[633] | 400 | this->tt_->setRate(0); |
---|
[626] | 401 | } |
---|
| 402 | |
---|
[608] | 403 | } |
---|
| 404 | |
---|
| 405 | void SpaceShip::moveForward(float moveForward) { |
---|
| 406 | moveForward_ = moveForward; |
---|
| 407 | } |
---|
| 408 | |
---|
| 409 | void SpaceShip::rotateUp(float rotateUp) { |
---|
| 410 | rotateUp_ = rotateUp; |
---|
| 411 | } |
---|
| 412 | |
---|
| 413 | void SpaceShip::rotateDown(float rotateDown) { |
---|
| 414 | rotateDown_ = rotateDown; |
---|
| 415 | } |
---|
| 416 | |
---|
| 417 | void SpaceShip::rotateLeft(float rotateLeft) { |
---|
| 418 | rotateLeft_ = rotateLeft; |
---|
| 419 | } |
---|
| 420 | |
---|
| 421 | void SpaceShip::rotateRight(float rotateRight) { |
---|
| 422 | rotateRight_ = rotateRight; |
---|
| 423 | } |
---|
| 424 | |
---|
| 425 | void SpaceShip::loopLeft(float loopLeft) { |
---|
| 426 | loopLeft_ = loopLeft; |
---|
| 427 | } |
---|
| 428 | |
---|
| 429 | void SpaceShip::loopRight(float loopRight) { |
---|
| 430 | loopRight_ = loopRight; |
---|
| 431 | } |
---|
| 432 | |
---|
| 433 | void SpaceShip::brakeForward(float brakeForward) { |
---|
| 434 | brakeForward_ = brakeForward; |
---|
| 435 | } |
---|
| 436 | |
---|
| 437 | void SpaceShip::brakeRotate(float brakeRotate) { |
---|
| 438 | brakeRotate_ = brakeRotate; |
---|
| 439 | } |
---|
| 440 | |
---|
| 441 | void SpaceShip::brakeLoop(float brakeLoop) { |
---|
| 442 | brakeLoop_ = brakeLoop; |
---|
| 443 | } |
---|
| 444 | |
---|
| 445 | void SpaceShip::maxSpeedForward(float maxSpeedForward) { |
---|
| 446 | maxSpeedForward_ = maxSpeedForward; |
---|
| 447 | } |
---|
| 448 | |
---|
| 449 | void SpaceShip::maxSpeedRotateUpDown(float maxSpeedRotateUpDown) { |
---|
| 450 | maxSpeedRotateUpDown_ = maxSpeedRotateUpDown; |
---|
| 451 | } |
---|
| 452 | |
---|
| 453 | void SpaceShip::maxSpeedRotateRightLeft(float maxSpeedRotateRightLeft) { |
---|
| 454 | maxSpeedRotateRightLeft_ = maxSpeedRotateRightLeft; |
---|
| 455 | } |
---|
| 456 | |
---|
| 457 | void SpaceShip::maxSpeedLoopRightLeft(float maxSpeedLoopRightLeft) { |
---|
| 458 | maxSpeedLoopRightLeft_ = maxSpeedLoopRightLeft; |
---|
| 459 | } |
---|
| 460 | } |
---|