Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/branches/physics/src/util/state.cc @ 4307

Last change on this file since 4307 was 4293, checked in by bensch, 20 years ago

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

File size: 1.2 KB
RevLine 
[3655]1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
[4293]12   main-programmer: Benjamin Grauer
[3655]13   co-programmer: ...
14*/
15
16//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
17
[4293]18#include "state.h"
[3655]19
20using namespace std;
21
22
23/**
24   \brief standard constructor
25*/
[4293]26State::State () 
[3655]27{
[4293]28   this->setClassName ("State");
[3655]29
[4293]30   this->camera = NULL;
31   this->cameraTarget = NULL;
[3655]32}
33
34/**
35   \brief the singleton reference to this class
36*/
[4293]37State* State::singletonRef = NULL;
[3655]38
39/**
40   \returns a Pointer to this Class
41*/
[4293]42State* State::getInstance(void)
[3655]43{
[4293]44  if (!State::singletonRef)
45    State::singletonRef = new State();
46  return State::singletonRef;
[3655]47}
48
49/**
50   \brief standard deconstructor
51
52*/
[4293]53State::~State () 
[3655]54{
[4293]55  State::singletonRef = NULL;
[3655]56
57}
[4293]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 TracBrowser for help on using the repository browser.