Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 7, 2005, 3:54:49 PM (20 years ago)
Author:
chris
Message:

orxonox/branches/levelloader: Merged trunk into branch… still not working though…

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/levelloader/src/world_entities/projectile.h

    r3605 r3746  
    22    \projectile.h
    33    \brief a projectile, that is been shooted by a weapon
     4
     5    You can use this class to make some shoots, but this isn't the real idea. If you want to just test, if the
     6    shooting funcions work, use the Projectile class. But if you want to implement your own shoots its
     7    different:<br>
     8    Make a new class and derive it from Projectile. To have a weapon work well, reimplement the functions
     9    - void tick()
     10    - void draw()
     11    - void hit() (only if you have working collision detection)
     12    When you have implemented these functions you have just to add the projectiles to your weapon. You ll want
     13    to make this by looking into the function
     14    - Weapon::fire()
     15    there you just change the line:
     16    Projectile* pj = new Projectile();    TO     Projectile* pj = new MyOwnProjectileClass();
     17    and schwups it works... :)
    418*/
    519
     
    923#include "world_entity.h"
    1024
     25class Vector;
     26class Weapon;
    1127
    1228class Projectile : public WorldEntity
     
    1531
    1632 public:
    17   Projectile ();
     33  Projectile (Weapon* weapon);
    1834  virtual ~Projectile ();
     35
     36  void setFlightDirection(Quaternion flightDirection);
     37  void setSpeed(float speed);
     38  void setTTL(float ttl);
    1939
    2040  virtual void hit (WorldEntity* weapon, Vector* loc);
     
    2444  virtual void draw ();
    2545
    26  private:
     46 protected:
    2747  //physical attriutes like: force, speed, acceleration etc.
    28 
     48  float speed;                         //!< this is the speed of the projectile
     49  float currentLifeTime;               //!< this is the time, the projectile exists in this world (incremented by tick)
     50  float ttl;                           //!< time to life, after this time, the projectile will garbage collect itself
     51  Vector* flightDirection;             //!< direction in which the shoot flights
     52  Weapon* weapon;                      //!< weapon the shoot belongs to
     53 
    2954};
    3055
Note: See TracChangeset for help on using the changeset viewer.