- Timestamp:
- Dec 10, 2005, 11:41:18 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/story_entities/world.cc
r5996 r6034 415 415 } 416 416 417 this->music = NULL;//(OggPlayer*)ResourceManager::getInstance()->load("sound/00-luke_grey_-_hypermode.ogg", OGG, RP_LEVEL); 417 this->music = NULL; 418 //(OggPlayer*)ResourceManager::getInstance()->load("sound/00-luke_grey_-_hypermode.ogg", OGG, RP_LEVEL); 418 419 //music->playback(); 419 420 } -
trunk/src/world_entities/camera.cc
r5769 r6034 1 2 3 1 /* 4 2 orxonox - the future of 3D-vertical-scrollers … … 115 113 void Camera::setViewMode(ViewMode mode) 116 114 { 115 currentMode = mode; 117 116 switch (mode) 118 117 { … … 180 179 { 181 180 float tmpFovy = (this->toFovy - this->fovy) ; 182 if (tmpFovy > .01)181 if (tmpFovy > 0.01) 183 182 this->fovy += tmpFovy * fabsf(dt); 184 183 } … … 207 206 Vector targetPosition = this->target->getAbsCoor(); 208 207 Vector up = this->getAbsDirV(); 208 Vector delay = Vector(0,0,0); 209 if( currentMode != VIEW_FRONT) delay = (this->target->getAbsDirX() * this->target->getSpeed())/30; 209 210 210 211 // Setting the Camera Eye, lookAt and up Vectors 211 gluLookAt(cameraPosition.x , cameraPosition.y, cameraPosition.z,212 gluLookAt(cameraPosition.x - delay.x, cameraPosition.y - delay.y, cameraPosition.z - delay.z, 212 213 targetPosition.x, targetPosition.y, targetPosition.z, 213 214 up.x, up.y, up.z); -
trunk/src/world_entities/camera.h
r5005 r6034 58 58 59 59 float toFovy; //!< The fovy-mode to iterate to. 60 ViewMode currentMode; //!< The ViewMode the camera is in 60 61 }; 61 62 -
trunk/src/world_entities/space_ships/space_ship.cc
r6033 r6034 11 11 ### File Specific: 12 12 main-programmer: Benjamin Knecht 13 co-programmer: ...13 co-programmer: Silvan Nellen 14 14 15 15 */ … … 20 20 #include "space_ship.h" 21 21 22 #include "objModel.h" 22 23 #include "resource_manager.h" 23 24 … … 111 112 PRINTF(4)("SPACESHIP INIT\n"); 112 113 113 EventHandler::getInstance()->grabEvents( false);114 EventHandler::getInstance()->grabEvents(true); 114 115 115 116 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false; … … 117 118 xMouse = yMouse = 0; 118 119 mouseSensitivity = 0.001; 120 airViscosity = 1.0; 119 121 120 122 cycle = 0.0; … … 253 255 void SpaceShip::tick (float time) 254 256 { 255 cycle += time; 257 256 258 // spaceship controlled movement 257 259 this->calculateVelocity(time); … … 259 261 Vector move = (velocity)*time; 260 262 261 //orient the spaceship model in the direction of movement. 263 //orient the velocity in the direction of the spaceship. 264 travelSpeed = velocity.len(); 265 velocity += ((this->getAbsDirX())*travelSpeed-velocity)*airViscosity; 266 velocity = (velocity.getNormalized())*travelSpeed; 262 267 263 268 // this is the air friction (necessary for a smooth control) 264 269 if(velocity.len() != 0) velocity -= velocity*0.01; 265 270 271 //hoover effect 272 cycle += time; 266 273 this->shiftCoor(Vector(0,1,0)*cos(this->cycle*2.0)*0.02); 274 275 //readjust 276 // if (this->getAbsDirZ().y > 0.1) this->shiftDir(Quaternion(time*0.3, Vector(1,0,0))); 277 //else if (this->getAbsDirZ().y < -0.1) this->shiftDir(Quaternion(-time*0.3, Vector(1,0,0))); 267 278 268 279 //SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2); … … 299 310 } 300 311 301 if( this->bLeft 312 if( this->bLeft/* > -this->getRelCoor().z*2*/) 302 313 { 303 314 this->shiftDir(Quaternion(time, Vector(0,1,0))); … … 316 327 //rotVal += .4; 317 328 } 329 318 330 319 331 if( this->bRollL /* > -this->getRelCoor().z*2*/) -
trunk/src/world_entities/space_ships/space_ship.h
r5996 r6034 1 2 1 /*! 3 2 * @file space_ship.h … … 69 68 float acceleration; //!< the acceleration of the player. 70 69 70 float airViscosity; 71 71 72 }; 72 73
Note: See TracChangeset
for help on using the changeset viewer.