Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10110 in orxonox.OLD for branches/camera


Ignore:
Timestamp:
Dec 19, 2006, 11:24:58 PM (18 years ago)
Author:
gfilip
Message:

update

Location:
branches/camera/src/world_entities
Files:
2 edited

Legend:

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

    r10106 r10110  
    153153
    154154  //iterate(float dt, translate, target)
    155 
     155  target->translate( 1,dt);
    156156}
    157157
     
    289289
    290290SHELL_COMMAND(det, CameraTarget, detach);
     291SHELL_COMMAND(tes, CameraTarget, test);
     292
    291293
    292294
     
    326328{
    327329
    328   //this condititon if needed in tick:    if (tmpVec.x >= 0.01)
     330
    329331  Vector tmpVec;
    330332  tmpVec= (*target - *cam);
     
    335337
    336338
    337 void CameraTarget::translate(Vector* newPos, float speed, float dt)
    338 {
    339   if (translateTo.x >= 0.01+this->getAbsCoorX())
    340   {
    341     Vector tmpVec= iterate(dt,  newPos,  &(State::getCameraNode()->getAbsCoor()));
    342   glTranslatef(tmpVec.x, tmpVec.y, tmpVec.z);
     339void CameraTarget::translate(float speed, float dt)
     340{
     341  if (translateTo.x >= 0.01+State::getCameraNode()->getAbsCoorX() || translateTo.y
     342      >= 0.01+State::getCameraNode()->getAbsCoorX() || translateTo.z
     343      >= 0.01+State::getCameraNode()->getAbsCoorX())
     344  {
     345    Vector tmpVec= iterate(dt,  &translateTo,  &(State::getCameraNode()->getAbsCoor()));
     346    glLoadIdentity();
     347    glTranslatef(tmpVec.x, tmpVec.y, tmpVec.z);
    343348  }
    344349}
     
    352357{
    353358
     359}
     360
     361void CameraTarget::translateNow(Vector* vec)
     362{
     363translateTo=*vec;
    354364}
    355365
     
    360370  return;
    361371}
     372
     373
     374void CameraTarget::test()
     375{
     376//Vector* vec=new Vector(100,100,100);
     377  //translateNow(vec);
     378  glMatrixMode (GL_PROJECTION);
     379  glLoadIdentity();
     380  glTranslatef(100, 100, 100);
     381}
  • branches/camera/src/world_entities/camera.h

    r10105 r10110  
    101101  void atach(PNode* object);
    102102  Vector iterate(float dt, const Vector* target, const Vector* cam);
    103   void translate(Vector* newPos, float speed, float dt);
     103  void translate(float speed, float dt);
    104104  void changeSpeed(float speed);
    105105  Vector* rotate(Vector* newPos, float speed);
    106106  void jump(Vector* newPos);
     107  void test();
     108  void translateNow(Vector* vec);
    107109};
    108110
Note: See TracChangeset for help on using the changeset viewer.