Changeset 6544 in orxonox.OLD for branches/spaceshipcontrol/src
- Timestamp:
- Jan 18, 2006, 2:10:57 PM (19 years ago)
- Location:
- branches/spaceshipcontrol/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/projectiles/guided_missile.cc
r6434 r6544 44 44 this->setMaxEnergy(10); 45 45 this->lifeSpan = 10.0; 46 this->agility = 5 00;46 this->agility = 5; 47 47 this->maxVelocity = 75; 48 48 -
branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.cc
r6537 r6544 130 130 mouseSensitivity = 0.001; 131 131 airViscosity = 0.95; 132 controlVelocityX = 5; 133 controlVelocityY = 150; 134 shipInertia = 3.0 ; 132 135 // cycle = 0.0; 133 136 … … 285 288 286 289 //orient the spaceship in direction of the mouse 287 rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, fabsf(time)* 3.0);290 rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, fabsf(time)*shipInertia); 288 291 if (this->getAbsDir().distance(rotQuat) > 0.00000000000001) 289 292 this->setAbsDir( rotQuat); … … 299 302 if((this->getAbsDirY()).y*travelSpeed < 120 && (this->getAbsDirY()).y<0) 300 303 move += Vector(0,-1,0)*60*time - Vector(0,1,0)*(this->getAbsDirY()).y*travelSpeed/2*time; 301 304 302 305 //hoover effect 303 306 //cycle += time; … … 448 451 this->yMouse = event.yRel; 449 452 450 int controlVelocity = 150;451 453 452 if (xMouse > controlVelocity) xMouse = controlVelocity; 453 else if (xMouse < -controlVelocity) xMouse = -controlVelocity; 454 if (yMouse > controlVelocity) yMouse = controlVelocity; 455 else if (yMouse < -controlVelocity) yMouse = -controlVelocity; 454 455 if (xMouse > controlVelocityX) xMouse = controlVelocityX; 456 else if (xMouse < -controlVelocityX) xMouse = -controlVelocityX; 457 if (yMouse > controlVelocityY) yMouse = controlVelocityY; 458 else if (yMouse < -controlVelocityY) yMouse = -controlVelocityY; 456 459 457 460 //pitchDir *= (Quaternion(xMouse*mouseSensitivity*0.01, Vector(1,0,0))); -
branches/spaceshipcontrol/src/world_entities/space_ships/space_ship.h
r6509 r6544 66 66 float yMouse; //!< mouse moved in y-Direction 67 67 float mouseSensitivity; //!< the mouse sensitivity 68 int controlVelocityX; 69 int controlVelocityY; 68 70 // float cycle; //!< hovercycle 69 71 70 72 Vector velocity; //!< the velocity of the player. 71 73 Quaternion mouseDir; //!< the direction where the player wants to fly 74 float shipInertia; //!< the inertia of the ship(how fast the ship reacts to a mouse input) 72 75 Quaternion rotQuat; 73 76 Quaternion pitchDir;
Note: See TracChangeset
for help on using the changeset viewer.