Changeset 9709 in orxonox.OLD for branches/new_class_id/src/world_entities/space_ships
- Timestamp:
- Aug 31, 2006, 10:51:08 PM (18 years ago)
- Location:
- branches/new_class_id/src/world_entities/space_ships
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/world_entities/space_ships/collision_probe.cc
r9406 r9709 24 24 25 25 26 #include "class_id.h" 27 NewObjectListDefinitionID(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; -
branches/new_class_id/src/world_entities/space_ships/collision_probe.h
r8490 r9709 13 13 class CollisionProbe : public Playable 14 14 { 15 NewObjectListDeclaration(CollisionProbe); 15 16 16 17 public: -
branches/new_class_id/src/world_entities/space_ships/cruizer.cc
r9235 r9709 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(Cruizer, CL_CRUIZER); 36 #include "class_id.h" 37 NewObjectListDefinitionID(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); -
branches/new_class_id/src/world_entities/space_ships/cruizer.h
r9061 r9709 16 16 class Cruizer : public Playable 17 17 { 18 NewObjectListDeclaration(Cruizer); 18 19 public: 19 20 Cruizer(const std::string& fileName); -
branches/new_class_id/src/world_entities/space_ships/helicopter.cc
r9235 r9709 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(Helicopter, CL_HELICOPTER); 36 #include "class_id.h" 37 NewObjectListDefinitionID(Helicopter, CL_HELICOPTER); 38 CREATE_FACTORY(Helicopter); 37 39 #include "script_class.h" 38 CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER,40 CREATE_SCRIPTABLE_CLASS(Helicopter, Helicopter::classID(), 39 41 addMethod("moveUp", ExecutorLua1<Helicopter,bool>(&Helicopter::moveUp)) 40 42 ->addMethod("moveDown", ExecutorLua1<Helicopter,bool>(&Helicopter::moveDown)) … … 46 48 ); 47 49 50 48 51 /** 49 52 * creates the controlable Helicopter … … 100 103 Weapon* wpLeft = new TestGun(1); 101 104 wpLeft->setName("testGun Left"); 102 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate( CL_CANNON));105 Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Cannon")); 103 106 104 107 cannon->setName("BFG"); … … 126 129 this->chopperBuffer = NULL; 127 130 128 this-> setClassID(CL_HELICOPTER, "Helicopter");131 this->registerObject(this, Helicopter::_objectList); 129 132 PRINTF(4)("HELICOPTER INIT\n"); 130 133 -
branches/new_class_id/src/world_entities/space_ships/helicopter.h
r9235 r9709 17 17 class Helicopter : public Playable 18 18 { 19 NewObjectListDeclaration(Helicopter); 19 20 20 21 public: -
branches/new_class_id/src/world_entities/space_ships/hover.cc
r9656 r9709 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(Hover, CL_HOVER); 36 #include "class_id.h" 37 NewObjectListDefinitionID(Hover, CL_HOVER); 38 CREATE_FACTORY(Hover); 37 39 38 40 #include "script_class.h" 39 CREATE_SCRIPTABLE_CLASS(Hover, CL_HOVER,41 CREATE_SCRIPTABLE_CLASS(Hover, Hover::classID(), 40 42 addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer)) 41 43 //Coordinates … … 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 -
branches/new_class_id/src/world_entities/space_ships/hover.h
r9235 r9709 15 15 class Hover : public Playable 16 16 { 17 NewObjectListDeclaration(Hover); 17 18 public: 18 19 -
branches/new_class_id/src/world_entities/space_ships/space_ship.cc
r9656 r9709 53 53 54 54 55 56 CREATE_FACTORY(SpaceShip, CL_SPACE_SHIP); 55 #include "class_id.h" 56 NewObjectListDefinitionID(SpaceShip, CL_SPACE_SHIP); 57 CREATE_FACTORY(SpaceShip); 58 57 59 #include "script_class.h" 58 CREATE_SCRIPTABLE_CLASS(SpaceShip, CL_SPACE_SHIP,60 CREATE_SCRIPTABLE_CLASS(SpaceShip, SpaceShip::classID(), 59 61 addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer)) 60 62 ->addMethod("fire", ExecutorLua1<Playable, bool>(&Playable::fire)) … … 117 119 { 118 120 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 119 this-> setClassID(CL_SPACE_SHIP, "SpaceShip");121 this->registerObject(this, SpaceShip::_objectList); 120 122 121 123 PRINTF(4)("SPACESHIP INIT\n"); -
branches/new_class_id/src/world_entities/space_ships/space_ship.h
r9235 r9709 19 19 class SpaceShip : public Playable 20 20 { 21 NewObjectListDeclaration(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(); -
branches/new_class_id/src/world_entities/space_ships/spacecraft_2d.cc
r9406 r9709 38 38 39 39 40 CREATE_FACTORY(Spacecraft2D, CL_SPACECRAFT_2D); 41 42 43 CREATE_SCRIPTABLE_CLASS(Spacecraft2D, CL_SPACECRAFT_2D, 40 #include "class_id.h" 41 NewObjectListDefinitionID(Spacecraft2D, CL_SPACECRAFT_2D); 42 CREATE_FACTORY(Spacecraft2D); 43 44 CREATE_SCRIPTABLE_CLASS(Spacecraft2D, Spacecraft2D::classID(), 44 45 addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer)) 45 46 //Coordinates … … 52 53 53 54 55 54 56 /** 55 57 * @brief loads a Spacecraft2D information from a specified file. … … 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 ); -
branches/new_class_id/src/world_entities/space_ships/spacecraft_2d.h
r9235 r9709 16 16 class Spacecraft2D : public Playable 17 17 { 18 NewObjectListDeclaration(Spacecraft2D); 18 19 public: 19 20 Spacecraft2D(const std::string& fileName); -
branches/new_class_id/src/world_entities/space_ships/turbine_hover.cc
r9656 r9709 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY(TurbineHover, CL_TURBINE_HOVER); 36 #include "class_id.h" 37 NewObjectListDefinitionID(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); -
branches/new_class_id/src/world_entities/space_ships/turbine_hover.h
r9656 r9709 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 NewObjectListDeclaration(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.