Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10259 in orxonox.OLD for branches


Ignore:
Timestamp:
Jan 17, 2007, 3:46:05 PM (18 years ago)
Author:
gfilip
Message:

the skybox problem

Location:
branches/camera/src
Files:
7 edited

Legend:

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

    r9869 r10259  
    7070  this->glmis = NULL;
    7171
    72   this->localCamera = NULL;
     72
    7373  this->localPlayer = NULL;
    7474  this->sky = NULL;
     
    9898
    9999  PNode::getNullParent();
    100   this->localCamera = new Camera();
    101   this->localCamera->setName ("GameWorld-Camera");
    102   State::setCamera(this->localCamera, this->localCamera->getTarget());
     100  Camera* localCamera = new Camera();
     101  localCamera->setName ("GameWorld-Camera");
     102  State::setCamera(localCamera, localCamera->getTarget());
    103103
    104104  LightManager::getInstance();
     
    232232  State::setPlayer(this->localPlayer);
    233233
    234   Playable* playable;
    235234  if (!Playable::objectList().empty())
    236235  {
     
    284283  State::setPlayer(NULL);
    285284  this->localPlayer = NULL;
    286   this->localCamera = NULL;
    287285  State::setCamera(NULL, NULL);
    288286  this->sky = NULL;
     
    334332  LoadParamXML(root, "GameRule", this, GameWorldData, loadGameRule);
    335333
    336   LoadParam(root, "clip-region", this->localCamera, Camera, setClipRegion);
     334  LoadParam(root, "clip-region", State::getCamera(), Camera, setClipRegion);
    337335
    338336
     
    340338  //LoadParamXML(root, "PhysicsEngine", PhysicsEngine::getInstance(), PhysicsEngine, loadParams);
    341339
    342   if( this->sky != NULL)
    343     this->localCamera->addChild(this->sky);
    344   OrxSound::SoundEngine::getInstance()->setListener(this->localCamera);
     340
     341  OrxSound::SoundEngine::getInstance()->setListener(State::getCamera());
    345342
    346343  return ErrorMessage();
  • branches/camera/src/story_entities/game_world_data.h

    r9869 r10259  
    5656    GLMenuImageScreen*            glmis;          //!< The Level-Loader Display
    5757
    58     Camera*                       localCamera;    //!< The current camera
     58
    5959    Player*                       localPlayer;    //!< The player, you fly through the level.
    6060    WorldEntity*                  sky;            //!< The environmental sky of orxonox
  • branches/camera/src/story_entities/menu/game_menu.cc

    r9869 r10259  
    110110  this->subscribeEvent(ES_MENU, SDLK_ESCAPE);
    111111
    112   this->dataTank->localCamera->setRelCoor(this->cameraVector);
     112  State::getCamera()->setRelCoor(this->cameraVector);
    113113
    114114  GraphicsEngine::getInstance()->displayFPS(false);
     
    390390  Quaternion q(/*0.00005*/ dt * .1, Vector(0.0, 1.0, 0.0));
    391391  this->cameraVector = q.apply(this->cameraVector);
    392   this->dataTank->localCamera->setRelCoor(this->cameraVector);
    393   this->dataTank->localCamera->getTarget()->setRelCoorSoft(0,0,0);
     392  State::getCamera()->setRelCoor(this->cameraVector);
     393  State::getCamera()->getTarget()->setRelCoorSoft(0,0,0);
    394394}
    395395
  • branches/camera/src/world_entities/cameraman.cc

    r10257 r10259  
    1919#include "state.h"
    2020#include "iostream.h"
    21 
     21#include "sound_engine.h"
    2222
    2323
     
    3636  this->cameras.push_back(new Camera());
    3737  cameras[cameras.size()-1]->target->detach();
     38
     39
     40
    3841  cout << cameras[1]->getAbsCoorX() << "," << cameras[1]->getAbsCoorY() << "," << cameras[1]->getAbsCoorZ() << endl << cameras[1]->target->getAbsCoorX() << endl;
    3942
     
    4649  currentCam=cameras[cameraNo];
    4750  State::setCamera(currentCam, currentCam->getTarget());
     51  OrxSound::SoundEngine::getInstance()->setListener(currentCam);
     52
    4853  }
    4954
  • branches/camera/src/world_entities/skybox.cc

    r9869 r10259  
    3030
    3131#include "debug.h"
     32
     33#include "state.h"
     34#include "playable.h"
     35#include "player.h"
    3236
    3337#include "class_id_DEPRECATED.h"
     
    220224{
    221225  this->size = size;
     226}
     227
     228
     229
     230void SkyBox::tick(float dt)
     231{
     232  PRINTF(0)("tick\n");
     233
     234  Player* pl = State::getPlayer();
     235  if( pl == NULL)
     236    return;
     237
     238  Playable* playable = pl->getPlayable();
     239  if( playable == NULL)
     240    return;
     241
     242  if( this->getParent() != playable)
     243    this->setParent( playable);
    222244}
    223245
  • branches/camera/src/world_entities/skybox.h

    r9869 r10259  
    4242
    4343  virtual void draw();
     44  virtual void tick(float dt);
    4445
    4546  void setSize(float size);
  • branches/camera/src/world_entities/test_entity.cc

    r10257 r10259  
    8888void TestEntity::t2()
    8989{
    90   CM->moveCurrCam(+600, 0, 0);
     90  CM->moveCurrCam(0, -150, 0);
    9191
    9292}
Note: See TracChangeset for help on using the changeset viewer.