Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3631 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Mar 22, 2005, 12:10:09 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: gun can be fired, projectil do not move jet

Location:
orxonox/trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/story_entities/world.cc

    r3629 r3631  
    166166  this->setClassName ("World");
    167167
    168   this->worldName = "Just a test level";
     168  this->worldName = name;
    169169  this->debugWorldNr = worldID;
    170170  this->entities = new tList<WorldEntity>();
  • orxonox/trunk/src/world_entities/player.cc

    r3620 r3631  
    5151  acceleration = 10.0;
    5252  //weapons:
    53   Weapon* wp = new TestGun();
     53  Weapon* wp = new TestGun(this, new Vector(), new Quaternion);
    5454  this->weapons->add(wp);
    5555  this->activeWeapon = wp; 
  • orxonox/trunk/src/world_entities/projectile.cc

    r3629 r3631  
    8383  glMultMatrixf((float*)matrix); 
    8484  //this->model->draw();
    85   PRINTF(1)("draw draw draw draw draw draw \n");
    8685  this->projectileModel->draw();
    8786
  • orxonox/trunk/src/world_entities/test_gun.cc

    r3629 r3631  
    1414   main-programmer: Patrick Boenzli
    1515   co-programmer:
     16
     17
     18   \todo: direction in which the projectile flights
     19   \todo: a target to set/hit
    1620*/
    1721
     
    3539   creates a new weapon
    3640*/
    37 TestGun::TestGun () : Weapon()
     41TestGun::TestGun (PNode* parent, Vector* coordinate, Quaternion* direction)
     42  :  Weapon (parent, coordinate, direction)
    3843{}
    3944
     
    7883{
    7984  printf("TestGun::fire() - firing weapon now ---------------------------\n");
    80   //WorldEntity* pj = new Projectile();
    81   //this->worldEntities->add(pj);
     85  WorldEntity* pj = new Projectile();
     86  pj->setAbsCoor( &this->getAbsCoor());
     87  pj->setAbsDir( &this->getAbsDir());
     88  this->worldEntities->add(pj);
    8289}
    8390
  • orxonox/trunk/src/world_entities/test_gun.h

    r3618 r3631  
    2727
    2828class Projectile;
     29class Vector;
     30class Quaternion;
    2931
    3032
     
    3436
    3537 public:
    36   TestGun ();
     38  TestGun (PNode* parent, Vector* coordinate, Quaternion* direction);
    3739  virtual ~TestGun ();
    3840
  • orxonox/trunk/src/world_entities/weapon.cc

    r3620 r3631  
    3434   creates a new weapon
    3535*/
    36 Weapon::Weapon () : WorldEntity()
    37 {
     36Weapon::Weapon (PNode* parent, Vector* coordinate, Quaternion* direction)
     37  : WorldEntity()
     38{
     39  parent->addChild(this, PNODE_ROTATE_AND_MOVE);
     40  this->setRelCoor(coordinate);
     41  this->setRelDir(direction);
    3842  WorldInterface* wi = WorldInterface::getInstance();
    3943  this->worldEntities = wi->getEntityList();
  • orxonox/trunk/src/world_entities/weapon.h

    r3629 r3631  
    4343
    4444 public:
    45   Weapon ();
     45  Weapon (PNode* parent, Vector* coordinate, Quaternion* direction);
    4646  virtual ~Weapon ();
    4747 
Note: See TracChangeset for help on using the changeset viewer.