[12057] | 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 | * Cyrill Burgener |
---|
| 24 | * |
---|
| 25 | */ |
---|
| 26 | |
---|
| 27 | /** |
---|
[12066] | 28 | @file OrxoKartKart.cc |
---|
| 29 | @brief Implementation of the OrxoKartKart control |
---|
[12057] | 30 | */ |
---|
| 31 | |
---|
[12066] | 32 | #include "OrxoKartKart.h" |
---|
[12057] | 33 | #include "core/CoreIncludes.h" |
---|
| 34 | #include "core/XMLPort.h" |
---|
[12168] | 35 | #include "KartController.h" |
---|
[12057] | 36 | namespace orxonox |
---|
| 37 | { |
---|
[12066] | 38 | RegisterClass(OrxoKartKart); |
---|
[12057] | 39 | |
---|
[12168] | 40 | void ControllableEntity::rotateYaw(const Vector2& value) |
---|
| 41 | { |
---|
| 42 | orxout() << "TEST CONTROLlER" << endl; |
---|
| 43 | } |
---|
| 44 | |
---|
[12066] | 45 | OrxoKartKart::OrxoKartKart(Context* context) : SpaceShip(context) |
---|
[12057] | 46 | { |
---|
[12066] | 47 | RegisterObject(OrxoKartKart); |
---|
[12057] | 48 | } |
---|
| 49 | |
---|
[12066] | 50 | void OrxoKartKart::moveFrontBack(const Vector2& value) |
---|
| 51 | { |
---|
[12147] | 52 | this->steering_.z -= value.x; |
---|
| 53 | |
---|
[12066] | 54 | } |
---|
[12057] | 55 | |
---|
[12066] | 56 | void OrxoKartKart::moveRightLeft(const Vector2& value) |
---|
[12147] | 57 | { |
---|
[12066] | 58 | this->rotateYaw(value); |
---|
| 59 | } |
---|
[12057] | 60 | |
---|
[12066] | 61 | void OrxoKartKart::moveUpDown(const Vector2& value) |
---|
| 62 | { |
---|
| 63 | this->steering_.y += value.x; |
---|
[12147] | 64 | |
---|
[12066] | 65 | } |
---|
[12057] | 66 | |
---|
[12066] | 67 | void OrxoKartKart::rotateYaw(const Vector2& value) |
---|
| 68 | { |
---|
[12168] | 69 | |
---|
[12147] | 70 | this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x); |
---|
[12066] | 71 | } |
---|
[12057] | 72 | |
---|
[12066] | 73 | void OrxoKartKart::XMLPort(Element& xmlelement, XMLPort::Mode mode) |
---|
[12147] | 74 | { |
---|
| 75 | SUPER(OrxoKartKart, XMLPort, xmlelement, mode); |
---|
| 76 | |
---|
| 77 | } |
---|
[12057] | 78 | |
---|
| 79 | |
---|
| 80 | /** |
---|
| 81 | @brief |
---|
| 82 | Removed, does nothing. |
---|
| 83 | @param value |
---|
| 84 | */ |
---|
[12066] | 85 | void OrxoKartKart::rotatePitch(const Vector2& value) { } |
---|
[12057] | 86 | |
---|
| 87 | /** |
---|
| 88 | @brief |
---|
| 89 | Removed, does nothing. |
---|
| 90 | @param value |
---|
| 91 | */ |
---|
[12066] | 92 | void OrxoKartKart::rotateRoll(const Vector2& value) { } |
---|
[12057] | 93 | |
---|
| 94 | |
---|
| 95 | } |
---|