- Timestamp:
- Apr 12, 2018, 4:12:25 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS18/src/modules/Pacman/PacmanPointSphere.h
r11844 r11859 27 27 */ 28 28 29 #ifndef _Pacman Ghost_H__30 #define _Pacman Ghost_H__29 #ifndef _PacmanPointSphere_H__ 30 #define _PacmanPointSphere_H__ 31 31 32 32 #include "OrxonoxPrereqs.h" 33 33 34 34 #include "core/XMLPort.h" 35 #include "controllers/PacmanGhostController.h"36 35 37 #include " ControllableEntity.h"36 #include "worldentities/ControllableEntity.h" 38 37 39 38 namespace orxonox { 40 39 41 class _OrxonoxExport Pacman Ghost: public ControllableEntity40 class _OrxonoxExport PacmanPointSphere : public ControllableEntity 42 41 { 43 42 public: 44 Pacman Ghost(Context* context);45 virtual ~Pacman Ghost();43 PacmanPointSphere(Context* context); 44 virtual ~PacmanPointSphere(); 46 45 47 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an AutonomousDrone through XML. 48 47 virtual void tick(float dt); //!< Defines which actions the AutonomousDrone has to take in each tick. 49 48 50 virtual void moveFrontBack(const Vector2& value); 51 virtual void moveRightLeft(const Vector2& value); 52 virtual void moveUpDown(const Vector2& value); 49 bool taken(Vector3 playerpos); 50 void resetPacmanPointSphere(); 53 51 54 virtual void rotateYaw(const Vector2& value); 55 virtual void rotatePitch(const Vector2& value); 56 virtual void rotateRoll(const Vector2& value); 57 58 /** 59 @brief Moves the Drone in the Front/Back-direction by the specifed amount. 60 @param value The amount by which the drone is to be moved. 61 */ 62 inline void moveFrontBack(float value) 63 { this->moveFrontBack(Vector2(value, 0)); } 64 /** 65 @brief Moves the Drone in the Right/Left-direction by the specifed amount. 66 @param value The amount by which the drone is to be moved. 67 */ 68 inline void moveRightLeft(float value) 69 { this->moveRightLeft(Vector2(value, 0)); } 70 /** 71 @brief Moves the Drone in the Up/Down-direction by the specifed amount. 72 @param value The amount by which the drone is to be moved. 73 */ 74 inline void moveUpDown(float value) 75 { this->moveUpDown(Vector2(value, 0)); } 76 77 /** 78 @brief Rotates the Drone around the y-axis by the specifed amount. 79 @param value The amount by which the drone is to be rotated. 80 */ 81 inline void rotateYaw(float value) 82 { this->rotateYaw(Vector2(value, 0)); } 83 /** 84 @brief Rotates the Drone around the x-axis by the specifed amount. 85 @param value The amount by which the drone is to be rotated. 86 */ 87 inline void rotatePitch(float value) 88 { this->rotatePitch(Vector2(value, 0)); } 89 /** 90 @brief Rotates the Drone around the z-axis by the specifed amount. 91 @param value The amount by which the drone is to be rotated. 92 */ 93 inline void rotateRoll(float value) 94 { this->rotateRoll(Vector2(value, 0)); } 95 96 /** 97 @brief Sets the primary thrust to the input amount. 98 @param thrust The amount of thrust. 99 */ 100 inline void setPrimaryThrust( float thrust ) 101 { this->primaryThrust_ = thrust; } 102 //TODO: Place your set-functions here. 103 // Hint: auxiliary thrust, rotation thrust. 52 inline void setResetPosition(Vector3 rpos) 53 { this->resetposition = rpos; } 104 54 105 /** 106 @brief Gets the primary thrust to the input amount. 107 @return The amount of thrust. 108 */ 109 inline float getPrimaryThrust() 110 { return this->primaryThrust_; } 111 //TODO: Place your get-functions here. 55 inline Vector3 getResetPosition() 56 { return this->resetposition; } 112 57 113 58 private: 114 PacmanGhostController *myController_; //!< The controller of the AutonomousDrone. 115 116 btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the AutonomousDrone the next tick. 117 btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the AutonomousDrone the next tick. 118 float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward. 119 float auxiliaryThrust_; //!< The amount of auxiliary thrust. Used for all other movements (except for rotations). 120 float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.s 121 59 60 Vector3 resetposition; 122 61 }; 123 62
Note: See TracChangeset
for help on using the changeset viewer.