Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 19, 2005, 12:20:58 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: remake of the Projectile and TestBullet

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/weapons/projectile.h

    r4836 r4890  
    11/*!
    2     \projectile.h
     2    \file projectile.h
    33  *  a projectile, that is been shooted by a weapon
    44
     
    2626class Vector;
    2727class Weapon;
     28class ParticleEmitter;
    2829
    2930class Projectile : public WorldEntity
    3031{
    31   friend class World;
     32  public:
     33    Projectile (Weapon* weapon);
     34    virtual ~Projectile ();
    3235
    33  public:
    34   Projectile (Weapon* weapon);
    35   virtual ~Projectile ();
     36    void setFlightDirection(Quaternion flightDirection);
     37    void setVelocity(const Vector &velocity);
     38    void setLifeSpan(float lifeSpan);
    3639
    37   void setFlightDirection(Quaternion flightDirection);
    38   void setSpeed(float speed);
    39   void setVelocity(const Vector &velocity);
    40   void setTTL(float ttl);
    4140
    42   virtual void hit (WorldEntity* weapon, Vector* loc);
    43   virtual void destroy ();
    4441
    45   virtual void tick (float time);
    46   virtual void draw ();
    4742
    48  protected:
    49   //physical attriutes like: force, speed, acceleration etc.
    50   float          speed;                     //!< this is the speed of the projectile
    51   float          currentLifeTime;           //!< this is the time, the projectile exists in this world (incremented by tick)
    52   float          ttl;                       //!< time to life, after this time, the projectile will garbage collect itself
    53   Vector*        flightDirection;           //!< direction in which the shoot flights
    54   Weapon*        weapon;                    //!< weapon the shoot belongs to
     43    virtual void destroy ();
    5544
    56   Vector         velocity;                  //!< velocity of the projectile
    57   Vector         offsetVel;                 //!< offset velocity TEMP
     45    virtual void tick (float time);
     46    virtual void draw ();
     47
     48  protected:
     49
     50    // energy
     51    float                 energyMin;
     52    float                 energyMax;
     53
     54
     55    float                 lifeCycle;                 //!< The percentage of the Lifetime done [0-1]
     56    float                 lifeSpan;                  //!< The entire lifespan of the Shoot.
     57
     58    Vector                flightDirection;           //!< direction in which the shoot flighs
     59    Weapon*               weapon;                    //!< weapon the shoot belongs to.
     60
     61    Vector                velocity;                  //!< velocity of the projectile.
     62
     63    ParticleEmitter*      emitter;                   //!< For special effects each Projectile consists of an emitter.
    5864};
    5965
Note: See TracChangeset for help on using the changeset viewer.