Changeset 9039 in orxonox.OLD for branches/single_player_map/src/world_entities/space_ships/cruizer.cc
- Timestamp:
- Jul 3, 2006, 3:16:31 PM (18 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/world_entities/space_ships/cruizer.cc
r9036 r9039 17 17 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY 18 18 19 #include " turbine_hover.h"19 #include "cruizer.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(Cruizer, CL_CRUIZER); 37 38 /** 39 * destructs the cruizer, deletes alocated memory 40 40 */ 41 TurbineHover::~TurbineHover ()41 Cruizer::~Cruizer () 42 42 { 43 43 this->setPlayer(NULL); … … 45 45 46 46 /** 47 * @brief loads a TurbineHover information from a specified file.48 * @param fileName the name of the File to load the turbine_hover from (absolute path)47 * @brief loads a Cruizer information from a specified file. 48 * @param fileName the name of the File to load the cruizer from (absolute path) 49 49 */ 50 TurbineHover::TurbineHover(const std::string& fileName)50 Cruizer::Cruizer(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 Cruizer.\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 Cruizer::Cruizer(const TiXmlElement* root) 71 71 { 72 72 this->init(); … … 74 74 this->loadParams(root); 75 75 76 //weapons:77 Weapon* wpRight = new TestGun(0);78 wpRight->setName("testGun Right");79 Weapon* wpLeft = new TestGun(1);80 wpLeft->setName("testGun Left");81 //Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_HYPERBLASTER));82 83 // cannon->setName("BFG");84 85 this->addWeapon(wpLeft, 1, 0);86 this->addWeapon(wpRight,1 ,1);87 //this->addWeapon(cannon, 0, 2);88 76 89 77 this->getWeaponManager().changeWeaponConfig(1); 90 78 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); 91 79 92 this->loadModel("models/ships/hoverglider_mainbody.obj"); 93 } 94 95 96 /** 97 * @brief initializes a TurbineHover 80 exit(-1); 81 this->loadModel("models/ships/human_cruizer.obj"); 82 } 83 84 85 /** 86 * @brief initializes a Cruizer 98 87 */ 99 void TurbineHover::init()88 void Cruizer::init() 100 89 { 101 90 // this->setRelDir(Quaternion(M_PI, Vector(1,0,0))); 102 this->setClassID(CL_ TURBINE_HOVER, "TurbineHover");91 this->setClassID(CL_CRUIZER, "Cruizer"); 103 92 104 93 this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal | Playable::Vertical); … … 150 139 this->burstEmitter[0]->setRelCoor(0, -0.7, 0); 151 140 this->burstEmitter[0]->setRelDir(Quaternion(-M_PI_2, Vector(0,0,1))); 152 this->burstEmitter[0]->setName(" TurbineHover_Burst_emitter_Left");141 this->burstEmitter[0]->setName("Cruizer_Burst_emitter_Left"); 153 142 154 143 this->burstEmitter[1] = new DotEmitter(200, 5.0, .01); … … 156 145 this->burstEmitter[1]->setRelCoor(0, -0.7, 0); 157 146 this->burstEmitter[1]->setRelDir(Quaternion(-M_PI_2, Vector(0,0,1))); 158 this->burstEmitter[1]->setName(" TurbineHover_Burst_emitter_Right");147 this->burstEmitter[1]->setName("Cruizer_Burst_emitter_Right"); 159 148 160 149 … … 211 200 this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode); 212 201 this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0); 213 202 214 203 registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) ); 215 204 registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) ); … … 224 213 225 214 /** 226 * @brief loads the Settings of a TurbineHover from an XML-element.215 * @brief loads the Settings of a Cruizer from an XML-element. 227 216 * @param root the XML-element to load the Spaceship's properties from 228 217 */ 229 void TurbineHover::loadParams(const TiXmlElement* root)218 void Cruizer::loadParams(const TiXmlElement* root) 230 219 { 231 220 Playable::loadParams(root); 232 221 } 233 222 234 void TurbineHover::setPlayDirection(const Quaternion& rot, float speed)223 void Cruizer::setPlayDirection(const Quaternion& rot, float speed) 235 224 { 236 225 this->direction = Quaternion (rot.getHeading(), Vector(0,1,0)); 237 226 } 238 227 239 void TurbineHover::enter()228 void Cruizer::enter() 240 229 { 241 230 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true); … … 249 238 } 250 239 251 void TurbineHover::leave()240 void Cruizer::leave() 252 241 { 253 242 dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false); … … 258 247 259 248 /** 260 * @brief effect that occurs after the TurbineHover is spawned249 * @brief effect that occurs after the Cruizer is spawned 261 250 */ 262 void TurbineHover::postSpawn ()251 void Cruizer::postSpawn () 263 252 { 264 253 //setCollision(new CollisionCluster(1.0, Vector(0,0,0))); … … 266 255 267 256 /** 268 * @brief the action occuring if the turbine_hover left the game257 * @brief the action occuring if the cruizer left the game 269 258 */ 270 void TurbineHover::leftWorld ()259 void Cruizer::leftWorld () 271 260 {} 272 261 … … 277 266 * Implement behaviour like damage application or other miscellaneous collision stuff in this function 278 267 */ 279 void TurbineHover::collidesWith(WorldEntity* entity, const Vector& location)268 void Cruizer::collidesWith(WorldEntity* entity, const Vector& location) 280 269 { 281 270 Playable::collidesWith(entity, location); … … 288 277 * @param time The timespan passed since last update 289 278 */ 290 void TurbineHover::tick (float dt)279 void Cruizer::tick (float dt) 291 280 { 292 281 // this->debugNode(1); … … 306 295 * @param time the timeslice since the last frame 307 296 */ 308 void TurbineHover::movement (float dt)297 void Cruizer::movement (float dt) 309 298 { 310 299 Vector accel(0.0, 0.0, 0.0); … … 433 422 434 423 435 void TurbineHover::draw() const424 void Cruizer::draw() const 436 425 { 437 426 Vector tmpRot; … … 486 475 * @todo switch statement ?? 487 476 */ 488 void TurbineHover::process(const Event &event)477 void Cruizer::process(const Event &event) 489 478 { 490 479 Playable::process(event);
Note: See TracChangeset
for help on using the changeset viewer.