Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10238 in orxonox.OLD for branches


Ignore:
Timestamp:
Jan 16, 2007, 7:55:24 PM (18 years ago)
Author:
gfilip
Message:

black camera

Location:
branches/camera/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/camera/src/story_entities/game_world.cc

    r9869 r10238  
    548548void GameWorld::applyCameraSettings()
    549549{
    550   this->dataTank->localCamera->apply ();
    551   this->dataTank->localCamera->project ();
     550
     551  State::getCamera()->apply ();
     552  State::getCamera()->project ();
     553  //this->dataTank->localCamera->apply ();
     554  //this->dataTank->localCamera->project ();
    552555  GraphicsEngine::storeMatrices();
    553556}
  • branches/camera/src/world_entities/blackscreen.cc

    r10236 r10238  
    5050  if( root != NULL)
    5151    this->loadParams(root);
    52   i=0;
     52  i=0.5;
    5353  state=0;
    5454}
     
    115115
    116116glColor4f(0, 0, 0, i);
    117 this->material->select();
     117/*this->material->select();
    118118  glBegin(GL_QUADS);
    119119  glVertex3f(State::getCameraNode()->getAbsCoorX()+3,State::getCameraNode()->getAbsCoorY() -100.0f,
     
    125125  glVertex3f(State::getCameraNode()->getAbsCoorX()+3, State::getCameraNode()->getAbsCoorY()+100.0f,
    126126             State::getCameraNode()->getAbsCoorZ()-100.0f);
     127*/
     128
     129 glBegin(GL_QUADS);
     130glVertex3f(0,-100.0f,-100.0f);
     131glVertex3f(0,-100.0f,+100.0f);
     132glVertex3f(0,+100.0f,+100.0f);
     133glVertex3f(0,+100.0f,-100.0f);
     134
    127135
    128136
  • branches/camera/src/world_entities/camera.cc

    r10236 r10238  
    1919#include "glincl.h"
    2020#include "vector.h"
    21 #include "state.h"
    2221#include "shell_command.h"
    2322#include "targets.h"
     
    3736  this->setName("camera");
    3837  this->target = new CameraTarget();
    39 
     38  this->target->masta=this;
    4039  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW0);
    4140  this->subscribeEvent(ES_GAME, KeyMapper::PEV_VIEW1);
     
    318317  rotateBy.z=0;
    319318  target=createStick();
    320 
    321319}
    322320
     
    324322void CameraTarget::detach()
    325323{
    326   State::getCameraNode()->setParentSoft(target);
    327   State::getCameraTargetNode()->setParentSoft(target);
     324  masta->setParentSoft(target);
     325  masta->getTargetNode()->setParentSoft(target);
    328326}
    329327
     
    336334void CameraTarget::atach(PNode* object)
    337335{
    338   State::getCameraNode()->setParentSoft(object);
    339   State::getCameraTargetNode()->setParentSoft(object);
    340 }
    341 
    342 
    343 
    344 
    345 Vector CameraTarget::iterate(float dt, const Vector* target, const Vector* cam)
     336  masta->setParentSoft(object);
     337  masta->getTargetNode()->setParentSoft(object);
     338}
     339
     340
     341
     342
     343Vector CameraTarget::iterate(float dt, const Vector* Target, const Vector* cam)
    346344{
    347345
    348346
    349347  Vector tmpVec;
    350   tmpVec= (*target - *cam);
     348  tmpVec= (*Target - *cam);
    351349  tmpVec.normalize();
    352350  return  tmpVec;
     
    360358 {
    361359
    362    Vector tmpVec= iterate(dt,  &translateTo,  &(State::getCameraNode()->getAbsCoor()));
     360   Vector tmpVec= iterate(dt,  &translateTo,  &(masta->getAbsCoor()));
    363361    glLoadIdentity();
    364362    target->shiftCoor(speed*tmpVec.x, speed*tmpVec.y, speed*tmpVec.z);
     
    399397void CameraTarget::test()
    400398{
    401 glLoadIdentity();
    402 
    403 atach(target);
    404 
     399  atach(target);
    405400}
    406401
  • branches/camera/src/world_entities/camera.h

    r10236 r10238  
    9696  PNode* target;
    9797  PNode* freeTarget;
     98  Camera* masta;
     99  Vector translateTo;
     100  Vector rotateBy;
     101
    98102
    99103public:
    100   Vector translateTo;
    101   Vector rotateBy;
     104
    102105  void detach();
    103106  void atach(PNode* object);
  • branches/camera/src/world_entities/cameraman.cc

    r10236 r10238  
    1616#include "shell_command.h"
    1717#include "cameraman.h"
    18 
     18#include "game_world_data.h"
    1919#include "state.h"
    20 
     20#include "iostream.h"
    2121
    2222
     
    2424cameraman::cameraman()
    2525{
     26  cout << "TTTT*" << cameras.size();
    2627  currentCam=State::getCamera();
    2728  this->cameras.push_back(currentCam);
    2829  currentCam->target->detach();
    29 
     30  cout << "TTTT*" << cameras.size();
     31  State::setCamera(currentCam, currentCam->getTarget());
    3032}
    3133
     
    3335void cameraman::createCam()
    3436{
    35   Camera* newCamera=new Camera();
    36   this->cameras.push_back(newCamera);
    37   newCamera->target->detach();
     37 // Camera* newCamera=new Camera();
     38  this->cameras.push_back(new Camera());
     39  //cameras[cameras.size()-1]->target->detach();
     40
    3841}
    3942
     
    4245  if (cameraNo<cameras.size())
    4346  {
     47  cout << "TTTTT" << currentCam << "TTTT \n";
    4448  currentCam=cameras[cameraNo];
     49  cout << "TTTT" << currentCam << "*" << cameras.size() << "*TTTTT\n" ;
    4550  State::setCamera(currentCam, currentCam->getTarget());
     51  cout << cameras[0];
    4652  }
    4753
  • branches/camera/src/world_entities/test_entity.cc

    r10236 r10238  
    2626
    2727#include "state.h"
    28 
    29 
     28#include "shell_command.h"
     29#include "game_world_data.h"
    3030
    3131#include "class_id_DEPRECATED.h"
     
    4343}
    4444
     45
     46SHELL_COMMAND(test, TestEntity,test);
     47SHELL_COMMAND(t2, TestEntity,t2);
     48SHELL_COMMAND(t3, TestEntity,t3);
     49SHELL_COMMAND(t4, TestEntity, t4);
     50SHELL_COMMAND(t5, TestEntity,t5);
    4551
    4652/**
     
    7076  this->registerObject(this, TestEntity::_objectList);
    7177  this->toList(OM_GROUP_00);
    72   CM= new cameraman();
    73   test();
     78
    7479}
    7580
    7681void TestEntity::test()
    7782{
    78   CM->moveCurrCam(-200, 0, 0);
     83  CM= new cameraman();
    7984  CM->createCam();
    80   CM->moveCam(0, -200, 0, 1);
     85  //CM->moveCurrCam(-300, 0, 0);
     86  CM->moveCam(-300, 0, 0, 0);
     87}
     88
     89void TestEntity::t2()
     90{
     91  CM->moveCurrCam(+600, 0, 0);
     92
     93}
     94
     95void TestEntity::t3()
     96{
     97
     98  CM->setCam(1);
     99}
     100
     101void TestEntity::t4()
     102{
     103  CM->moveCurrCam(-500,0,0);
     104}
     105
     106void TestEntity::t5()
     107{
     108  CM->setCam(0);
    81109}
    82110
  • branches/camera/src/world_entities/test_entity.h

    r10236 r10238  
    2424    virtual void loadParams(const TiXmlElement* root);
    2525    void test();
     26    void t2();
     27    void t3();
     28    void t4();
     29    void t5();
    2630    void changeState (bool);
    2731    virtual void tick (float time);
Note: See TracChangeset for help on using the changeset viewer.