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 | |
---|
19 | #include "state.h" |
---|
20 | |
---|
21 | |
---|
22 | |
---|
23 | |
---|
24 | cameraman::cameraman() |
---|
25 | { |
---|
26 | currentCam=State::getCamera(); |
---|
27 | this->cameras.push_back(currentCam); |
---|
28 | currentCam->target->detach(); |
---|
29 | |
---|
30 | } |
---|
31 | |
---|
32 | |
---|
33 | void cameraman::createCam() |
---|
34 | { |
---|
35 | Camera* newCamera=new Camera(); |
---|
36 | this->cameras.push_back(newCamera); |
---|
37 | newCamera->target->detach(); |
---|
38 | } |
---|
39 | |
---|
40 | void cameraman::setCam(int cameraNo) |
---|
41 | { |
---|
42 | if (cameraNo<cameras.size()) |
---|
43 | { |
---|
44 | currentCam=cameras[cameraNo]; |
---|
45 | State::setCamera(currentCam, currentCam->getTarget()); |
---|
46 | } |
---|
47 | |
---|
48 | } |
---|
49 | |
---|
50 | |
---|
51 | |
---|
52 | void cameraman::moveCurrCam(int x, int y, int z) |
---|
53 | { |
---|
54 | currentCam->target->trans(x,y,z); |
---|
55 | } |
---|
56 | |
---|
57 | |
---|
58 | void cameraman::moveCam(int x, int y, int z, int camNo) |
---|
59 | { |
---|
60 | cameras[camNo]->target->trans(x,y,z); |
---|
61 | } |
---|
62 | |
---|
63 | |
---|
64 | void cameraman::changeTarget(int camNo, PNode* target) |
---|
65 | { |
---|
66 | cameras[camNo]->lookAt(target); |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | void cameraman::changeCurrTarget(PNode* target) |
---|
71 | { |
---|
72 | currentCam->lookAt(target); |
---|
73 | } |
---|
74 | |
---|
75 | void cameraman::atachCurrTarget(PNode* target) |
---|
76 | { |
---|
77 | currentCam->target->atach(target); |
---|
78 | } |
---|
79 | |
---|
80 | void cameraman::jumpCam(int x, int y, int z, int camNo) |
---|
81 | { |
---|
82 | cameras[camNo]->target->jump(x, y, z); |
---|
83 | } |
---|
84 | |
---|
85 | |
---|
86 | void cameraman::jumpCurrCam(int x, int y, int z) |
---|
87 | { |
---|
88 | currentCam->target->jump(x, y, z); |
---|
89 | } |
---|
90 | |
---|
91 | |
---|
92 | |
---|
93 | |
---|
94 | |
---|
95 | |
---|
96 | |
---|
97 | |
---|
98 | |
---|
99 | |
---|
100 | |
---|
101 | |
---|
102 | |
---|
103 | |
---|
104 | |
---|
105 | |
---|
106 | |
---|
107 | |
---|
108 | |
---|
109 | |
---|
110 | |
---|
111 | |
---|
112 | |
---|