Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 31, 2007, 1:27:36 AM (17 years ago)
Author:
bknecht
Message:

explosions and such

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/space_ship.cc

    r10526 r10531  
    9393                        //->addMethod("setCameraSpeed", Executor1<SpaceShip, lua_State*, float>(&SpaceShip::setCameraSpeed))
    9494                        ->addMethod("pause", Executor1<WorldEntity, lua_State*, bool>(&WorldEntity::pauseTrack))
     95                        ->addMethod("setCameraDist", Executor1<SpaceShip, lua_State*, float>(&SpaceShip::setCameraDistance))
    9596                       );
    9697
     
    616617  {
    617618    this->bRight = event.bPressed;
     619    printf("ShipCoors: %f , %f, %f \n", this->getAbsCoor().x, this->getAbsCoor().y, this->getAbsCoor().z);
    618620  }
    619621  else if( event.type == KeyMapper::PEV_FORWARD)
    620622  {
    621623    this->bForward = event.bPressed; //this->shiftCoor(0,.1,0);
     624
    622625  }
    623626  else if( event.type == KeyMapper::PEV_BACKWARD)
     
    11411144void SpaceShip::setCameraDistance(float dist)
    11421145{
    1143   State::getCamera()->setViewTopDistance(dist);
     1146     
     1147  CameraMan* cm = State::getCameraman();
     1148  Camera* c = cm->getCurrentCam();
     1149  c->setViewTopDistance(dist);
     1150 
     1151  if (this->hasPlayer())
     1152    this->isTravelDistanceInit = false;
    11441153}
    11451154
    11461155void SpaceShip::setCameraFovy(float fovy)
    11471156{
    1148   State::getCamera()->setViewTopFovy(fovy);
     1157     
     1158  CameraMan* cm = State::getCameraman();
     1159  Camera* c = cm->getCurrentCam();
     1160  c->setViewTopFovy(fovy);
     1161 
     1162  if (this->hasPlayer())
     1163    this->isTravelDistanceInit = false;
    11491164}
    11501165
     
    11531168     CameraMan* cm = State::getCameraman();
    11541169     Camera* c = cm->getCurrentCam();
    1155 
    1156 
     1170     
     1171     
    11571172  float x = 1.25 * this->actionWidthPercentage * fabsf(c->getAbsCoor().y) * tan(c->getFovy()*M_PI /360.0);
    11581173  float y = x / c->getAspectRatio() / this->actionWidthPercentage;
Note: See TracChangeset for help on using the changeset viewer.