Changeset 12066 for code/branches/OrxoKart_HS18/src
- Timestamp:
- Oct 31, 2018, 11:23:24 AM (6 years ago)
- Location:
- code/branches/OrxoKart_HS18/src/modules
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/OrxoKart_HS18/src/modules/hover/HoverShip.cc
r11495 r12066 49 49 50 50 void HoverShip::moveFrontBack(const Vector2& value) 51 { this->steering_.z -= value.x; } 51 { 52 this->steering_.z -= value.x; 53 orxout() << "mFB" << endl; 54 } 52 55 53 56 void HoverShip::moveRightLeft(const Vector2& value) 54 { this->steering_.x += value.x; } 57 { 58 this->rotateYaw(value); 59 orxout() << "mRL" << endl; 60 } 55 61 56 62 void HoverShip::moveUpDown(const Vector2& value) 57 { this->steering_.y += value.x; } 63 { 64 this->steering_.y += value.x; 65 orxout() << "mUD" << endl; 66 } 58 67 59 68 void HoverShip::rotateYaw(const Vector2& value) 60 {61 this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() +value.x);62 63 Pawn::rotateYaw(value);64 }69 { 70 this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x); 71 //orxout() << value; 72 Pawn::rotateYaw(value); 73 } 65 74 66 75 void HoverShip::XMLPort(Element& xmlelement, XMLPort::Mode mode) -
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 { -
code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartKart.h
r12057 r12066 26 26 27 27 /** 28 @file HoverShip.h29 @brief Declaration of the HoverShipclass.28 @file OrxoKartKart.h 29 @brief Declaration of the OrxoKartKart class. 30 30 */ 31 31 32 #ifndef _ HoverShip_H__33 #define _ HoverShip_H__32 #ifndef _OrxoKartKart_H__ 33 #define _OrxoKartKart_H__ 34 34 35 #include " HoverPrereqs.h"35 #include "OrxoKartPrereqs.h" 36 36 37 37 #include "worldentities/pawns/SpaceShip.h" … … 39 39 namespace orxonox 40 40 { 41 class _ HoverExport HoverShip: public SpaceShip41 class _OrxoKartExport OrxoKartKart : public SpaceShip 42 42 { 43 43 public: 44 HoverShip(Context* context);44 OrxoKartKart(Context* context); 45 45 46 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; … … 75 75 } 76 76 77 #endif /* _ HoverShip_H__ */77 #endif /* _OrxoKartKart_H__ */
Note: See TracChangeset
for help on using the changeset viewer.