[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" |
---|
[10259] | 21 | #include "sound_engine.h" |
---|
[10192] | 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(); |
---|
[10259] | 38 | |
---|
| 39 | |
---|
| 40 | |
---|
[10257] | 41 | cout << cameras[1]->getAbsCoorX() << "," << cameras[1]->getAbsCoorY() << "," << cameras[1]->getAbsCoorZ() << endl << cameras[1]->target->getAbsCoorX() << endl; |
---|
[10238] | 42 | |
---|
[10192] | 43 | } |
---|
| 44 | |
---|
[10193] | 45 | void cameraman::setCam(int cameraNo) |
---|
[10192] | 46 | { |
---|
[10206] | 47 | if (cameraNo<cameras.size()) |
---|
[10197] | 48 | { |
---|
[10193] | 49 | currentCam=cameras[cameraNo]; |
---|
[10198] | 50 | State::setCamera(currentCam, currentCam->getTarget()); |
---|
[10259] | 51 | OrxSound::SoundEngine::getInstance()->setListener(currentCam); |
---|
| 52 | |
---|
[10197] | 53 | } |
---|
[10195] | 54 | |
---|
[10192] | 55 | } |
---|
| 56 | |
---|
[10195] | 57 | |
---|
[10254] | 58 | void cameraman::testCam() |
---|
| 59 | { |
---|
| 60 | cameras[1]->lookAt(currentCam->getTarget()); |
---|
| 61 | cameras[1]->setParentSoft(currentCam->getParent()); |
---|
| 62 | } |
---|
[10204] | 63 | |
---|
[10254] | 64 | |
---|
[10204] | 65 | void cameraman::moveCurrCam(int x, int y, int z) |
---|
| 66 | { |
---|
| 67 | currentCam->target->trans(x,y,z); |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | void cameraman::moveCam(int x, int y, int z, int camNo) |
---|
| 72 | { |
---|
| 73 | cameras[camNo]->target->trans(x,y,z); |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | |
---|
| 77 | void cameraman::changeTarget(int camNo, PNode* target) |
---|
| 78 | { |
---|
[10236] | 79 | cameras[camNo]->lookAt(target); |
---|
[10204] | 80 | } |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | void cameraman::changeCurrTarget(PNode* target) |
---|
| 84 | { |
---|
[10236] | 85 | currentCam->lookAt(target); |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | void cameraman::atachCurrTarget(PNode* target) |
---|
| 89 | { |
---|
[10205] | 90 | currentCam->target->atach(target); |
---|
[10204] | 91 | } |
---|
| 92 | |
---|
| 93 | void cameraman::jumpCam(int x, int y, int z, int camNo) |
---|
| 94 | { |
---|
[10206] | 95 | cameras[camNo]->target->jump(x, y, z); |
---|
[10204] | 96 | } |
---|
| 97 | |
---|
| 98 | |
---|
[10206] | 99 | void cameraman::jumpCurrCam(int x, int y, int z) |
---|
[10204] | 100 | { |
---|
[10206] | 101 | currentCam->target->jump(x, y, z); |
---|
[10204] | 102 | } |
---|
| 103 | |
---|
| 104 | |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | |
---|
| 108 | |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | |
---|
| 112 | |
---|
| 113 | |
---|
| 114 | |
---|
| 115 | |
---|
| 116 | |
---|
| 117 | |
---|
| 118 | |
---|
| 119 | |
---|
| 120 | |
---|
| 121 | |
---|
| 122 | |
---|
| 123 | |
---|
| 124 | |
---|
| 125 | |
---|