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 | * Viviane Yang |
---|
24 | * Co-authors: |
---|
25 | * ... |
---|
26 | * |
---|
27 | */ |
---|
28 | |
---|
29 | /* TODO: |
---|
30 | |
---|
31 | @file OrxoBloxShip.cc |
---|
32 | @brief Implementation of the OrxoBloxShip class. |
---|
33 | */ |
---|
34 | |
---|
35 | #include "OrxoBloxShip.h" |
---|
36 | #include "OrxoBlox.h" |
---|
37 | #include "core/CoreIncludes.h" |
---|
38 | |
---|
39 | namespace orxonox |
---|
40 | { |
---|
41 | RegisterClass(OrxoBloxShip); |
---|
42 | |
---|
43 | OrxoBloxShip::OrxoBloxShip(Context* context) : SpaceShip(context) |
---|
44 | { |
---|
45 | RegisterObject(OrxoBloxShip); |
---|
46 | |
---|
47 | this->bImmune = false; |
---|
48 | this->width = 120; |
---|
49 | this->height = 100; |
---|
50 | orxout() << "SPACESHIP Spawned" << std::endl; |
---|
51 | |
---|
52 | //timer.setTimer(3.5f, true, createExecutor(createFunctor(&OrxoBloxShip::showorientation, this))); |
---|
53 | } |
---|
54 | |
---|
55 | //Use this function to display your position on the field -> to determine field width and height |
---|
56 | void OrxoBloxShip::showposition() |
---|
57 | { |
---|
58 | Vector3 pos = this->getPosition(); |
---|
59 | orxout() << "x = "<< pos.x << " y = " << pos.y << " z = "<< pos.z << endl; |
---|
60 | } |
---|
61 | |
---|
62 | //Same thing for orientation |
---|
63 | void OrxoBloxShip::showorientation() |
---|
64 | { |
---|
65 | Quaternion ort = this->getOrientation(); |
---|
66 | orxout() << "w = " << ort.w << " x = " << ort.x << " y = " << ort.y << "z = " << ort.z << endl; |
---|
67 | } |
---|
68 | |
---|
69 | void OrxoBloxShip::tick(float dt) |
---|
70 | { |
---|
71 | SUPER(OrxoBloxShip, tick, dt); |
---|
72 | Vector3 pos = this->getPosition(); |
---|
73 | |
---|
74 | } |
---|
75 | |
---|
76 | OrxoBlox* OrxoBloxShip::getGame() |
---|
77 | { |
---|
78 | if (game == nullptr) |
---|
79 | { |
---|
80 | for (OrxoBlox* race : ObjectList<OrxoBlox>()) |
---|
81 | { |
---|
82 | game = race; |
---|
83 | } |
---|
84 | } |
---|
85 | return game; |
---|
86 | } |
---|
87 | void OrxoBloxShip::death() |
---|
88 | { |
---|
89 | SpaceShip::death(); |
---|
90 | } |
---|
91 | } |
---|
92 | |
---|