Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7009 in orxonox.OLD for trunk/src/world_entities/camera.cc


Ignore:
Timestamp:
Feb 3, 2006, 12:14:32 PM (19 years ago)
Author:
patrick
Message:

trunk: camera frustum culling plane added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/camera.cc

    r6999 r7009  
    145145void Camera::tick(float dt)
    146146{
     147  //update frustum plane
     148  this->viewVector = this->getAbsCoor() -  this->target->getAbsCoor();
     149  this->frustumPlane = Plane(this->viewVector, this->getAbsCoor() + Vector(-70.0,0.0,0.0));
     150
     151  this->upVector =  this->getAbsDirV();
     152
     153
    147154  float tmpFovy = (this->toFovy - this->fovy) ;
    148155  if (tmpFovy > 0.01)
     
    173180  Vector cameraPosition = this->getAbsCoor();
    174181  Vector targetPosition = this->target->getAbsCoor();
    175   Vector up = this->getAbsDirV();
    176   Vector delay = Vector(0, 0, 0);
    177   //if( currentMode != VIEW_FRONT) delay = (this->target->getVelocity()) / 25.0f;
    178182
    179183   // Setting the Camera Eye, lookAt and up Vectors
    180   gluLookAt(cameraPosition.x - delay.x, cameraPosition.y - delay.y, cameraPosition.z - delay.z,
     184  gluLookAt(cameraPosition.x, cameraPosition.y, cameraPosition.z,
    181185            targetPosition.x, targetPosition.y, targetPosition.z,
    182             up.x, up.y, up.z);
     186            this->upVector.x, this->upVector.y, this->upVector.z);
    183187
    184188
Note: See TracChangeset for help on using the changeset viewer.