Changeset 9045 in orxonox.OLD
- Timestamp:
- Jul 3, 2006, 3:55:07 PM (18 years ago)
- Location:
- branches/single_player_map/src/world_entities/space_ships
- Files:
-
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/world_entities/space_ships/spacecraft_2d.cc
r9044 r9045 17 17 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY 18 18 19 #include " turbine_hover.h"19 #include "spacecraft_2d.h" 20 20 21 21 #include "weapons/weapon_manager.h" … … 34 34 #include "debug.h" 35 35 36 CREATE_FACTORY( TurbineHover, CL_TURBINE_HOVER);37 38 /** 39 * destructs the turbine_hover, deletes alocated memory36 CREATE_FACTORY(Spacecraft2D, CL_SPACECRAFT_2D); 37 38 /** 39 * destructs the spacecraft_2d, deletes alocated memory 40 40 */ 41 TurbineHover::~TurbineHover()41 Spacecraft2D::~Spacecraft2D () 42 42 { 43 43 this->setPlayer(NULL); … … 45 45 46 46 /** 47 * @brief loads a TurbineHoverinformation from a specified file.48 * @param fileName the name of the File to load the turbine_hoverfrom (absolute path)47 * @brief loads a Spacecraft2D information from a specified file. 48 * @param fileName the name of the File to load the spacecraft_2d from (absolute path) 49 49 */ 50 TurbineHover::TurbineHover(const std::string& fileName)50 Spacecraft2D::Spacecraft2D(const std::string& fileName) 51 51 { 52 52 this->init(); … … 55 55 if(!doc.LoadFile()) 56 56 { 57 PRINTF(2)("Loading file %s failed for TurbineHover.\n", fileName.c_str());57 PRINTF(2)("Loading file %s failed for Spacecraft2D.\n", fileName.c_str()); 58 58 return; 59 59 } … … 68 68 @todo add more parameters to load 69 69 */ 70 TurbineHover::TurbineHover(const TiXmlElement* root)70 Spacecraft2D::Spacecraft2D(const TiXmlElement* root) 71 71 { 72 72 this->init(); … … 95 95 96 96 /** 97 * @brief initializes a TurbineHover97 * @brief initializes a Spacecraft2D 98 98 */ 99 void TurbineHover::init()99 void Spacecraft2D::init() 100 100 { 101 101 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 102 this->setClassID(CL_ TURBINE_HOVER, "TurbineHover");102 this->setClassID(CL_SPACECRAFT_2D, "Spacecraft2D"); 103 103 104 104 this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal | Playable::Vertical); … … 150 150 this->burstEmitter[0]->setRelCoor(0, -0.7, 0); 151 151 this->burstEmitter[0]->setRelDir(Quaternion(-M_PI_2, Vector(0,0,1))); 152 this->burstEmitter[0]->setName(" TurbineHover_Burst_emitter_Left");152 this->burstEmitter[0]->setName("Spacecraft2D_Burst_emitter_Left"); 153 153 154 154 this->burstEmitter[1] = new DotEmitter(200, 5.0, .01); … … 156 156 this->burstEmitter[1]->setRelCoor(0, -0.7, 0); 157 157 this->burstEmitter[1]->setRelDir(Quaternion(-M_PI_2, Vector(0,0,1))); 158 this->burstEmitter[1]->setName(" TurbineHover_Burst_emitter_Right");158 this->burstEmitter[1]->setName("Spacecraft2D_Burst_emitter_Right"); 159 159 160 160 … … 211 211 this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode); 212 212 this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0); 213 213 214 214 registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) ); 215 215 registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) ); … … 224 224 225 225 /** 226 * @brief loads the Settings of a TurbineHoverfrom an XML-element.226 * @brief loads the Settings of a Spacecraft2D from an XML-element. 227 227 * @param root the XML-element to load the Spaceship's properties from 228 228 */ 229 void TurbineHover::loadParams(const TiXmlElement* root)229 void Spacecraft2D::loadParams(const TiXmlElement* root) 230 230 { 231 231 Playable::loadParams(root); 232 232 } 233 233 234 void TurbineHover::setPlayDirection(const Quaternion& rot, float speed)234 void Spacecraft2D::setPlayDirection(const Quaternion& rot, float speed) 235 235 { 236 236 this->direction = Quaternion (rot.getHeading(), Vector(0,1,0)); 237 237 } 238 238 239 void TurbineHover::enter()239 void Spacecraft2D::enter() 240 240 { 241 241 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true); … … 249 249 } 250 250 251 void TurbineHover::leave()251 void Spacecraft2D::leave() 252 252 { 253 253 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); … … 258 258 259 259 /** 260 * @brief effect that occurs after the TurbineHoveris spawned260 * @brief effect that occurs after the Spacecraft2D is spawned 261 261 */ 262 void TurbineHover::postSpawn ()262 void Spacecraft2D::postSpawn () 263 263 { 264 264 //setCollision(new CollisionCluster(1.0, Vector(0,0,0))); … … 266 266 267 267 /** 268 * @brief the action occuring if the turbine_hoverleft the game268 * @brief the action occuring if the spacecraft_2d left the game 269 269 */ 270 void TurbineHover::leftWorld ()270 void Spacecraft2D::leftWorld () 271 271 {} 272 272 … … 277 277 * Implement behaviour like damage application or other miscellaneous collision stuff in this function 278 278 */ 279 void TurbineHover::collidesWith(WorldEntity* entity, const Vector& location)279 void Spacecraft2D::collidesWith(WorldEntity* entity, const Vector& location) 280 280 { 281 281 Playable::collidesWith(entity, location); … … 288 288 * @param time The timespan passed since last update 289 289 */ 290 void TurbineHover::tick (float dt)290 void Spacecraft2D::tick (float dt) 291 291 { 292 292 // this->debugNode(1); … … 306 306 * @param time the timeslice since the last frame 307 307 */ 308 void TurbineHover::movement (float dt)308 void Spacecraft2D::movement (float dt) 309 309 { 310 310 Vector accel(0.0, 0.0, 0.0); … … 433 433 434 434 435 void TurbineHover::draw() const435 void Spacecraft2D::draw() const 436 436 { 437 437 Vector tmpRot; … … 486 486 * @todo switch statement ?? 487 487 */ 488 void TurbineHover::process(const Event &event)488 void Spacecraft2D::process(const Event &event) 489 489 { 490 490 Playable::process(event); -
branches/single_player_map/src/world_entities/space_ships/spacecraft_2d.h
r9044 r9045 1 1 2 2 /*! 3 * @file turbine_hover.h4 * Implements the Control of a TurbineHover3 * @file spacecraft_2d.h 4 * Implements the Control of a Spacecraft2D 5 5 */ 6 6 7 #ifndef _ TURBINE_HOVER_H8 #define _ TURBINE_HOVER_H7 #ifndef _SPACECRAFT_2D_H 8 #define _SPACECRAFT_2D_H 9 9 10 10 #include "playable.h" … … 14 14 class ParticleSystem; 15 15 16 class TurbineHover: public Playable16 class Spacecraft2D : public Playable 17 17 { 18 18 public: 19 TurbineHover(const std::string& fileName);20 TurbineHover(const TiXmlElement* root = NULL);21 virtual ~ TurbineHover();19 Spacecraft2D(const std::string& fileName); 20 Spacecraft2D(const TiXmlElement* root = NULL); 21 virtual ~Spacecraft2D(); 22 22 23 23 virtual void loadParams(const TiXmlElement* root); … … 59 59 float rotation; 60 60 61 // Vector velocity; //!< the velocity of the TurbineHover.62 Quaternion direction; //!< the direction of the TurbineHover.61 // Vector velocity; //!< the velocity of the Spacecraft2D. 62 Quaternion direction; //!< the direction of the Spacecraft2D. 63 63 float travelSpeed; //!< the current speed of the Hove (to make soft movement) 64 float acceleration; //!< the acceleration of the TurbineHover.64 float acceleration; //!< the acceleration of the Spacecraft2D. 65 65 float airFriction; //!< AirFriction. 66 66 … … 74 74 }; 75 75 76 #endif /* _ TURBINE_HOVERS_H */76 #endif /* _SPACECRAFT_2DS_H */
Note: See TracChangeset
for help on using the changeset viewer.