Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4592 in orxonox.OLD for orxonox/trunk/src/world_entities/player.cc


Ignore:
Timestamp:
Jun 10, 2005, 7:17:22 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: derivations work.
now the only thing to do is specify all the classes, and DO it CLEAN.

@patrick: is it ok, how i treated your ObjectManager??

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/player.cc

    r4414 r4592  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    4848     the player.cc for debug also
    4949  */
    50   this->setClassName("Player");
     50  this->setClassID(CL_PLAYER, "Player");
    5151  this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);
    5252  travelSpeed = 15.0;
     
    6060  Weapon* wpRight = new TestGun(this, Vector(-2.6, 0.1, 3.0), Quaternion(), 0);
    6161  Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1);
    62  
     62
    6363  this->weaponMan->addWeapon(wpRight, W_CONFIG0, W_SLOT0);
    6464  this->weaponMan->addWeapon(wpLeft, W_CONFIG1, W_SLOT1);
     
    8484   \brief creates a new Player from Xml Data
    8585   \param root the xml element containing player data
    86    
     86
    8787   \todo add more parameters to load
    8888*/
    8989Player::Player(const TiXmlElement* root) : WorldEntity(root), PhysicsInterface(this)
    9090{
    91   this->setClassName("Player");
     91  this->setClassID(CL_PLAYER, "Player");
    9292  this->weapons = new tList<Weapon>();
    9393  this->activeWeapon = NULL;
     
    107107  Weapon* wpRight = new TestGun(this, Vector(-2.6, 0.1, 3.0), Quaternion(), 0);
    108108  Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1);
    109  
     109
    110110  this->weaponMan->addWeapon(wpRight, W_CONFIG0, W_SLOT0);
    111111  this->weaponMan->addWeapon(wpLeft, W_CONFIG1, W_SLOT1);
     
    162162
    163163
    164 /** 
     164/**
    165165    \brief Collision with another Entity has this effect
    166166    \param other the other colider
     
    177177*/
    178178void Player::draw ()
    179 { 
     179{
    180180  glMatrixMode(GL_MODELVIEW);
    181181  glPushMatrix();
    182182  float matrix[4][4];
    183  
     183
    184184  /* translate */
    185   glTranslatef (this->getAbsCoor ().x, 
    186                 this->getAbsCoor ().y,
    187                 this->getAbsCoor ().z);
     185  glTranslatef (this->getAbsCoor ().x,
     186                this->getAbsCoor ().y,
     187                this->getAbsCoor ().z);
    188188  /* rotate */
    189189  this->getAbsDir ().matrix (matrix);
    190190  glMultMatrixf((float*)matrix);
    191  
     191
    192192  this->model->draw();
    193193  glPopMatrix();
     
    205205  //printf("%p\n", this);
    206206  //this->getRelCoor().debug();
    207  
     207
    208208  /* link tick to weapon */
    209209  //this->activeWeapon->tick(time);
     
    236236    accel = accel -(direction*acceleration);
    237237  if( this->bLeft &&  TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2)
    238     accel = accel - (orthDirection*acceleration); 
     238    accel = accel - (orthDirection*acceleration);
    239239  if( this->bRight &&  TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2)
    240240    accel = accel + (orthDirection*acceleration);
Note: See TracChangeset for help on using the changeset viewer.