Changeset 4592 in orxonox.OLD for orxonox/trunk/src/world_entities/player.cc
- Timestamp:
- Jun 10, 2005, 7:17:22 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/world_entities/player.cc
r4414 r4592 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 48 48 the player.cc for debug also 49 49 */ 50 this->setClass Name("Player");50 this->setClassID(CL_PLAYER, "Player"); 51 51 this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN); 52 52 travelSpeed = 15.0; … … 60 60 Weapon* wpRight = new TestGun(this, Vector(-2.6, 0.1, 3.0), Quaternion(), 0); 61 61 Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1); 62 62 63 63 this->weaponMan->addWeapon(wpRight, W_CONFIG0, W_SLOT0); 64 64 this->weaponMan->addWeapon(wpLeft, W_CONFIG1, W_SLOT1); … … 84 84 \brief creates a new Player from Xml Data 85 85 \param root the xml element containing player data 86 86 87 87 \todo add more parameters to load 88 88 */ 89 89 Player::Player(const TiXmlElement* root) : WorldEntity(root), PhysicsInterface(this) 90 90 { 91 this->setClass Name("Player");91 this->setClassID(CL_PLAYER, "Player"); 92 92 this->weapons = new tList<Weapon>(); 93 93 this->activeWeapon = NULL; … … 107 107 Weapon* wpRight = new TestGun(this, Vector(-2.6, 0.1, 3.0), Quaternion(), 0); 108 108 Weapon* wpLeft = new TestGun(this, Vector(-2.6, 0.1, -3.0), Quaternion(), 1); 109 109 110 110 this->weaponMan->addWeapon(wpRight, W_CONFIG0, W_SLOT0); 111 111 this->weaponMan->addWeapon(wpLeft, W_CONFIG1, W_SLOT1); … … 162 162 163 163 164 /** 164 /** 165 165 \brief Collision with another Entity has this effect 166 166 \param other the other colider … … 177 177 */ 178 178 void Player::draw () 179 { 179 { 180 180 glMatrixMode(GL_MODELVIEW); 181 181 glPushMatrix(); 182 182 float matrix[4][4]; 183 183 184 184 /* translate */ 185 glTranslatef (this->getAbsCoor ().x, 186 this->getAbsCoor ().y, 187 185 glTranslatef (this->getAbsCoor ().x, 186 this->getAbsCoor ().y, 187 this->getAbsCoor ().z); 188 188 /* rotate */ 189 189 this->getAbsDir ().matrix (matrix); 190 190 glMultMatrixf((float*)matrix); 191 191 192 192 this->model->draw(); 193 193 glPopMatrix(); … … 205 205 //printf("%p\n", this); 206 206 //this->getRelCoor().debug(); 207 207 208 208 /* link tick to weapon */ 209 209 //this->activeWeapon->tick(time); … … 236 236 accel = accel -(direction*acceleration); 237 237 if( this->bLeft && TrackManager::getInstance()->getWidth() > -this->getRelCoor().z*2) 238 accel = accel - (orthDirection*acceleration); 238 accel = accel - (orthDirection*acceleration); 239 239 if( this->bRight && TrackManager::getInstance()->getWidth() > this->getRelCoor().z*2) 240 240 accel = accel + (orthDirection*acceleration);
Note: See TracChangeset
for help on using the changeset viewer.