Changeset 7000 in orxonox.OLD for trunk/src/world_entities/space_ships
- Timestamp:
- Feb 3, 2006, 1:56:25 AM (19 years ago)
- Location:
- trunk/src/world_entities/space_ships
- Files:
-
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/space_ships/turbine_hover.cc
r6999 r7000 17 17 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY 18 18 19 #include " hover.h"19 #include "turbine_hover.h" 20 20 21 21 #include "weapons/weapon_manager.h" … … 33 33 using namespace std; 34 34 35 CREATE_FACTORY( Hover, CL_HOVER);36 37 /** 38 * destructs the hover, deletes alocated memory39 */ 40 Hover::~Hover ()35 CREATE_FACTORY(TurbineHover, CL_TURBINE_HOVER); 36 37 /** 38 * destructs the turbine_hover, deletes alocated memory 39 */ 40 TurbineHover::~TurbineHover () 41 41 { 42 42 this->setPlayer(NULL); … … 44 44 45 45 /** 46 * loads a Hover information from a specified file.47 * @param fileName the name of the File to load the hover from (absolute path)48 */ 49 Hover::Hover(const char* fileName)46 * loads a TurbineHover information from a specified file. 47 * @param fileName the name of the File to load the turbine_hover from (absolute path) 48 */ 49 TurbineHover::TurbineHover(const char* fileName) 50 50 { 51 51 this->init(); … … 54 54 if(!doc.LoadFile()) 55 55 { 56 PRINTF(2)("Loading file %s failed for Hover.\n", fileName);56 PRINTF(2)("Loading file %s failed for TurbineHover.\n", fileName); 57 57 return; 58 58 } … … 67 67 @todo add more parameters to load 68 68 */ 69 Hover::Hover(const TiXmlElement* root)69 TurbineHover::TurbineHover(const TiXmlElement* root) 70 70 { 71 71 this->init(); … … 94 94 95 95 /** 96 * initializes a Hover97 */ 98 void Hover::init()96 * initializes a TurbineHover 97 */ 98 void TurbineHover::init() 99 99 { 100 100 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 101 this->setClassID(CL_ HOVER, "Hover");101 this->setClassID(CL_TURBINE_HOVER, "TurbineHover"); 102 102 103 103 this->loadModel("models/ships/hoverglider_wing.obj", 1.0f, 3); 104 this->loadModel("models/ships/hoverglider_ rotor.obj", 1.0f, 4);105 this->loadModel("models/ships/ rotor.obj", .45f, 5);104 this->loadModel("models/ships/hoverglider_turbine.obj", 1.0f, 4); 105 this->loadModel("models/ships/hoverglider_turbine_rotors.obj", 1.0f, 5); 106 106 107 107 bForward = bBackward = bLeft = bRight = bAscend = bDescend = false; … … 179 179 180 180 /** 181 * loads the Settings of a Hover from an XML-element.181 * loads the Settings of a TurbineHover from an XML-element. 182 182 * @param root the XML-element to load the Spaceship's properties from 183 183 */ 184 void Hover::loadParams(const TiXmlElement* root)184 void TurbineHover::loadParams(const TiXmlElement* root) 185 185 { 186 186 WorldEntity::loadParams(root); … … 188 188 189 189 190 void Hover::enter()190 void TurbineHover::enter() 191 191 { 192 192 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true); … … 197 197 } 198 198 199 void Hover::leave()199 void TurbineHover::leave() 200 200 { 201 201 dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false); … … 206 206 207 207 /** 208 * effect that occurs after the Hover is spawned209 */ 210 void Hover::postSpawn ()208 * effect that occurs after the TurbineHover is spawned 209 */ 210 void TurbineHover::postSpawn () 211 211 { 212 212 //setCollision(new CollisionCluster(1.0, Vector(0,0,0))); … … 214 214 215 215 /** 216 * the action occuring if the hover left the game217 */ 218 void Hover::leftWorld ()216 * the action occuring if the turbine_hover left the game 217 */ 218 void TurbineHover::leftWorld () 219 219 {} 220 220 … … 225 225 * Implement behaviour like damage application or other miscellaneous collision stuff in this function 226 226 */ 227 void Hover::collidesWith(WorldEntity* entity, const Vector& location)227 void TurbineHover::collidesWith(WorldEntity* entity, const Vector& location) 228 228 {} 229 229 … … 234 234 * @param time The timespan passed since last update 235 235 */ 236 void Hover::tick (float dt)236 void TurbineHover::tick (float dt) 237 237 { 238 238 Playable::tick(dt); … … 247 247 * @param time the timeslice since the last frame 248 248 */ 249 void Hover::movement (float dt)249 void TurbineHover::movement (float dt) 250 250 { 251 251 Vector accel(0.0, 0.0, 0.0); … … 301 301 302 302 303 void Hover::draw() const303 void TurbineHover::draw() const 304 304 { 305 305 Vector tmpRot; … … 323 323 glRotatef (this->rotorNodeLeft.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 324 324 this->getModel(4)->draw(); 325 glTranslatef(0,-1,0);326 325 glRotatef(this->rotorCycle, 0,1,0); 327 326 this->getModel(5)->draw(); … … 347 346 glScalef(1,1,-1); 348 347 this->getModel(4)->draw(); 349 glTranslatef(0,-1,0);350 348 glRotatef(this->rotorCycle, 0,1,0); 351 349 this->getModel(5)->draw(); … … 356 354 * @todo switch statement ?? 357 355 */ 358 void Hover::process(const Event &event)356 void TurbineHover::process(const Event &event) 359 357 { 360 358 Playable::process(event); -
trunk/src/world_entities/space_ships/turbine_hover.h
r6999 r7000 1 1 2 2 /*! 3 * @file hover.h4 * Implements the Control of a Hover3 * @file turbine_hover.h 4 * Implements the Control of a TurbineHover 5 5 */ 6 6 7 #ifndef _ HOVER_H8 #define _ HOVER_H7 #ifndef _TURBINE_HOVER_H 8 #define _TURBINE_HOVER_H 9 9 10 10 #include "playable.h" 11 11 12 class Hover : public Playable12 class TurbineHover : public Playable 13 13 { 14 14 public: 15 15 16 Hover(const char* fileName);17 Hover(const TiXmlElement* root = NULL);18 virtual ~ Hover();16 TurbineHover(const char* fileName); 17 TurbineHover(const TiXmlElement* root = NULL); 18 virtual ~TurbineHover(); 19 19 20 20 virtual void loadParams(const TiXmlElement* root); … … 56 56 float rotation; 57 57 58 Vector velocity; //!< the velocity of the Hover.59 Quaternion direction; //!< the direction of the Hover.58 Vector velocity; //!< the velocity of the TurbineHover. 59 Quaternion direction; //!< the direction of the TurbineHover. 60 60 float travelSpeed; //!< the current speed of the Hove (to make soft movement) 61 float acceleration; //!< the acceleration of the Hover.61 float acceleration; //!< the acceleration of the TurbineHover. 62 62 float airFriction; //!< AirFriction. 63 63 … … 69 69 }; 70 70 71 #endif /* _ HOVERS_H */71 #endif /* _TURBINE_HOVERS_H */
Note: See TracChangeset
for help on using the changeset viewer.