Changeset 9869 in orxonox.OLD for trunk/src/world_entities/space_ships
- Timestamp:
- Oct 3, 2006, 12:19:30 AM (18 years ago)
- Location:
- trunk/src/world_entities/space_ships
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/collision_probe.cc
r9406 r9869 24 24 25 25 26 #include "class_id_DEPRECATED.h" 27 ObjectListDefinitionID(CollisionProbe, CL_COLLISION_PROBE); 26 28 27 28 CREATE_FACTORY(CollisionProbe, CL_COLLISION_PROBE); 29 CREATE_FACTORY(CollisionProbe); 29 30 30 31 … … 56 57 void CollisionProbe::init() 57 58 { 58 this-> setClassID(CL_COLLISION_PROBE, "CollisionProbe");59 this->registerObject(this, CollisionProbe::_objectList); 59 60 60 61 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false; -
trunk/src/world_entities/space_ships/collision_probe.h
r8490 r9869 13 13 class CollisionProbe : public Playable 14 14 { 15 ObjectListDeclaration(CollisionProbe); 15 16 16 17 public: -
trunk/src/world_entities/space_ships/cruizer.cc
r9235 r9869 29 29 30 30 #include "graphics_engine.h" 31 #include " dot_emitter.h"32 #include " sprite_particles.h"31 #include "particles/dot_emitter.h" 32 #include "particles/sprite_particles.h" 33 33 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(Cruizer, CL_CRUIZER); 36 #include "class_id_DEPRECATED.h" 37 ObjectListDefinitionID(Cruizer, CL_CRUIZER); 38 CREATE_FACTORY(Cruizer); 37 39 38 40 /** … … 89 91 { 90 92 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 91 this-> setClassID(CL_CRUIZER, "Cruizer");93 this->registerObject(this, Cruizer::_objectList); 92 94 93 95 this->setSupportedPlaymodes(Playable::Full3D); -
trunk/src/world_entities/space_ships/cruizer.h
r9061 r9869 16 16 class Cruizer : public Playable 17 17 { 18 ObjectListDeclaration(Cruizer); 18 19 public: 19 20 Cruizer(const std::string& fileName); -
trunk/src/world_entities/space_ships/helicopter.cc
r9235 r9869 25 25 26 26 #include "util/loading/factory.h" 27 #include " util/loading/resource_manager.h"27 #include "sound/resource_sound_buffer.h" 28 28 29 29 #include "key_mapper.h" … … 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(Helicopter, CL_HELICOPTER); 36 #include "class_id_DEPRECATED.h" 37 ObjectListDefinitionID(Helicopter, CL_HELICOPTER); 38 CREATE_FACTORY(Helicopter); 37 39 #include "script_class.h" 38 CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER,39 addMethod("moveUp", ExecutorLua1<Helicopter,bool>(&Helicopter::moveUp))40 ->addMethod("moveDown", ExecutorLua1<Helicopter,bool>(&Helicopter::moveDown))41 ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))42 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))43 ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))44 ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))40 CREATE_SCRIPTABLE_CLASS(Helicopter, 41 addMethod("moveUp", Executor1<Helicopter, lua_State*,bool>(&Helicopter::moveUp)) 42 ->addMethod("moveDown", Executor1<Helicopter, lua_State*,bool>(&Helicopter::moveDown)) 43 ->addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor)) 44 ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX)) 45 ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY)) 46 ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ)) 45 47 46 48 ); 47 49 50 48 51 /** 49 52 * creates the controlable Helicopter … … 60 63 { 61 64 this->setPlayer(NULL); 62 63 if (this->chopperBuffer != NULL)64 ResourceManager::getInstance()->unload(this->chopperBuffer);65 65 } 66 66 … … 100 100 Weapon* wpLeft = new TestGun(1); 101 101 wpLeft->setName("testGun Left"); 102 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate( CL_CANNON));102 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Cannon")); 103 103 104 104 cannon->setName("BFG"); … … 112 112 113 113 //load sound 114 if (this->chopperBuffer != NULL) 115 ResourceManager::getInstance()->unload(this->chopperBuffer); 116 this->chopperBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/engine/chopper.wav", WAV); 114 this->chopperBuffer = OrxSound::ResourceSoundBuffer("sound/engine/chopper.wav"); 117 115 118 116 } … … 124 122 void Helicopter::init() 125 123 { 126 this->chopperBuffer = NULL; 127 128 this->setClassID(CL_HELICOPTER, "Helicopter"); 124 this->registerObject(this, Helicopter::_objectList); 129 125 PRINTF(4)("HELICOPTER INIT\n"); 130 126 -
trunk/src/world_entities/space_ships/helicopter.h
r9235 r9869 17 17 class Helicopter : public Playable 18 18 { 19 ObjectListDeclaration(Helicopter); 19 20 20 21 public: … … 79 80 80 81 OrxSound::SoundSource soundSource; 81 OrxSound::SoundBuffer *chopperBuffer;82 OrxSound::SoundBuffer chopperBuffer; 82 83 83 84 }; -
trunk/src/world_entities/space_ships/hover.cc
r9656 r9869 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(Hover, CL_HOVER); 36 #include "class_id_DEPRECATED.h" 37 ObjectListDefinitionID(Hover, CL_HOVER); 38 CREATE_FACTORY(Hover); 37 39 38 40 #include "script_class.h" 39 CREATE_SCRIPTABLE_CLASS(Hover, CL_HOVER,40 addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer))41 CREATE_SCRIPTABLE_CLASS(Hover, 42 addMethod("hasPlayer", Executor0ret<Playable, lua_State*,bool>(&Playable::hasPlayer)) 41 43 //Coordinates 42 ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))43 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))44 ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))45 ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))44 ->addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor)) 45 ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX)) 46 ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY)) 47 ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ)) 46 48 ); 47 49 … … 98 100 Weapon* wpLeft = new TestGun(1); 99 101 wpLeft->setName("testGun Left"); 100 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate( CL_HYPERBLASTER));102 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Hyperblaster")); 101 103 102 104 cannon->setName("BFG"); … … 123 125 124 126 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 125 this-> setClassID(CL_HOVER, "Hover");127 this->registerObject(this, Hover::_objectList); 126 128 this->toReflectionList(); 127 129 -
trunk/src/world_entities/space_ships/hover.h
r9235 r9869 15 15 class Hover : public Playable 16 16 { 17 ObjectListDeclaration(Hover); 17 18 public: 18 19 -
trunk/src/world_entities/space_ships/space_ship.cc
r9656 r9869 26 26 #include "weapons/cannon.h" 27 27 28 #include " dot_emitter.h"29 #include " sprite_particles.h"28 #include "particles/dot_emitter.h" 29 #include "particles/sprite_particles.h" 30 30 31 31 #include "util/loading/factory.h" … … 53 53 54 54 55 56 CREATE_FACTORY(SpaceShip, CL_SPACE_SHIP); 55 #include "class_id_DEPRECATED.h" 56 ObjectListDefinitionID(SpaceShip, CL_SPACE_SHIP); 57 CREATE_FACTORY(SpaceShip); 58 57 59 #include "script_class.h" 58 CREATE_SCRIPTABLE_CLASS(SpaceShip, CL_SPACE_SHIP,59 addMethod("hasPlayer", Executor Lua0ret<Playable,bool>(&Playable::hasPlayer))60 ->addMethod("fire", Executor Lua1<Playable, bool>(&Playable::fire))61 ->addMethod("loadModel", Executor Lua2<WorldEntity,const std::string& ,float>(&WorldEntity::loadModel2))62 ->addMethod("setName", Executor Lua1<BaseObject,const std::string&>(&BaseObject::setName))63 ->addMethod("hide", Executor Lua0<WorldEntity>(&WorldEntity::hide))64 ->addMethod("unhide", Executor Lua0<WorldEntity>(&WorldEntity::unhide))65 //Coordinates66 ->addMethod("setAbsCoor", Executor Lua3<PNode,float,float,float>(&PNode::setAbsCoor))67 ->addMethod("getAbsCoorX", Executor Lua0ret<PNode, float>(&PNode::getAbsCoorX))68 ->addMethod("getAbsCoorY", Executor Lua0ret<PNode, float>(&PNode::getAbsCoorY))69 ->addMethod("getAbsCoorZ", Executor Lua0ret<PNode, float>(&PNode::getAbsCoorZ))60 CREATE_SCRIPTABLE_CLASS(SpaceShip, 61 addMethod("hasPlayer", Executor0ret<Playable, lua_State*,bool>(&Playable::hasPlayer)) 62 ->addMethod("fire", Executor1<Playable, lua_State*, bool>(&Playable::fire)) 63 ->addMethod("loadModel", Executor2<WorldEntity, lua_State*,const std::string& ,float>(&WorldEntity::loadModel2)) 64 ->addMethod("setName", Executor1<BaseObject, lua_State*,const std::string&>(&BaseObject::setName)) 65 ->addMethod("hide", Executor0<WorldEntity, lua_State*>(&WorldEntity::hide)) 66 ->addMethod("unhide", Executor0<WorldEntity, lua_State*>(&WorldEntity::unhide)) 67 //Coordinates 68 ->addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor)) 69 ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX)) 70 ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY)) 71 ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ)) 70 72 ); 71 73 … … 116 118 void SpaceShip::init() 117 119 { 118 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));119 this-> setClassID(CL_SPACE_SHIP, "SpaceShip");120 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 121 this->registerObject(this, SpaceShip::_objectList); 120 122 121 123 PRINTF(4)("SPACESHIP INIT\n"); … … 145 147 controlVelocityY = 150; 146 148 shipInertia = 1.5; 147 // cycle = 0.0;149 // cycle = 0.0; 148 150 149 151 this->setHealthMax(100); … … 156 158 this->pitchDir = this->getAbsDir(); 157 159 158 // GLGuiButton* button = new GLGuiPushButton();159 // button->show();160 // button->setLabel("orxonox");161 // button->setBindNode(this);162 // GLGuiBar* bar = new GLGuiBar();163 // bar->show();164 // bar->setValue(7.0);165 // bar->setMaximum(10);166 // bar->setSize2D( 20, 100);167 // bar->setAbsCoor2D( 10, 200);160 // GLGuiButton* button = new GLGuiPushButton(); 161 // button->show(); 162 // button->setLabel("orxonox"); 163 // button->setBindNode(this); 164 // GLGuiBar* bar = new GLGuiBar(); 165 // bar->show(); 166 // bar->setValue(7.0); 167 // bar->setMaximum(10); 168 // bar->setSize2D( 20, 100); 169 // bar->setAbsCoor2D( 10, 200); 168 170 169 171 //add events to the eventlist … … 200 202 this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5)); 201 203 this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0))); 202 //203 204 205 206 // this->getWeaponManager().setSlotPosition(8, Vector(-2.5, -0.3, -2.0));207 // this->getWeaponManager().setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));208 //209 // this->getWeaponManager().setSlotPosition(9, Vector(-2.5, -0.3, 2.0));210 // this->getWeaponManager().setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:204 // 205 this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0)); 206 this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 207 // 208 // this->getWeaponManager().setSlotPosition(8, Vector(-2.5, -0.3, -2.0)); 209 // this->getWeaponManager().setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0))); 210 // 211 // this->getWeaponManager().setSlotPosition(9, Vector(-2.5, -0.3, 2.0)); 212 // this->getWeaponManager().setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));: 211 213 212 214 this->getWeaponManager().getFixedTarget()->setParent(this); … … 310 312 void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location) 311 313 { 312 313 314 } 314 315 … … 332 333 333 334 if( ( xMouse != 0 || yMouse != 0 ) && this->getOwner() == SharedNetworkData::getInstance()->getHostID() ) 334 335 { 335 336 if (xMouse > controlVelocityX) xMouse = controlVelocityX; 336 337 else if (xMouse < -controlVelocityX) xMouse = -controlVelocityX; … … 342 343 mouseDir *= (Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity*yInvert, Vector(0,0,1))*pitchDir); 343 344 xMouse = yMouse = 0; 344 345 346 347 // if( this != State::getPlayer()->getControllable())348 // return;345 } 346 347 348 // if( this != State::getPlayer()->getControllable()) 349 // return; 349 350 350 351 // spaceship controlled movement fire(bool bF){ this->bFire = bF;} 351 352 //if (this->getOwner() == this->getHostID()) 352 353 this->calculateVelocity(time); 353 354 354 355 … … 363 364 364 365 //orient the spaceship in direction of the mouse 365 366 366 rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, 0.5);//fabsf(time)*shipInertia); 367 if (this->getAbsDir().distance(rotQuat) > 0.00000000000001) 367 368 this->setAbsDir( rotQuat); 368 369 //this->setAbsDirSoft(mouseDir,5); 369 370 370 371 // this is the air friction (necessary for a smooth control) … … 388 389 this->shiftCoor(move); 389 390 390 // PRINTF(0)("id of %s is: %i\n", this->getName(), this->getOMListNumber());391 // PRINTF(0)("id of %s is: %i\n", this->getName(), this->getOMListNumber()); 391 392 392 393 } … … 409 410 410 411 if( this->bUp ) 411 412 413 414 415 416 412 { 413 //this->shiftCoor(this->getAbsDirX()); 414 //accel += (this->getAbsDirX())*2; 415 accel += (this->getAbsDirX())*acceleration; 416 417 } 417 418 418 419 if( this->bDown ) 419 420 421 420 { 421 //this->shiftCoor((this->getAbsDirX())*-1); 422 //accel -= (this->getAbsDirX())*2; 422 423 //if(velocity.len() > 50) 423 424 425 426 427 424 accel -= (this->getAbsDirX())*0.5*acceleration; 425 426 427 428 } 428 429 429 430 if( this->bLeft/* > -this->getRelCoor().z*2*/) 430 431 { 431 432 this->shiftDir(Quaternion(time, Vector(0,1,0))); 432 // accel -= rightDirection;433 // accel -= rightDirection; 433 434 //velocityDir.normalize(); 434 435 //rot +=Vector(1,0,0); … … 449 450 { 450 451 mouseDir *= Quaternion(-time*2, Vector(1,0,0)); 451 // accel -= rightDirection;452 // accel -= rightDirection; 452 453 //velocityDir.normalize(); 453 454 //rot +=Vector(1,0,0); … … 467 468 this->shiftDir(Quaternion(time, Vector(0,0,1))); 468 469 469 // accel += upDirection;470 // accel += upDirection; 470 471 //velocityDir.normalize(); 471 472 //rot += Vector(0,0,1); … … 495 496 496 497 if( event.type == KeyMapper::PEV_LEFT) 497 498 this->bRollL = event.bPressed; 498 499 else if( event.type == KeyMapper::PEV_RIGHT) 499 500 this->bRollR = event.bPressed; 500 501 else if( event.type == KeyMapper::PEV_FORWARD) 501 502 this->bUp = event.bPressed; //this->shiftCoor(0,.1,0); -
trunk/src/world_entities/space_ships/space_ship.h
r9235 r9869 19 19 class SpaceShip : public Playable 20 20 { 21 ObjectListDeclaration(SpaceShip); 21 22 22 23 public: … … 36 37 virtual void postSpawn(); 37 38 virtual void leftWorld(); 38 39 39 40 virtual void destroy(WorldEntity* killer); 40 41 virtual void respawn(); -
trunk/src/world_entities/space_ships/spacecraft_2d.cc
r9406 r9869 30 30 31 31 #include "graphics_engine.h" 32 #include " dot_emitter.h"33 #include " sprite_particles.h"32 #include "particles/dot_emitter.h" 33 #include "particles/sprite_particles.h" 34 34 35 35 #include "debug.h" … … 38 38 39 39 40 CREATE_FACTORY(Spacecraft2D, CL_SPACECRAFT_2D); 41 42 43 CREATE_SCRIPTABLE_CLASS(Spacecraft2D, CL_SPACECRAFT_2D, 44 addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer)) 40 #include "class_id_DEPRECATED.h" 41 ObjectListDefinitionID(Spacecraft2D, CL_SPACECRAFT_2D); 42 CREATE_FACTORY(Spacecraft2D); 43 44 CREATE_SCRIPTABLE_CLASS(Spacecraft2D, 45 addMethod("hasPlayer", Executor0ret<Playable, lua_State*,bool>(&Playable::hasPlayer)) 45 46 //Coordinates 46 ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))47 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))48 ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))49 ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))50 ->addMethod("setAirFriction", ExecutorLua1<Spacecraft2D, float>(&Spacecraft2D::setAirFriction))47 ->addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor)) 48 ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX)) 49 ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY)) 50 ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ)) 51 ->addMethod("setAirFriction", Executor1<Spacecraft2D, lua_State*, float>(&Spacecraft2D::setAirFriction)) 51 52 ); 53 52 54 53 55 … … 85 87 86 88 //weapons: 87 Weapon* wpRight = dynamic_cast<Weapon*>(Factory::fabricate( CL_LASER_CANNON));89 Weapon* wpRight = dynamic_cast<Weapon*>(Factory::fabricate("LaserCannon")); 88 90 wpRight->setName("Cannon_Right"); 89 Weapon* wpLeft = dynamic_cast<Weapon*>(Factory::fabricate( CL_LASER_CANNON));91 Weapon* wpLeft = dynamic_cast<Weapon*>(Factory::fabricate("LaserCannon")); 90 92 wpLeft->setName("Cannon_Left"); 91 93 92 Weapon* turretLeft = dynamic_cast<Weapon*>(Factory::fabricate( CL_BOOMERANG_GUN));94 Weapon* turretLeft = dynamic_cast<Weapon*>(Factory::fabricate("BoomerangGun")); 93 95 wpRight->setName("Turret_Left"); 94 Weapon* turretRight = dynamic_cast<Weapon*>(Factory::fabricate( CL_BOOMERANG_GUN));96 Weapon* turretRight = dynamic_cast<Weapon*>(Factory::fabricate("BoomerangGun")); 95 97 wpLeft->setName("Turret_Right"); 96 98 … … 125 127 { 126 128 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 127 this-> setClassID(CL_SPACECRAFT_2D, "Spacecraft2D");129 this->registerObject(this, Spacecraft2D::_objectList); 128 130 129 131 this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal ); -
trunk/src/world_entities/space_ships/spacecraft_2d.h
r9235 r9869 16 16 class Spacecraft2D : public Playable 17 17 { 18 ObjectListDeclaration(Spacecraft2D); 18 19 public: 19 20 Spacecraft2D(const std::string& fileName); -
trunk/src/world_entities/space_ships/turbine_hover.cc
r9656 r9869 29 29 30 30 #include "graphics_engine.h" 31 #include " dot_emitter.h"32 #include " sprite_particles.h"31 #include "particles/dot_emitter.h" 32 #include "particles/sprite_particles.h" 33 33 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(TurbineHover, CL_TURBINE_HOVER); 36 #include "class_id_DEPRECATED.h" 37 ObjectListDefinitionID(TurbineHover, CL_TURBINE_HOVER); 38 CREATE_FACTORY(TurbineHover); 37 39 38 40 /** … … 101 103 { 102 104 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 103 this-> setClassID(CL_TURBINE_HOVER, "TurbineHover");105 this->registerObject(this, TurbineHover::_objectList); 104 106 105 107 this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal | Playable::Vertical); -
trunk/src/world_entities/space_ships/turbine_hover.h
r9656 r9869 18 18 class TurbineHover : public Playable 19 19 { 20 public: 21 TurbineHover(const std::string& fileName); 22 TurbineHover(const TiXmlElement* root = NULL); 23 virtual ~TurbineHover(); 20 ObjectListDeclaration(TurbineHover); 21 public: 22 TurbineHover(const std::string& fileName); 23 TurbineHover(const TiXmlElement* root = NULL); 24 virtual ~TurbineHover(); 24 25 25 26 void setBoostColor(const Color& color); 26 27 27 28 29 30 28 virtual void loadParams(const TiXmlElement* root); 29 virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f); 30 virtual void enter(); 31 virtual void leave(); 31 32 32 33 virtual void setTeam(int teamID); 33 34 34 35 36 35 virtual void postSpawn(); 36 virtual void leftWorld(); 37 virtual void respawn(); 37 38 38 39 40 39 virtual void collidesWith(WorldEntity* entity, const Vector& location); 40 virtual void tick(float dt); 41 virtual void draw() const; 41 42 42 43 virtual void process(const Event &event); 43 44 44 45 46 45 private: 46 void init(); 47 void movement(float dt); 47 48 48 49 50 51 52 53 54 49 private: 50 bool bForward; //!< forward button pressed. 51 bool bBackward; //!< backward button pressed. 52 bool bLeft; //!< left button pressed. 53 bool bRight; //!< right button pressed. 54 bool bAscend; //!< ascend button pressed. 55 bool bDescend; //!< descend button presses. 55 56 56 57 57 int yInvert; 58 float mouseSensitivity; //!< the mouse sensitivity 58 59 59 60 61 62 60 PNode wingNodeLeft; 61 PNode wingNodeRight; 62 PNode rotorNodeLeft; 63 PNode rotorNodeRight; 63 64 64 65 66 65 PNode cameraNode; 66 float cameraLook; 67 float rotation; 67 68 68 69 70 71 72 69 // Vector velocity; //!< the velocity of the TurbineHover. 70 Quaternion direction; //!< the direction of the TurbineHover. 71 float travelSpeed; //!< the current speed of the Hove (to make soft movement) 72 float acceleration; //!< the acceleration of the TurbineHover. 73 float airFriction; //!< AirFriction. 73 74 74 75 75 float rotorSpeed; //!< the speed of the rotor. 76 float rotorCycle; //!< The Cycle the rotor is in. 76 77 77 78 float airViscosity; 78 79 79 80 80 ParticleEmitter* burstEmitter[2]; 81 ParticleSystem* burstSystem; 81 82 }; 82 83
Note: See TracChangeset
for help on using the changeset viewer.