1 | /* |
---|
2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | * > www.orxonox.net < |
---|
4 | * |
---|
5 | * |
---|
6 | * License notice: |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or |
---|
9 | * modify it under the terms of the GNU General Public License |
---|
10 | * as published by the Free Software Foundation; either version 2 |
---|
11 | * of the License, or (at your option) any later version. |
---|
12 | * |
---|
13 | * This program is distributed in the hope that it will be useful, |
---|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | * GNU General Public License for more details. |
---|
17 | * |
---|
18 | * You should have received a copy of the GNU General Public License |
---|
19 | * along with this program; if not, write to the Free Software |
---|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
21 | * |
---|
22 | * Author: |
---|
23 | * Michael Wirth |
---|
24 | * Co-authors: |
---|
25 | * ... |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | #include "NewHumanController.h" |
---|
30 | |
---|
31 | #include "core/input/InputManager.h" |
---|
32 | #include "core/input/InputState.h" |
---|
33 | |
---|
34 | #include "core/CoreIncludes.h" |
---|
35 | #include "core/ConsoleCommand.h" |
---|
36 | #include "worldentities/ControllableEntity.h" |
---|
37 | #include "worldentities/pawns/Pawn.h" |
---|
38 | #include "gametypes/Gametype.h" |
---|
39 | #include "infos/PlayerInfo.h" |
---|
40 | #include "overlays/Map.h" |
---|
41 | #include "graphics/Camera.h" |
---|
42 | #include "sound/SoundManager.h" |
---|
43 | #include "Radar.h" |
---|
44 | #include "Scene.h" |
---|
45 | |
---|
46 | namespace orxonox |
---|
47 | { |
---|
48 | |
---|
49 | CreateUnloadableFactory(NewHumanController); |
---|
50 | |
---|
51 | NewHumanController::NewHumanController(BaseObject* creator) : HumanController(creator) |
---|
52 | { |
---|
53 | RegisterObject(NewHumanController); |
---|
54 | } |
---|
55 | |
---|
56 | NewHumanController::~NewHumanController() |
---|
57 | { |
---|
58 | if( this->isInitialized() ) |
---|
59 | { |
---|
60 | } |
---|
61 | } |
---|
62 | |
---|
63 | /*void NewHumanController::tick(float dt) |
---|
64 | { |
---|
65 | if (GameMode::playsSound() && NewHumanController::localController_s && NewHumanController::localController_s->controllableEntity_) |
---|
66 | { |
---|
67 | // Update sound listener |
---|
68 | Camera* camera = NewHumanController::localController_s->controllableEntity_->getCamera(); |
---|
69 | if (camera) |
---|
70 | { |
---|
71 | SoundManager::getInstance().setListenerPosition(camera->getWorldPosition()); |
---|
72 | SoundManager::getInstance().setListenerOrientation(camera->getWorldOrientation()); |
---|
73 | } |
---|
74 | else |
---|
75 | COUT(3) << "NewHumanController, Warning: Using a ControllableEntity without Camera" << std::endl; |
---|
76 | } |
---|
77 | }*/ |
---|
78 | |
---|
79 | void NewHumanController::yaw(const Vector2& value) |
---|
80 | { |
---|
81 | // SUPER(NewHumanController, yaw, value); |
---|
82 | HumanController::yaw(value); |
---|
83 | |
---|
84 | this->currentYaw_ = value.x; |
---|
85 | std::cout << "X: " << static_cast<float>(this->currentPitch_) << " Y: " << static_cast<float>(this->currentYaw_) << endl; |
---|
86 | } |
---|
87 | void NewHumanController::pitch(const Vector2& value) |
---|
88 | { |
---|
89 | // SUPER(NewHumanController, pitch, value); |
---|
90 | HumanController::pitch(value); |
---|
91 | |
---|
92 | this->currentPitch_ = value.x; |
---|
93 | std::cout << "X: " << static_cast<float>(this->currentPitch_) << " Y: " << static_cast<float>(this->currentYaw_) << endl; |
---|
94 | } |
---|
95 | |
---|
96 | } |
---|