Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/camera/src/world_entities/cameraman.cc @ 10255

Last change on this file since 10255 was 10254, checked in by gfilip, 18 years ago

hm…..

File size: 1.9 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: Filip Gospodinov
13   co-programmer:
14*/
15
16#include "shell_command.h"
17#include "cameraman.h"
18#include "game_world_data.h"
19#include "state.h"
20#include "iostream.h"
21
22
23
24cameraman::cameraman()
25{
26  currentCam=State::getCamera();
27  this->cameras.push_back(currentCam);
28  currentCam->target->detach();
29  State::setCamera(currentCam, currentCam->getTarget());
30}
31
32
33void cameraman::createCam()
34{
35 // Camera* newCamera=new Camera();
36  this->cameras.push_back(new Camera());
37  cameras[cameras.size()-1]->target->detach();
38
39}
40
41void cameraman::setCam(int cameraNo)
42{
43  if (cameraNo<cameras.size())
44  {
45  cout << "TTTTT" << currentCam << "TTTT \n";
46  currentCam=cameras[cameraNo];
47  cout << "TTTT" << currentCam << "*" << cameras.size() << "*TTTTT\n" ;
48  State::setCamera(currentCam, currentCam->getTarget());
49  cout << cameras[0];
50  }
51
52}
53
54
55void cameraman::testCam()
56{
57cameras[1]->lookAt(currentCam->getTarget());
58cameras[1]->setParentSoft(currentCam->getParent());
59}
60
61
62void cameraman::moveCurrCam(int x, int y, int z)
63{
64currentCam->target->trans(x,y,z);
65}
66
67
68void cameraman::moveCam(int x, int y, int z, int camNo)
69{
70cameras[camNo]->target->trans(x,y,z);
71}
72
73
74void cameraman::changeTarget(int camNo, PNode* target)
75{
76  cameras[camNo]->lookAt(target);
77}
78
79
80void cameraman::changeCurrTarget(PNode* target)
81{
82  currentCam->lookAt(target);
83}
84
85void cameraman::atachCurrTarget(PNode* target)
86{
87  currentCam->target->atach(target);
88}
89
90void cameraman::jumpCam(int x, int y, int z, int camNo)
91{
92  cameras[camNo]->target->jump(x, y, z);
93}
94
95
96void cameraman::jumpCurrCam(int x, int y, int z)
97{
98  currentCam->target->jump(x, y, z);
99}
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
Note: See TracBrowser for help on using the repository browser.