Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4932 in orxonox.OLD for orxonox/trunk/src/world_entities


Ignore:
Timestamp:
Jul 22, 2005, 12:08:51 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: factory optimisations

Location:
orxonox/trunk/src/world_entities/weapons
Files:
5 edited

Legend:

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

    r4927 r4932  
    3131 *  standard constructor
    3232*/
    33 Projectile::Projectile (Weapon* weapon) : WorldEntity()
     33Projectile::Projectile () : WorldEntity()
    3434{
    3535  this->setClassID(CL_PROJECTILE, "Projectile");
    3636
    37   this->weapon = weapon;
    3837  this->lifeCycle = 0.0;
    3938  this->lifeSpan = 0.75f; /* sec */
  • orxonox/trunk/src/world_entities/weapons/projectile.h

    r4927 r4932  
    2525
    2626class Vector;
    27 class Weapon;
    2827class ParticleEmitter;
    2928
     
    3130{
    3231  public:
    33     Projectile (Weapon* weapon);
     32    Projectile ();
    3433    virtual ~Projectile ();
    3534
     
    5756
    5857    Vector                flightDirection;           //!< direction in which the shoot flighs
    59     Weapon*               weapon;                    //!< weapon the shoot belongs to.
    6058
    6159    Vector                velocity;                  //!< velocity of the projectile.
  • orxonox/trunk/src/world_entities/weapons/test_bullet.cc

    r4892 r4932  
    2121#include "model.h"
    2222#include "vector.h"
     23#include "object_manager.h"
    2324
    2425using namespace std;
    2526
     27CREATE_FAST_FACTORY(TestBullet, CL_TEST_BULLET);
    2628
    2729/**
    2830 *  standard constructor
    2931*/
    30 TestBullet::TestBullet (Weapon* weapon) : Projectile(weapon)
     32TestBullet::TestBullet () : Projectile()
    3133{
    3234  this->setClassID(CL_TEST_BULLET, "TestBullet");
  • orxonox/trunk/src/world_entities/weapons/test_bullet.h

    r4892 r4932  
    1515{
    1616 public:
    17   TestBullet (Weapon* weapon);
     17  TestBullet ();
    1818  virtual ~TestBullet ();
    1919
  • orxonox/trunk/src/world_entities/weapons/test_gun.cc

    r4931 r4932  
    3535#include "object_manager.h"
    3636
    37 CREATE_FAST_OBJECT(TestGun, CL_TEST_GUN);
    3837
    3938using namespace std;
     
    9796  this->weaponSource = new SoundSource(this->fireSound, this);
    9897  this->weaponSource->setRolloffFactor(.1);*/
    99   Projectile* p = new TestBullet(this);
     98  Projectile* p = new TestBullet();
    10099
    101100  //  ObjectManager::getInstance()->cache(CL_TEST_BULLET, 100, p);
     
    156155void TestGun::fire()
    157156{
    158   Projectile* pj =  new TestBullet(this);//dynamic_cast<Projectile*>(ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET & CL_MASK_LOWLEVEL_CLASS));
     157  Projectile* pj =  new TestBullet();//dynamic_cast<Projectile*>(ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET & CL_MASK_LOWLEVEL_CLASS));
    159158//  weaponSource->play();
    160159
Note: See TracChangeset for help on using the changeset viewer.