Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 25, 2007, 3:05:01 AM (17 years ago)
Author:
patrick
Message:

merged playability. but got strange bug

Location:
branches/playability.new
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/playability.new

    • Property svn:ignore
      •  

        old new  
        1010autom4te.cache
        1111aclocal.m4
         12tags
         13test.bmp
         14config.sub
         15config.guess
         16OrxonoxPlayability.kdevses
         17OrxonoxPlayability.kdevelop.pcs
  • branches/playability.new/src/world_entities/space_ships/space_ship.h

    r9869 r10362  
    22 * @file space_ship.h
    33 * Implements the Control of a Spaceship
     4 * Space Ships are the core class for all types of ships in Orxonox
     5 * By default is on OM_GROUP_00
     6 * If player boards the ship, it is moved to OM_GROUP_01
    47 */
    58
     
    1619class ParticleEmitter;
    1720class ParticleSystem;
     21class Trail;
     22class Wobblegrid;
    1823
    1924class SpaceShip : public Playable
     
    2934
    3035    virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f);
     36    /*
     37    void setTravelHeight(float travelHeight);
     38    void setTravelDistance(const Vector2D& distance);
     39    void setTravelDistance(float x, float y);
     40    */
     41
     42    //void setAirFriction(float friction) { this->airFriction = friction; };
    3143
    3244    virtual void enter();
     
    4153    virtual void respawn();
    4254
    43     virtual void collidesWith(WorldEntity* entity, const Vector& location);
     55    inline Vector getVelocity() { return this->velocity; };
     56
    4457    virtual void tick(float time);
    4558    virtual void draw() const;
    4659
    4760    virtual void process(const Event &event);
     61//    virtual void hit (WorldEntity* entity, float damage);
     62
     63    inline WeaponManager& getWeaponManagerSecondary() { return this->secWeaponMan; };
     64
     65    //Functions for GUI
     66    inline float getShieldCur() { return this->shieldCur; };        //!< returns current shield value
     67    inline float getShieldMax() { return this->shieldMax; };        //!< returns maximum shield value
     68
     69    inline float getArmorCur() { return this->armorCur; };          //!< returns current armor value
     70    inline float getArmorMax() { return this->armorMax; };          //!< returns current armor value
     71
     72    inline float getElectronicCur() { return this->electronicCur; }; //!< returns current electronic value
     73    inline float getElectronicMax() { return this->electronicMax; }; //!< returns current electronic value
     74
     75    inline PNode* getTravelNode() { return this->travelNode; };
     76
     77    //damage handler
     78    virtual void damage(float pDamage, float eDamage);  //!< pDamage physical damage, eDamage electronic damage
     79
     80    //included by Michel:
     81    virtual void enterPlaymode(Playable::Playmode playmode);
     82    void setPlaymodeXML(const std::string& playmode); //recieves the playmode from a string (useful for script implementation)
     83    void setActionWidthPercentage(int i);
     84    void updateTravelDistance();
     85    virtual void movement (float dt);
     86
     87    //
     88
     89    void nextWeaponConfig();
     90    void previousWeaponConfig();
     91
     92    virtual void hit(float damage, WorldEntity* killer);
    4893
    4994  private:
    5095    void init();
    5196
    52     void calculateVelocity(float time);
    53 
    54     bool                  bUp;                //!< up button pressed.
    55     bool                  bDown;              //!< down button pressed.
     97    //void calculateVelocity(float time);
     98
     99    void regen(float time);  //!< handler for shield and electronic regeneration
     100
     101    void weaponRegen(float time);   //!< weapon energy regeneration
     102
     103    inline bool systemFailure() {  return (this->electronicCur < float(rand())/float(RAND_MAX) * this->electronicTH); };
     104
     105    void updateElectronicWidget();
     106    void updateShieldWidget();
     107
     108    //WeaponManager         weaponMan;      //!< the primary weapon manager: managing a list of energy weapons to wepaon-slot mapping
     109    WeaponManager         secWeaponMan;       //!< the secondary weapon manager: managing a list of special weapons to weapon-slot mapping
     110    short                 supportedPlaymodes; //!< What Playmodes are Supported in this Playable.
     111    Playable::Playmode    playmode;           //!< The current playmode.
     112
     113    //ship atributes
     114    float       shieldCur;          //!< current shield
     115    float       shieldMax;          //!< maximum shield
     116    float       shieldEnergyShare;  //!< percentage of reactor output
     117    float       shieldRegen;        //!< shield regeneration rate per second
     118    float       shieldTH;           //!< shield threshhold for reactivation
     119    bool        shieldActive;       //!< wheather the shield is working
     120    OrxGui::GLGuiEnergyWidgetVertical* shieldWidget; //!< holds the widget that shows the shield bar
     121
     122    float       armorCur;           //!< current armor
     123    float       armorMax;           //!< maximum armor
     124    float       armorRegen;         //!< armor regeneration per tick (usable on bioships?)
     125    //note that the armor widget is set on the health- widget in world- entity (see in player.cc)
     126
     127    float       electronicCur;      //!< current electronic
     128    float       electronicMax;      //!< maximum electronic
     129    float       electronicRegen;    //!< electronic regenration rate per tick
     130    float       electronicTH;       //!< Threshhold for electronic failure
     131    OrxGui::GLGuiEnergyWidgetVertical* electronicWidget; //!< holds the widget that shows the electronic bar
     132
     133    float       engineSpeedCur;     //!< speed output for movement = speed base + energy share part
     134    float       engineSpeedBase;    //!< speed base
     135    int         enginePowerConsume; //!< energy needed
     136    float       engineEnergyShare;  //!< percentage of reactor output
     137
     138    int         weaponEnergySlot;   //!< number of energy weapon slots
     139    int         weaponEnergyUsed;
     140    float       weaponEnergyShare;
     141    float       weaponEnergyRegen;
     142    int         weaponSpecialSlot;  //!< number of special weapon slots
     143    int         weaponSpecialUsed;
     144
     145    float       reactorOutput;      //!< reactor output
     146    float       reactorCapacity;    //!< reactor capacity
     147
     148    int         curWeaponPrimary;   //!< current primary weapon config
     149    int         curWeaponSecondary; //!< current secondary weapon config
     150
     151    bool                  bForward;                //!< up button pressed.
     152    bool                  bBackward;              //!< down button pressed.
    56153    bool                  bLeft;              //!< left button pressed.
    57154    bool                  bRight;             //!< right button pressed.
    58155    bool                  bAscend;            //!< ascend button pressed.
    59156    bool                  bDescend;           //!< descend button presses.
    60 //    bool                  bFire;              //!< fire button pressed.(moved to playable)
    61157    bool                  bRollL;             //!< rolling button pressed (left)
    62158    bool                  bRollR;             //!< rolling button pressed (right)
    63 
     159    bool                  bSecFire;           //!< second fire button pressed
     160
     161    /*
    64162    float                 xMouse;             //!< mouse moved in x-Direction
    65163    float                 yMouse;             //!< mouse moved in y-Direction
     
    68166    int                   controlVelocityX;
    69167    int                   controlVelocityY;
    70 //    float                 cycle;              //!< hovercycle
     168    */
    71169
    72170    Vector                velocity;           //!< the velocity of the player.
    73     Vector                oldVelocity;        //!< the velocity the player had last synced
     171    Vector                oldPos;
     172
     173// 2D-traveling
     174    PNode*                travelNode;
     175    float                 travelSpeed;        //!< the current speed of the Ship (to make soft movement)
     176    Vector                travelVelocity;     //!< object internal velocity vector for relative movement to the track node
     177    Vector2D              travelDistancePlus;     //!< Travel-Distance away from the TravelNode
     178    Vector2D              travelDistanceMinus;
     179    bool                  isTravelDistanceInit;
     180
     181    float                 actionWidthPercentage;
     182
     183// Camera
     184    PNode                 cameraNode;
     185    float                 cameraLook;
     186    float                 rotation;
     187    float                 cameraSpeed;
     188
     189    void                  setCameraDistance(float dist);
     190    void                  setCameraFovy(float fovy);
     191
     192    /*
    74193    Quaternion            mouseDir;           //!< the direction where the player wants to fly
    75194    Quaternion            oldMouseDir;        //!< the direction where the player wanted to fly
     
    77196    Quaternion            rotQuat;
    78197    Quaternion            pitchDir;
    79     float                 travelSpeed;        //!< the current speed of the player (to make soft movement)
    80     float                 acceleration;       //!< the acceleration of the player.
    81 
    82     float                 airViscosity;
     198    float                 dogdeSpeed;        //!< the dogde Speed of the ship.
     199    */
     200
     201    //Quaternion            direction;          //!< the direction of the ship.
     202    float                 acceleration;       //!< the acceleration of the ship.
     203    //float                 airFriction;        //!< AirFriction.
     204    //float                 airViscosity;
    83205
    84206    byte                  oldMask;            //!< used for synchronisation
    85207
    86     ParticleEmitter*      burstEmitter;
    87     ParticleSystem*       burstSystem;
     208    Trail*                trail;              //!< Burst trail
     209    Trail*                trailL;              //!< Burst trail
     210    Trail*                trailR;              //!< Burst trail
     211
     212
    88213};
    89214
Note: See TracChangeset for help on using the changeset viewer.