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