Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3643 in orxonox.OLD


Ignore:
Timestamp:
Mar 23, 2005, 11:20:29 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better views with Camera

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

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

    r3642 r3643  
    104104    case VIEW_NORMAL:
    105105      this->toFovy = 60.0;
    106       this->toRelCoor = Vector (-10, 5, 0);
     106      this->toRelCoor = Vector(-10, 5, 0);
    107107      break;
    108108    case VIEW_BEHIND:
    109       this->toFovy = 90.0;
    110       this->toRelCoor = Vector (-6, 2, 0);
     109      this->toFovy = 120.0;
     110      this->toRelCoor = Vector(-7, 0, 0);
    111111      break;
    112112    case VIEW_FRONT:
    113113      this->toFovy = 95.0;
    114       this->toRelCoor = Vector (10, 5, 0);
     114      this->toRelCoor = Vector(12, 5, 0);
    115115      break;
    116116    case VIEW_LEFT:
    117117      this->toFovy = 90;
    118       this->toRelCoor = Vector (0, 2, -10);
     118      this->toRelCoor = Vector(0, 2, -10);
    119119      break;
    120120    case VIEW_RIGHT:
    121121      this->toFovy = 90;
    122       this->toRelCoor = Vector (0, 2, 10);
     122      this->toRelCoor = Vector(0, 2, 10);
    123123      break;
     124    case VIEW_TOP:
     125      this->toFovy= 120;
     126      this->toRelCoor = Vector(0, 4, 0);
    124127    }
    125128}
     
    132135void Camera::tick(float dt)
    133136{
    134   dt /= 1000;
     137  dt /= 500;
    135138  this->fovy += (this->toFovy - this->fovy) * dt;
    136139  Vector tmp = this->getRelCoor() + (this->toRelCoor - this->getRelCoor()) * dt;
  • orxonox/trunk/src/camera.h

    r3641 r3643  
    1313class CameraTarget;
    1414
    15 enum ViewMode{VIEW_NORMAL, VIEW_BEHIND, VIEW_FRONT, VIEW_LEFT, VIEW_RIGHT};
     15enum ViewMode{VIEW_NORMAL, VIEW_BEHIND, VIEW_FRONT, VIEW_LEFT, VIEW_RIGHT, VIEW_TOP};
    1616
    1717//! Camera
  • orxonox/trunk/src/orxonox.conf

    r3640 r3643  
    18184=view3
    19195=view4
     205=view5
  • orxonox/trunk/src/story_entities/world.cc

    r3641 r3643  
    305305            this->localCamera->setName ("camera");
    306306            this->localCamera->lookAt(this->localPlayer);
    307             Vector* cameraOffset = new Vector (-2, 2, 0);
    308             this->localCamera->setRelCoor (cameraOffset);
     307            this->localCamera->setParent(this->localPlayer);
    309308           
    310309            /*monitor progress*/
     
    341340
    342341            //localCamera->setParent(TrackNode::getInstance());
    343             tn->addChild (this->localCamera);
     342            tn->addChild(this->localCamera);
     343            //      localCamera->lookAt(tn);
    344344            this->localPlayer->setMode(PNODE_ALL);
    345345            //Vector* cameraOffset = new Vector (0, 5, -10);
     
    858858  else if( !strcmp( cmd->cmd, "view3")) this->localCamera->setViewMode(VIEW_LEFT);
    859859  else if( !strcmp( cmd->cmd, "view4")) this->localCamera->setViewMode(VIEW_RIGHT);
     860  else if( !strcmp( cmd->cmd, "view5")) this->localCamera->setViewMode(VIEW_TOP);
    860861 
    861862  return false;
Note: See TracChangeset for help on using the changeset viewer.