Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 3, 2006, 3:16:31 PM (18 years ago)
Author:
bensch
Message:

added cruizer

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/world_entities/space_ships/cruizer.cc

    r9036 r9039  
    1717#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
    1818
    19 #include "turbine_hover.h"
     19#include "cruizer.h"
    2020
    2121#include "weapons/weapon_manager.h"
     
    3434#include "debug.h"
    3535
    36 CREATE_FACTORY(TurbineHover, CL_TURBINE_HOVER);
    37 
    38 /**
    39  *  destructs the turbine_hover, deletes alocated memory
     36CREATE_FACTORY(Cruizer, CL_CRUIZER);
     37
     38/**
     39 *  destructs the cruizer, deletes alocated memory
    4040 */
    41 TurbineHover::~TurbineHover ()
     41Cruizer::~Cruizer ()
    4242{
    4343  this->setPlayer(NULL);
     
    4545
    4646/**
    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)
    4949 */
    50 TurbineHover::TurbineHover(const std::string& fileName)
     50Cruizer::Cruizer(const std::string& fileName)
    5151{
    5252  this->init();
     
    5555  if(!doc.LoadFile())
    5656  {
    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());
    5858    return;
    5959  }
     
    6868   @todo add more parameters to load
    6969*/
    70 TurbineHover::TurbineHover(const TiXmlElement* root)
     70Cruizer::Cruizer(const TiXmlElement* root)
    7171{
    7272  this->init();
     
    7474    this->loadParams(root);
    7575
    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);
    8876
    8977  this->getWeaponManager().changeWeaponConfig(1);
    9078  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    9179
    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
    9887 */
    99 void TurbineHover::init()
     88void Cruizer::init()
    10089{
    10190  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    102   this->setClassID(CL_TURBINE_HOVER, "TurbineHover");
     91  this->setClassID(CL_CRUIZER, "Cruizer");
    10392
    10493  this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal | Playable::Vertical);
     
    150139  this->burstEmitter[0]->setRelCoor(0, -0.7, 0);
    151140  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");
    153142
    154143  this->burstEmitter[1] = new DotEmitter(200, 5.0, .01);
     
    156145  this->burstEmitter[1]->setRelCoor(0, -0.7, 0);
    157146  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");
    159148
    160149
     
    211200  this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode);
    212201  this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0);
    213  
     202
    214203  registerVar( new SynchronizeableBool( &bForward, &bForward, "bForward", PERMISSION_OWNER ) );
    215204  registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) );
     
    224213
    225214/**
    226  * @brief loads the Settings of a TurbineHover from an XML-element.
     215 * @brief loads the Settings of a Cruizer from an XML-element.
    227216 * @param root the XML-element to load the Spaceship's properties from
    228217 */
    229 void TurbineHover::loadParams(const TiXmlElement* root)
     218void Cruizer::loadParams(const TiXmlElement* root)
    230219{
    231220  Playable::loadParams(root);
    232221}
    233222
    234 void TurbineHover::setPlayDirection(const Quaternion& rot, float speed)
     223void Cruizer::setPlayDirection(const Quaternion& rot, float speed)
    235224{
    236225  this->direction = Quaternion (rot.getHeading(), Vector(0,1,0));
    237226}
    238227
    239 void TurbineHover::enter()
     228void Cruizer::enter()
    240229{
    241230  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( true);
     
    249238}
    250239
    251 void TurbineHover::leave()
     240void Cruizer::leave()
    252241{
    253242  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
     
    258247
    259248/**
    260  * @brief effect that occurs after the TurbineHover is spawned
     249 * @brief effect that occurs after the Cruizer is spawned
    261250*/
    262 void TurbineHover::postSpawn ()
     251void Cruizer::postSpawn ()
    263252{
    264253  //setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
     
    266255
    267256/**
    268  * @brief the action occuring if the turbine_hover left the game
     257 * @brief the action occuring if the cruizer left the game
    269258*/
    270 void TurbineHover::leftWorld ()
     259void Cruizer::leftWorld ()
    271260{}
    272261
     
    277266 * Implement behaviour like damage application or other miscellaneous collision stuff in this function
    278267 */
    279 void TurbineHover::collidesWith(WorldEntity* entity, const Vector& location)
     268void Cruizer::collidesWith(WorldEntity* entity, const Vector& location)
    280269{
    281270  Playable::collidesWith(entity, location);
     
    288277 * @param time The timespan passed since last update
    289278*/
    290 void TurbineHover::tick (float dt)
     279void Cruizer::tick (float dt)
    291280{
    292281  //  this->debugNode(1);
     
    306295 * @param time the timeslice since the last frame
    307296*/
    308 void TurbineHover::movement (float dt)
     297void Cruizer::movement (float dt)
    309298{
    310299  Vector accel(0.0, 0.0, 0.0);
     
    433422
    434423
    435 void TurbineHover::draw() const
     424void Cruizer::draw() const
    436425{
    437426  Vector tmpRot;
     
    486475 * @todo switch statement ??
    487476 */
    488 void TurbineHover::process(const Event &event)
     477void Cruizer::process(const Event &event)
    489478{
    490479  Playable::process(event);
Note: See TracChangeset for help on using the changeset viewer.