Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7000 in orxonox.OLD for trunk


Ignore:
Timestamp:
Feb 3, 2006, 1:56:25 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: added turbine Hover

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  
    1717#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
    1818
    19 #include "hover.h"
     19#include "turbine_hover.h"
    2020
    2121#include "weapons/weapon_manager.h"
     
    3333using namespace std;
    3434
    35 CREATE_FACTORY(Hover, CL_HOVER);
    36 
    37 /**
    38  *  destructs the hover, deletes alocated memory
    39  */
    40 Hover::~Hover ()
     35CREATE_FACTORY(TurbineHover, CL_TURBINE_HOVER);
     36
     37/**
     38 *  destructs the turbine_hover, deletes alocated memory
     39 */
     40TurbineHover::~TurbineHover ()
    4141{
    4242  this->setPlayer(NULL);
     
    4444
    4545/**
    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 */
     49TurbineHover::TurbineHover(const char* fileName)
    5050{
    5151  this->init();
     
    5454  if(!doc.LoadFile())
    5555  {
    56     PRINTF(2)("Loading file %s failed for Hover.\n", fileName);
     56    PRINTF(2)("Loading file %s failed for TurbineHover.\n", fileName);
    5757    return;
    5858  }
     
    6767   @todo add more parameters to load
    6868*/
    69 Hover::Hover(const TiXmlElement* root)
     69TurbineHover::TurbineHover(const TiXmlElement* root)
    7070{
    7171  this->init();
     
    9494
    9595/**
    96  * initializes a Hover
    97  */
    98 void Hover::init()
     96 * initializes a TurbineHover
     97 */
     98void TurbineHover::init()
    9999{
    100100  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    101   this->setClassID(CL_HOVER, "Hover");
     101  this->setClassID(CL_TURBINE_HOVER, "TurbineHover");
    102102
    103103  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);
    106106
    107107  bForward = bBackward = bLeft = bRight = bAscend = bDescend = false;
     
    179179
    180180/**
    181  * loads the Settings of a Hover from an XML-element.
     181 * loads the Settings of a TurbineHover from an XML-element.
    182182 * @param root the XML-element to load the Spaceship's properties from
    183183 */
    184 void Hover::loadParams(const TiXmlElement* root)
     184void TurbineHover::loadParams(const TiXmlElement* root)
    185185{
    186186  WorldEntity::loadParams(root);
     
    188188
    189189
    190 void Hover::enter()
     190void TurbineHover::enter()
    191191{
    192192  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( true);
     
    197197}
    198198
    199 void Hover::leave()
     199void TurbineHover::leave()
    200200{
    201201  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     
    206206
    207207/**
    208  *  effect that occurs after the Hover is spawned
    209 */
    210 void Hover::postSpawn ()
     208 *  effect that occurs after the TurbineHover is spawned
     209*/
     210void TurbineHover::postSpawn ()
    211211{
    212212  //setCollision(new CollisionCluster(1.0, Vector(0,0,0)));
     
    214214
    215215/**
    216  *  the action occuring if the hover left the game
    217 */
    218 void Hover::leftWorld ()
     216 *  the action occuring if the turbine_hover left the game
     217*/
     218void TurbineHover::leftWorld ()
    219219{}
    220220
     
    225225 * Implement behaviour like damage application or other miscellaneous collision stuff in this function
    226226 */
    227 void Hover::collidesWith(WorldEntity* entity, const Vector& location)
     227void TurbineHover::collidesWith(WorldEntity* entity, const Vector& location)
    228228{}
    229229
     
    234234 * @param time The timespan passed since last update
    235235*/
    236 void Hover::tick (float dt)
     236void TurbineHover::tick (float dt)
    237237{
    238238  Playable::tick(dt);
     
    247247 * @param time the timeslice since the last frame
    248248*/
    249 void Hover::movement (float dt)
     249void TurbineHover::movement (float dt)
    250250{
    251251  Vector accel(0.0, 0.0, 0.0);
     
    301301
    302302
    303 void Hover::draw() const
     303void TurbineHover::draw() const
    304304{
    305305  Vector tmpRot;
     
    323323  glRotatef (this->rotorNodeLeft.getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    324324  this->getModel(4)->draw();
    325   glTranslatef(0,-1,0);
    326325  glRotatef(this->rotorCycle, 0,1,0);
    327326  this->getModel(5)->draw();
     
    347346  glScalef(1,1,-1);
    348347  this->getModel(4)->draw();
    349   glTranslatef(0,-1,0);
    350348  glRotatef(this->rotorCycle, 0,1,0);
    351349  this->getModel(5)->draw();
     
    356354 * @todo switch statement ??
    357355 */
    358 void Hover::process(const Event &event)
     356void TurbineHover::process(const Event &event)
    359357{
    360358  Playable::process(event);
  • trunk/src/world_entities/space_ships/turbine_hover.h

    r6999 r7000  
    11
    22/*!
    3  * @file hover.h
    4  * Implements the Control of a Hover
     3 * @file turbine_hover.h
     4 * Implements the Control of a TurbineHover
    55 */
    66
    7 #ifndef _HOVER_H
    8 #define _HOVER_H
     7#ifndef _TURBINE_HOVER_H
     8#define _TURBINE_HOVER_H
    99
    1010#include "playable.h"
    1111
    12 class Hover : public Playable
     12class TurbineHover : public Playable
    1313{
    1414  public:
    1515
    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();
    1919
    2020    virtual void loadParams(const TiXmlElement* root);
     
    5656    float                 rotation;
    5757
    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.
    6060    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.
    6262    float                 airFriction;        //!< AirFriction.
    6363
     
    6969};
    7070
    71 #endif /* _HOVERS_H */
     71#endif /* _TURBINE_HOVERS_H */
Note: See TracChangeset for help on using the changeset viewer.