Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jan 7, 2006, 11:07:22 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the branche network back to the trunk
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/network . -r 6351:HEAD
no conflicts

File:
1 edited

Legend:

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

    r6222 r6424  
    1111   ### File Specific:
    1212   main-programmer: Christian Meyer
    13    co-programmer: ...
     13   co-programmer: Benjamin Grauer
    1414*/
    1515#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
     
    1717#include "camera.h"
    1818
    19 #include "world.h"
    20 #include "world_entity.h"
    21 #include "vector.h"
    22 #include "event.h"
    2319#include "event_handler.h"
    2420
    2521using namespace std;
    2622
    27 ////////////
    28 // CAMERA //
    29 ////////////
    3023
    3124/**
     
    5851*/
    5952Camera::~Camera()
    60 {
    61 }
     53{}
    6254
    6355/**
     
    115107  currentMode = mode;
    116108  switch (mode)
    117     {
     109  {
    118110    default:
    119111    case VIEW_NORMAL:
    120112      this->toFovy = 60.0;
    121 /*      this->setParentSoft("TrackNode");
    122       this->target->setParentSoft("TrackNode"); */
     113      /*      this->setParentSoft("TrackNode");
     114            this->target->setParentSoft("TrackNode"); */
    123115      this->setRelCoorSoft(-10, 5, 0);
    124116      this->target->setRelCoorSoft(0,0,0);
    125117      break;
    126118    case VIEW_BEHIND:
    127 //      this->toFovy = 120.0;
    128 //      this->setRelCoorSoft(Vector(3.5, 0, 0));
    129   //    this->target->setRelCoorSoft(Vector(10,0,0));
    130 
    131 //       if (!strcmp(this->target->getParent()->getName(), "Player"))
    132 //         this->target->setParentSoft("TrackNode");
    133 //       else
    134 //         this->target->setParentSoft("Player");
    135 //       this->getParent()->debugNode(0);
    136 
    137 //      this->setParent("main-Turret");
    138 //      this->setParentMode(PNODE_ALL);
    139 //      this->target->setParentSoft("Player");
     119      //      this->toFovy = 120.0;
     120      //      this->setRelCoorSoft(Vector(3.5, 0, 0));
     121      //    this->target->setRelCoorSoft(Vector(10,0,0));
     122
     123      //       if (!strcmp(this->target->getParent()->getName(), "Player"))
     124      //         this->target->setParentSoft("TrackNode");
     125      //       else
     126      //         this->target->setParentSoft("Player");
     127      //       this->getParent()->debugNode(0);
     128
     129      //      this->setParent("main-Turret");
     130      //      this->setParentMode(PNODE_ALL);
     131      //      this->target->setParentSoft("Player");
    140132
    141133      break;
    142134    case VIEW_FRONT:
    143135      this->toFovy = 120.0;
    144 /*       this->setParentSoft("Player");
    145        this->target->setParentSoft("Player");*/
    146        this->setRelCoorSoft(4, 0, 0, 5);
    147        this->target->setRelCoorSoft(Vector(10,0,0), 5);
    148 //      this->target->setRelDirSoft(Quaternion(M_PI/4.0, Vector(0,1,0)));
     136      /*       this->setParentSoft("Player");
     137             this->target->setParentSoft("Player");*/
     138      this->setRelCoorSoft(4, 0, 0, 5);
     139      this->target->setRelCoorSoft(Vector(10,0,0), 5);
     140      //      this->target->setRelDirSoft(Quaternion(M_PI/4.0, Vector(0,1,0)));
    149141      break;
    150142    case VIEW_LEFT:
    151143      this->toFovy = 90;
    152 /*      this->setParentSoft("TrackNode");
    153       this->target->setParentSoft("TrackNode");*/
     144      /*      this->setParentSoft("TrackNode");
     145            this->target->setParentSoft("TrackNode");*/
    154146      this->setRelCoorSoft(0, 1, -10, .5);
    155147      this->target->setRelCoorSoft(0,0,0);
     
    157149    case VIEW_RIGHT:
    158150      this->toFovy = 90;
    159 /*      this->setParentSoft("TrackNode");
    160       this->target->setParentSoft("TrackNode");*/
     151      /*      this->setParentSoft("TrackNode");
     152            this->target->setParentSoft("TrackNode");*/
    161153      this->setRelCoorSoft(Vector(0, 1, 10));
    162154      this->target->setRelCoorSoft(0,0,0);
     
    164156    case VIEW_TOP:
    165157      this->toFovy= 120;
    166 /*      this->setParentSoft("TrackNode");
    167       this->target->setParentSoft("TrackNode");*/
     158      /*      this->setParentSoft("TrackNode");
     159            this->target->setParentSoft("TrackNode");*/
    168160      this->setRelCoorSoft(Vector(30, 50, 0));
    169161      this->target->setRelCoorSoft(35,0,0);
    170     }
     162  }
    171163}
    172164
     
    216208  // switching back to Modeling Matrix
    217209  glMatrixMode (GL_MODELVIEW);
    218 //  this->target->getParent()->getParent()->debugDraw(0, 2, Vector(1,0,0));
     210  //  this->target->getParent()->getParent()->debugDraw(0, 2, Vector(1,0,0));
    219211}
    220212
     
    226218{
    227219  if( event.type == KeyMapper::PEV_VIEW0)
    228     {
    229       this->setViewMode(VIEW_NORMAL);
    230     }
     220  {
     221    this->setViewMode(VIEW_NORMAL);
     222  }
    231223  else if( event.type == KeyMapper::PEV_VIEW1)
    232     {
    233       this->setViewMode(VIEW_BEHIND);
    234     }
     224  {
     225    this->setViewMode(VIEW_BEHIND);
     226  }
    235227  else if( event.type == KeyMapper::PEV_VIEW2)
    236     {
    237       this->setViewMode(VIEW_FRONT);
    238     }
     228  {
     229    this->setViewMode(VIEW_FRONT);
     230  }
    239231  else if( event.type == KeyMapper::PEV_VIEW3)
    240     {
    241       this->setViewMode(VIEW_LEFT);
    242     }
     232  {
     233    this->setViewMode(VIEW_LEFT);
     234  }
    243235  else if( event.type == KeyMapper::PEV_VIEW4)
    244     {
    245       this->setViewMode(VIEW_RIGHT);
    246     }
     236  {
     237    this->setViewMode(VIEW_RIGHT);
     238  }
    247239  else if( event.type == KeyMapper::PEV_VIEW5)
    248     {
    249       this->setViewMode(VIEW_TOP);
    250     }
     240  {
     241    this->setViewMode(VIEW_TOP);
     242  }
    251243}
    252244
     
    260252{
    261253  this->setClassID(CL_CAMERA_TARGET, "CameraTarget");
    262 //  this->setParentMode(PNODE_MOVEMENT);
    263 }
    264 
     254  //  this->setParentMode(PNODE_MOVEMENT);
     255}
     256
Note: See TracChangeset for help on using the changeset viewer.