Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6034 in orxonox.OLD


Ignore:
Timestamp:
Dec 10, 2005, 11:41:18 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the spaceshipcontroll branche back to the trunk
merged with command
svn merge branche/spaceshipcontroll trunk -r5978:HEAD
confilcs:
space_ship.cc: favor of controll, but Draw from trunk
rest: space_ship.h and sound_engine. in favor of the spaceshipcontroll branche

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/story_entities/world.cc

    r5996 r6034  
    415415  }
    416416
    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);
    418419  //music->playback();
    419420}
  • trunk/src/world_entities/camera.cc

    r5769 r6034  
    1 
    2 
    31/*
    42   orxonox - the future of 3D-vertical-scrollers
     
    115113void Camera::setViewMode(ViewMode mode)
    116114{
     115  currentMode = mode;
    117116  switch (mode)
    118117    {
     
    180179{
    181180  float tmpFovy = (this->toFovy - this->fovy) ;
    182   if (tmpFovy > .01)
     181  if (tmpFovy > 0.01)
    183182    this->fovy += tmpFovy * fabsf(dt);
    184183}
     
    207206  Vector targetPosition = this->target->getAbsCoor();
    208207  Vector up = this->getAbsDirV();
     208  Vector delay = Vector(0,0,0);
     209  if( currentMode != VIEW_FRONT) delay = (this->target->getAbsDirX() * this->target->getSpeed())/30;
    209210
    210211  // 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,
    212213            targetPosition.x, targetPosition.y, targetPosition.z,
    213214            up.x, up.y, up.z);
  • trunk/src/world_entities/camera.h

    r5005 r6034  
    5858
    5959  float             toFovy;          //!< The fovy-mode to iterate to.
     60  ViewMode          currentMode;     //!< The ViewMode the camera is in
    6061};
    6162
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6033 r6034  
    1111### File Specific:
    1212   main-programmer: Benjamin Knecht
    13    co-programmer: ...
     13   co-programmer: Silvan Nellen
    1414
    1515*/
     
    2020#include "space_ship.h"
    2121
     22#include "objModel.h"
    2223#include "resource_manager.h"
    2324
     
    111112  PRINTF(4)("SPACESHIP INIT\n");
    112113
    113   EventHandler::getInstance()->grabEvents(false);
     114  EventHandler::getInstance()->grabEvents(true);
    114115
    115116  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
     
    117118  xMouse = yMouse = 0;
    118119  mouseSensitivity = 0.001;
     120  airViscosity = 1.0;
    119121
    120122  cycle = 0.0;
     
    253255void SpaceShip::tick (float time)
    254256{
    255      cycle += time;
     257
    256258  // spaceship controlled movement
    257259  this->calculateVelocity(time);
     
    259261  Vector move = (velocity)*time;
    260262
    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;
    262267
    263268  // this is the air friction (necessary for a smooth control)
    264269  if(velocity.len() != 0) velocity -= velocity*0.01;
    265270
     271  //hoover effect
     272  cycle += time;
    266273  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)));
    267278
    268279  //SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);
     
    299310   }
    300311
    301   if( this->bLeft /* > -this->getRelCoor().z*2*/)
     312  if( this->bLeft/* > -this->getRelCoor().z*2*/)
    302313  {
    303314    this->shiftDir(Quaternion(time, Vector(0,1,0)));
     
    316327    //rotVal += .4;
    317328  }
     329
    318330
    319331  if( this->bRollL /* > -this->getRelCoor().z*2*/)
  • trunk/src/world_entities/space_ships/space_ship.h

    r5996 r6034  
    1 
    21/*!
    32 * @file space_ship.h
     
    6968    float                 acceleration;       //!< the acceleration of the player.
    7069
     70    float                 airViscosity;
     71
    7172};
    7273
Note: See TracChangeset for help on using the changeset viewer.