- Timestamp:
- Oct 31, 2018, 11:23:24 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.cc
r12057 r12066 26 26 27 27 /** 28 @file HoverShip.cc29 @brief Implementation of the HoverShipcontrol28 @file OrxoKartKart.cc 29 @brief Implementation of the OrxoKartKart control 30 30 */ 31 31 32 #include " HoverShip.h"32 #include "OrxoKartKart.h" 33 33 #include "core/CoreIncludes.h" 34 34 #include "core/XMLPort.h" … … 38 38 namespace orxonox 39 39 { 40 RegisterClass( HoverShip);40 RegisterClass(OrxoKartKart); 41 41 42 HoverShip::HoverShip(Context* context) : SpaceShip(context)42 OrxoKartKart::OrxoKartKart(Context* context) : SpaceShip(context) 43 43 { 44 RegisterObject( HoverShip);44 RegisterObject(OrxoKartKart); 45 45 enableCollisionCallback(); 46 46 isFloor_ = false; … … 48 48 } 49 49 50 void HoverShip::moveFrontBack(const Vector2& value) 51 { this->steering_.z -= value.x; } 50 void OrxoKartKart::moveFrontBack(const Vector2& value) 51 { 52 this->steering_.z -= value.x; 53 orxout() << "mFB" << endl; 54 } 52 55 53 void HoverShip::moveRightLeft(const Vector2& value) 54 { this->steering_.x += value.x; } 56 void OrxoKartKart::moveRightLeft(const Vector2& value) 57 { 58 this->rotateYaw(value); 59 orxout() << "mRL" << endl; 60 } 55 61 56 void HoverShip::moveUpDown(const Vector2& value) 57 { this->steering_.y += value.x; } 62 void OrxoKartKart::moveUpDown(const Vector2& value) 63 { 64 this->steering_.y += value.x; 65 orxout() << "mUD" << endl; 66 } 58 67 59 void HoverShip::rotateYaw(const Vector2& value) 68 void OrxoKartKart::rotateYaw(const Vector2& value) 69 { 70 this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x); 71 //orxout() << value; 72 Pawn::rotateYaw(value); 73 } 74 75 void OrxoKartKart::XMLPort(Element& xmlelement, XMLPort::Mode mode) 60 76 { 61 this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() + value.x);77 SUPER(OrxoKartKart, XMLPort, xmlelement, mode); 62 78 63 Pawn::rotateYaw(value); 64 } 65 66 void HoverShip::XMLPort(Element& xmlelement, XMLPort::Mode mode) 67 { 68 SUPER(HoverShip, XMLPort, xmlelement, mode); 69 70 XMLPortParam(HoverShip, "jumpBoost", setJumpBoost, getJumpBoost, xmlelement, mode); 79 XMLPortParam(OrxoKartKart, "jumpBoost", setJumpBoost, getJumpBoost, xmlelement, mode); 71 80 } 72 81 … … 76 85 @param value 77 86 */ 78 void HoverShip::rotatePitch(const Vector2& value) { }87 void OrxoKartKart::rotatePitch(const Vector2& value) { } 79 88 80 89 /** … … 83 92 @param value 84 93 */ 85 void HoverShip::rotateRoll(const Vector2& value) { }94 void OrxoKartKart::rotateRoll(const Vector2& value) { } 86 95 87 96 /** … … 89 98 Checks if the ship is touching the floor. The ship can only jump if there is contact with someting beneath it. 90 99 */ 91 bool HoverShip::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)100 bool OrxoKartKart::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint) 92 101 { 93 102 SpaceShip::collidesAgainst(otherObject, cs, contactPoint); 94 //SUPER( HoverShip, collidesAgainst, otherObject, cs, contactPoint);103 //SUPER(OrxoKartKart, collidesAgainst, otherObject, cs, contactPoint); 95 104 96 105 if (contactPoint.m_normalWorldOnB.y() > 0.6 … … 109 118 @param bBoost 110 119 */ 111 void HoverShip::boost(bool bBoost) {120 void OrxoKartKart::boost(bool bBoost) { 112 121 if (bBoost && this->isFloor_) 113 122 {
Note: See TracChangeset
for help on using the changeset viewer.