Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 19, 2006, 8:41:14 PM (17 years ago)
Author:
gfilip
Message:

just to be save ;) part 2

File:
1 edited

Legend:

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

    r10103 r10105  
    1919#include "glincl.h"
    2020#include "vector.h"
    21 #include <iostream.h>
    2221#include "state.h"
    2322#include "shell_command.h"
     
    145144  this->upVector =  this->getAbsDirV();
    146145
    147 
    148 
    149 
    150 
     146  // iteration for fovy
    151147  float tmpFovy = (this->toFovy - this->fovy);
    152148  if (tmpFovy > 0.01)
    153149    this->fovy += tmpFovy * fabsf(dt);
     150
     151
     152
     153
     154  //iterate(float dt, translate, target)
     155
    154156}
    155157
     
    225227}
    226228
    227 /*
    228 Vector* Camera::translate(Vector* newPos, float speed)
    229 {
    230 glTranslatef(Vector);
    231 
    232 }
    233 
    234 
    235 float Camera::iterate(float dt, Vector target)
    236 {
    237   Vector tmpVec = (this->getAbsCorr() - target);
    238   if (tmpVec > 0.01)
    239   Vector ret =  this->getAbsCorr;
    240  ret += tmpVec * fabsf(dt);
    241  return ret;
    242 }
    243 */
    244 void Camera::Rotate()
    245 {
    246 this->fovy=this->fovy+1;
    247 }
     229
    248230
    249231
     
    309291
    310292
    311 Vector translateTo(0,0,0);
    312 Vector rotateBy(0,0,0);
    313 float speed=1;
     293
     294
    314295
    315296CameraTarget::CameraTarget()
     
    317298  this->registerObject(this, CameraTarget::_objectList);
    318299  //  this->setParentMode(PNODE_MOVEMENT);
     300  this->speed=1;
     301  translateTo.x=0;
     302  translateTo.y=0;
     303  translateTo.z=0;
     304  rotateBy.x=0;
     305  rotateBy.y=0;
     306  rotateBy.z=0;
    319307
    320308
     
    347335
    348336
    349 Vector* CameraTarget::translate(Vector* newPos, float speed)
    350 {
    351 //glTranslatef(Vector);
    352 
    353 }
    354 
     337void CameraTarget::translate(Vector* newPos, float speed, float dt)
     338{
     339  if (translateTo.x >= this->getAbsCoorX())
     340  {
     341    iterate(dt, &(State::getCameraNode()->getAbsCoor()), newPos );
     342  glTranslatef(translateTo.x, translateTo.y, translateTo.z);
     343  }
     344}
     345
     346Vector * CameraTarget::rotate(Vector* newPos, float speed)
     347{
     348
     349}
     350
     351void CameraTarget::jump(Vector* newPos)
     352{
     353
     354}
    355355
    356356void CameraTarget::changeSpeed(float speed)
Note: See TracChangeset for help on using the changeset viewer.