Changeset 9003 in orxonox.OLD for trunk/src/world_entities/creatures
- Timestamp:
- Jul 2, 2006, 1:36:13 PM (19 years ago)
- Location:
- trunk/src/world_entities/creatures
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/creatures/fps_player.cc
r8894 r9003 83 83 this->bBackward = false; 84 84 this->bJump = false; 85 this->bPosBut = false; 85 86 86 87 this->xMouse = 0.0f; … … 90 91 this->setHealth(80); 91 92 93 this->fallVelocity = 0.0f; 92 94 93 95 this->cameraNode.setParent(this); … … 121 123 122 124 this->getWeaponManager().setSlotCount(2); 123 this->getWeaponManager().setSlotPosition(0, Vector( 0.0, 5.0, 0.0));124 this->getWeaponManager().setSlotDirection(1, Quaternion(M_PI_4*.5, Vector(0,1,0)));125 this->getWeaponManager().setSlotPosition(0, Vector(1.5, -0.7, 1.1)); 126 // this->getWeaponManager().setSlotDirection(0, Quaternion(M_PI_2, Vector(0,1,0))); 125 127 this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 126 this->getWeaponManager().setSlotPosition(1, Vector( -0.5, .2, 1.9));128 this->getWeaponManager().setSlotPosition(1, Vector(5.0, 0.0, 0.0)); 127 129 this->getWeaponManager().setSlotDirection(1, Quaternion(M_PI_4*.5, Vector(1,0,0))); 128 130 … … 205 207 void FPSPlayer::tick (float time) 206 208 { 209 210 if( this->bPosBut) 211 { 212 this->bPosBut = false; 213 printf("prisoner:walkTo( %f, height, %f)\n",this->getAbsCoorX(),this->getAbsCoorZ()); 214 } 215 207 216 Playable::tick( time ); 208 217 … … 251 260 } 252 261 262 253 263 velocity *= 100; 254 264 265 266 // physical falling of the player 267 if( !this->isOnGround()) 268 { 269 this->fallVelocity += 300.0f * time; 270 velocity -= Vector(0.0, 1.0, 0.0) * this->fallVelocity; 271 } 272 else 273 { 274 this->fallVelocity = 0.0f; 275 } 276 277 255 278 this->shiftCoor( velocity*time ); 279 280 281 256 282 257 283 … … 321 347 } 322 348 else if( event.type == KeyMapper::PEV_JUMP) 323 this-> getAbsCoor().debug();324 } 325 326 327 328 349 this->bPosBut = event.bPressed; 350 } 351 352 353 354 -
trunk/src/world_entities/creatures/fps_player.h
r8731 r9003 42 42 bool bBackward; 43 43 bool bJump; //!< jumping 44 bool bPosBut; //!< position button 44 45 45 46 float xMouse; //!< mouse moved in x-Direction … … 51 52 52 53 PNode cameraNode; 54 55 float fallVelocity; //!< velocity for falling down 53 56 }; 54 57
Note: See TracChangeset
for help on using the changeset viewer.