Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 4301 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
Line 
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:
12   main-programmer: Benjamin Grauer
13   co-programmer: ...
14*/
15
16//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
17
18#include "state.h"
19
20using namespace std;
21
22
23/**
24   \brief standard constructor
25*/
26State::State () 
27{
28   this->setClassName ("State");
29
30   this->camera = NULL;
31   this->cameraTarget = NULL;
32}
33
34/**
35   \brief the singleton reference to this class
36*/
37State* State::singletonRef = NULL;
38
39/**
40   \returns a Pointer to this Class
41*/
42State* State::getInstance(void)
43{
44  if (!State::singletonRef)
45    State::singletonRef = new State();
46  return State::singletonRef;
47}
48
49/**
50   \brief standard deconstructor
51
52*/
53State::~State () 
54{
55  State::singletonRef = NULL;
56
57}
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.