Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4293 in orxonox.OLD for orxonox/branches/physics/src/util/state.cc


Ignore:
Timestamp:
May 26, 2005, 10:34:14 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/physics: intoducing state: stors the Camera position globally somewhere we have to store this data

File:
1 copied

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/util/state.cc

    r4289 r4293  
    1010
    1111   ### File Specific:
    12    main-programmer: ...
     12   main-programmer: Benjamin Grauer
    1313   co-programmer: ...
    1414*/
     
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
    1717
    18 #include "proto_singleton.h"
     18#include "state.h"
    1919
    2020using namespace std;
     
    2424   \brief standard constructor
    2525*/
    26 ProtoSingleton::ProtoSingleton ()
     26State::State ()
    2727{
    28    this->setClassName ("ProtoSingleton");
     28   this->setClassName ("State");
    2929
     30   this->camera = NULL;
     31   this->cameraTarget = NULL;
    3032}
    3133
     
    3335   \brief the singleton reference to this class
    3436*/
    35 ProtoSingleton* ProtoSingleton::singletonRef = NULL;
     37State* State::singletonRef = NULL;
    3638
    3739/**
    3840   \returns a Pointer to this Class
    3941*/
    40 ProtoSingleton* ProtoSingleton::getInstance(void)
     42State* State::getInstance(void)
    4143{
    42   if (!ProtoSingleton::singletonRef)
    43     ProtoSingleton::singletonRef = new ProtoSingleton();
    44   return ProtoSingleton::singletonRef;
     44  if (!State::singletonRef)
     45    State::singletonRef = new State();
     46  return State::singletonRef;
    4547}
    4648
     
    4951
    5052*/
    51 ProtoSingleton::~ProtoSingleton ()
     53State::~State ()
    5254{
    53   ProtoSingleton::singletonRef = NULL;
     55  State::singletonRef = NULL;
    5456
    5557}
     58
     59/**
     60   \sets camera and target of the current Camera
     61*/
     62void State::setCamera(const PNode* camera, const PNode* cameraTarget)
     63{
     64  this->camera = camera;
     65  this->cameraTarget = cameraTarget;
     66}
Note: See TracChangeset for help on using the changeset viewer.