Changeset 1747 for code/trunk/src/orxonox/objects/SpaceShip.cc
- Timestamp:
- Sep 9, 2008, 4:25:52 AM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/core3 (added) merged: 1573-1574,1583-1586,1591-1594,1596-1597,1603,1606-1607,1610-1611,1655,1658,1676-1679,1681-1685,1687,1716-1723,1725-1729,1736
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/SpaceShip.cc
r1735 r1747 37 37 #include "util/Convert.h" 38 38 #include "util/Math.h" 39 39 #include "util/Debug.h" 40 40 #include "core/CoreIncludes.h" 41 41 #include "core/ConfigValueIncludes.h" 42 #include "core/Debug.h" 42 #include "core/Iterator.h" 43 #include "core/input/InputManager.h" 43 44 #include "core/XMLPort.h" 44 45 #include "core/ConsoleCommand.h" 45 #include "network/Host.h"46 47 46 #include "tools/ParticleInterface.h" 48 49 #include "GraphicsEngine.h" 47 #include "network/Client.h" 48 #include "Backlight.h" 49 #include "CameraHandler.h" 50 #include "ParticleSpawner.h" 50 51 #include "RotatingProjectile.h" 51 52 #include "ParticleProjectile.h" 52 #include "ParticleSpawner.h" 53 #include "Backlight.h" 54 #include "CameraHandler.h" 53 #include "GraphicsEngine.h" 55 54 56 55 namespace orxonox 57 56 { 58 SetConsoleCommand(SpaceShip, setMaxSpeedTest, false). setAccessLevel(AccessLevel::Debug);59 SetConsoleCommand(SpaceShip, whereAmI, true). setAccessLevel(AccessLevel::User);60 SetConsoleCommand(SpaceShip, moveLongitudinal, true). setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);61 SetConsoleCommand(SpaceShip, moveLateral, true). setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);62 SetConsoleCommand(SpaceShip, moveYaw, true). setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);63 SetConsoleCommand(SpaceShip, movePitch, true). setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);64 SetConsoleCommand(SpaceShip, moveRoll, true). setAccessLevel(AccessLevel::User).setDefaultValue(0, 1.0f).setAxisParamIndex(0).setKeybindMode(KeybindMode::OnHold);65 SetConsoleCommand(SpaceShip, fire, true). setAccessLevel(AccessLevel::User).setKeybindMode(KeybindMode::OnHold);66 SetConsoleCommand Generic(test1, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setMaxSpeed"), false).setAccessLevel(AccessLevel::Debug);67 SetConsoleCommand Generic(test2, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setMaxBlubber"), false).setAccessLevel(AccessLevel::Debug);68 SetConsoleCommand Generic(test3, SpaceShip, createConsoleCommand(createFunctor(&SpaceShip::setMaxSpeedTest), "setRofl"), false).setAccessLevel(AccessLevel::Debug);57 SetConsoleCommand(SpaceShip, setMaxSpeedTest, false).accessLevel(AccessLevel::Debug); 58 SetConsoleCommand(SpaceShip, whereAmI, true).accessLevel(AccessLevel::User); 59 SetConsoleCommand(SpaceShip, moveLongitudinal, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 60 SetConsoleCommand(SpaceShip, moveLateral, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 61 SetConsoleCommand(SpaceShip, moveYaw, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 62 SetConsoleCommand(SpaceShip, movePitch, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 63 SetConsoleCommand(SpaceShip, moveRoll, true).accessLevel(AccessLevel::User).defaultValue(0, 1.0f).axisParamIndex(0).keybindMode(KeybindMode::OnHold); 64 SetConsoleCommand(SpaceShip, fire, true).accessLevel(AccessLevel::User).keybindMode(KeybindMode::OnHold); 65 SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxSpeed", 1, false).accessLevel(AccessLevel::Debug); 66 SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setMaxBlubber", 2, false).accessLevel(AccessLevel::Debug); 67 SetConsoleCommandAliasMulti(SpaceShip, setMaxSpeedTest, "setRofl", 3, false).accessLevel(AccessLevel::Debug); 69 68 70 69 CreateFactory(SpaceShip); … … 74 73 75 74 SpaceShip *SpaceShip::getLocalShip(){ 76 Iterator<SpaceShip>it;77 for(it = ObjectList<SpaceShip>:: start(); it; ++it){75 ObjectList<SpaceShip>::iterator it; 76 for(it = ObjectList<SpaceShip>::begin(); it; ++it){ 78 77 if( (it)->myShip_ ) 79 78 return *it; … … 289 288 void SpaceShip::changedVisibility() 290 289 { 291 Model::changedVisibility();290 SUPER(SpaceShip, changedVisibility); 292 291 293 292 this->tt1_->setEnabled(this->isVisible()); … … 306 305 void SpaceShip::changedActivity() 307 306 { 308 Model::changedActivity();307 SUPER(SpaceShip, changedActivity); 309 308 310 309 this->tt1_->setEnabled(this->isVisible()); … … 392 391 void SpaceShip::XMLPort(Element& xmlelement, XMLPort::Mode mode) 393 392 { 394 Model::XMLPort(xmlelement, mode);395 396 XMLPortParam LoadOnly(SpaceShip, "camera", setCamera, xmlelement, mode);397 XMLPortParam LoadOnly(SpaceShip, "maxSpeed", setMaxSpeed, xmlelement, mode);398 XMLPortParam LoadOnly(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, xmlelement, mode);399 XMLPortParam LoadOnly(SpaceShip, "maxRotation", setMaxRotation, xmlelement, mode);400 XMLPortParam LoadOnly(SpaceShip, "transAcc", setTransAcc, xmlelement, mode);401 XMLPortParam LoadOnly(SpaceShip, "rotAcc", setRotAcc, xmlelement, mode);402 XMLPortParam LoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, mode);403 XMLPortParam LoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode);393 SUPER(SpaceShip, XMLPort, xmlelement, mode); 394 395 XMLPortParam(SpaceShip, "camera", setCamera, getCamera, xmlelement, mode); 396 XMLPortParam(SpaceShip, "maxSpeed", setMaxSpeed, getMaxSpeed, xmlelement, mode); 397 XMLPortParam(SpaceShip, "maxSideAndBackSpeed", setMaxSideAndBackSpeed, getMaxSideAndBackSpeed, xmlelement, mode); 398 XMLPortParam(SpaceShip, "maxRotation", setMaxRotation, getMaxRotation, xmlelement, mode); 399 XMLPortParam(SpaceShip, "transAcc", setTransAcc, getTransAcc, xmlelement, mode); 400 XMLPortParam(SpaceShip, "rotAcc", setRotAcc, getRotAcc, xmlelement, mode); 401 XMLPortParam(SpaceShip, "transDamp", setTransDamp, getTransDamp, xmlelement, mode); 402 XMLPortParam(SpaceShip, "rotDamp", setRotDamp, getRotDamp, xmlelement, mode); 404 403 405 404 myShip_=true; //TODO: this is a hack … … 535 534 536 535 537 WorldEntity::tick(dt);536 SUPER(SpaceShip, tick, dt); 538 537 539 538 this->roll(this->mouseXRotation_ * dt);
Note: See TracChangeset
for help on using the changeset viewer.