Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10303 in orxonox.OLD for branches/playability


Ignore:
Timestamp:
Jan 23, 2007, 8:03:07 PM (18 years ago)
Author:
muellmic
Message:

traveldistance calculations now work properly. note, that camera-distance and camera-fovy can be set in the level- xml- file and the traveldistance (how far can the player move the ship so thatit's still visible) will be calculated depending on the camera perspective.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10298 r10303  
    11421142void SpaceShip::updateTravelDistance()
    11431143{
    1144   float x = fabsf(State::getCamera()->getAbsCoor().y) * tan(State::getCamera()->getFovy()*M_PI /360.0);
     1144  float x = 1.25*fabsf(State::getCamera()->getAbsCoor().y) * tan(State::getCamera()->getFovy()*M_PI /360.0);
    11451145  float y = x / State::getCamera()->getAspectRatio();
    11461146  //State::getCamera()->setAbsCoor(-5, 1000, 0);
     
    11511151
    11521152  printf("x: %f, y: %f \n", x, y);
    1153   this->travelDistancePlus = Vector2D(x, y);
    1154   this->travelDistanceMinus = Vector2D(-x, -y);
     1153  this->travelDistancePlus = Vector2D(y, x);
     1154  this->travelDistanceMinus = Vector2D(-y, -x);
    11551155
    11561156  //this->isTravelDistanceInit = true;
Note: See TracChangeset for help on using the changeset viewer.