Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10236 in orxonox.OLD for branches/camera


Ignore:
Timestamp:
Jan 14, 2007, 9:35:08 PM (18 years ago)
Author:
gfilip
Message:

another update :)

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

Legend:

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

    r10220 r10236  
    108108glEnable(GL_BLEND);     // Turn Blending On
    109109
    110 
     110//
     111//  Coord schould depend on CameraTarget
     112//
     113//
     114//
    111115
    112116glColor4f(0, 0, 0, i);
  • branches/camera/src/world_entities/camera.cc

    r10206 r10236  
    2222#include "shell_command.h"
    2323#include "targets.h"
    24 #include <iostream.h>
     24
    2525
    2626
     
    324324void CameraTarget::detach()
    325325{
    326   glLoadIdentity();
    327 
    328 //Movemet
    329   State::getCameraNode()->setParentSoft(PNode::getNullParent());
    330 
    331 //LookAt
    332  // State::getCameraTargetNode()->setParentSoft(PNode::getNullParent());
     326  State::getCameraNode()->setParentSoft(target);
     327  State::getCameraTargetNode()->setParentSoft(target);
    333328}
    334329
     
    344339  State::getCameraTargetNode()->setParentSoft(object);
    345340}
     341
     342
    346343
    347344
     
    366363    glLoadIdentity();
    367364    target->shiftCoor(speed*tmpVec.x, speed*tmpVec.y, speed*tmpVec.z);
    368     // cout << "%%" << tmpVec.x << "%%";
    369365
    370366  }
     
    403399void CameraTarget::test()
    404400{
    405   glLoadIdentity();
     401glLoadIdentity();
    406402
    407403atach(target);
    408404
    409 //tar->setRelCoorSoft(1000,1000,1000);
    410 
    411 
    412   //Vector* vec=new Vector(5000,5000,5000);
    413   //translateNow(vec);
    414   //glMatrixMode (GL_MODELVIEW);
    415   //glLoadIdentity();
    416   //glTranslatef(100, 100, 100);
    417  // State::getCamera()->getTargetNode()->setRelCoor(100,100,100);
    418405}
    419406
     
    422409{
    423410  trans(-200, 0, 0);
    424   //target->setAbsCoor(target->getAbsCoorX()-200, target->getAbsCoorY(), target->getAbsCoorZ());
    425 }
    426 
    427 
     411}
     412
     413
  • branches/camera/src/world_entities/camera.h

    r10206 r10236  
    9595  float speed;
    9696  PNode* target;
     97  PNode* freeTarget;
    9798
    9899public:
  • branches/camera/src/world_entities/cameraman.cc

    r10206 r10236  
    2626  currentCam=State::getCamera();
    2727  this->cameras.push_back(currentCam);
     28  currentCam->target->detach();
    2829
    2930}
     
    3435  Camera* newCamera=new Camera();
    3536  this->cameras.push_back(newCamera);
    36   //cameraList.size();
    37   //cameraList[4]
     37  newCamera->target->detach();
    3838}
    3939
     
    6464void cameraman::changeTarget(int camNo, PNode* target)
    6565{
    66   cameras[camNo]->target->atach(target);
     66  cameras[camNo]->lookAt(target);
    6767}
    6868
    6969
    7070void cameraman::changeCurrTarget(PNode* target)
     71{
     72  currentCam->lookAt(target);
     73}
     74
     75void cameraman::atachCurrTarget(PNode* target)
    7176{
    7277  currentCam->target->atach(target);
  • branches/camera/src/world_entities/cameraman.h

    r10206 r10236  
    2222    void changeTarget(int camNo, PNode* target);
    2323    void changeCurrTarget(PNode* target);
     24    void atachCurrTarget(PNode* target);
    2425    void jumpCam(int x, int y, int z, int camNo);
    2526    void jumpCurrCam(int x, int y, int z);
  • branches/camera/src/world_entities/test_entity.cc

    r10212 r10236  
    2525
    2626
    27 #include "material.h"
    28 
    2927#include "state.h"
    3028
     
    3533CREATE_FACTORY(TestEntity);
    3634
    37 float i=0;
    38 bool state=1;
     35
    3936
    4037/**
     
    7370  this->registerObject(this, TestEntity::_objectList);
    7471  this->toList(OM_GROUP_00);
     72  CM= new cameraman();
     73  test();
     74}
    7575
    76   /*this->material = new Material();
    77   this->material->setIllum(3);
    78   this->material->setDiffuse(1.0,1.0,1.0);
    79   this->material->setSpecular(0.0,0.0,0.0);
    80   this->material->setAmbient(1.0, 1.0, 1.0);
    81   this->material->setDiffuseMap("maps/TE2.tga");*/
     76void TestEntity::test()
     77{
     78  CM->moveCurrCam(-200, 0, 0);
     79  CM->createCam();
     80  CM->moveCam(0, -200, 0, 1);
    8281}
     82
    8383
    8484
     
    9494void TestEntity::draw() const
    9595{
    96 //   if(!mediaLoaded)
    97 //     false;
    9896
    99 //  glPushAttrib(GL_ENABLE_BIT);
    100 //  glDisable(GL_LIGHTING);
    101 //   glDisable(GL_BLEND);
    102 //
    103 //   glEnable(GL_TEXTURE_2D);
    104 //   glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
    105 
    106 //  glPushMatrix();
    107  /* glTranslatef (this->getAbsCoor ().x,
    108                 this->getAbsCoor ().y,
    109                 this->getAbsCoor ().z);
    110   glRotatef(axis, 0.0f, 1.0f, 0.0f);*/
    111 //PRINTF(0)("axis: %f\n", axis);
    112 //glEnable(GL_BLEND);   // Turn Blending On
    113 
    114 
    115 
    116 //glColor4f(0, 0, 0, i);
    117 
    118 //  glBegin(GL_QUADS);
    119 //    glVertex3f(-1.0f, -100.0f, -100.0f);
    120 //     glTexCoord2f(1.0f, 1.0f);
    121 //    glVertex3f(-1.0f, -100.0f, 100.0f);
    122 //     glTexCoord2f(0.0f, 1.0f);
    123 //    glVertex3f(-1.0f, 100.0f, 100.0f);
    124 //     glTexCoord2f(0.0f, 0.0f);
    125 //    glVertex3f(-1.0f, 100.0f, -100.0f);
    126 //     glTexCoord2f(1.0f, 0.0f);
    127 
    128 //  glEnd();
    129 
    130 //  glPopMatrix();
    131 //  glPopAttrib();
    13297}
    13398
     
    137102void TestEntity::tick (float time)
    138103{
    139 //  if (state==0 && i==1)
    140 //    i=0;
    141 //  if (state==1 && i<=1)
    142 //    i=i+0.005;
     104
    143105}
    144106
     
    146108void  TestEntity::changeState (bool sta)
    147109{
    148   state=sta;
     110
    149111}
  • branches/camera/src/world_entities/test_entity.h

    r10065 r10236  
    33
    44#include "world_entity.h"
     5#include "cameraman.h"
    56
    67class TiXmlElement;
     
    1314  private:
    1415
    15     Material*       material;
     16  cameraman* CM;
    1617
    1718  public:
     
    2223    void init();
    2324    virtual void loadParams(const TiXmlElement* root);
    24 
     25    void test();
    2526    void changeState (bool);
    2627    virtual void tick (float time);
Note: See TracChangeset for help on using the changeset viewer.