Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 19, 2018, 10:32:12 PM (6 years ago)
Author:
landauf
Message:

[Waypoints_HS17] removed lots of copy-paste- and otherwise unnecessary code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Presentation_HS17_merge/src/orxonox/worldentities/Arrow.h

    r11774 r11777  
    2121 *
    2222 *   Author:
    23  *      Oli Scheuss
     23 *      jostoffe
    2424 *   Co-authors:
    25  *      Damian 'Mozork' Frick
     25 *      ...
    2626 *
    2727 */
     
    3333
    3434#include "core/XMLPort.h"
    35 //#include "controllers/ArrowController.h"
    3635
    3736#include "ControllableEntity.h"
    38 #include "WorldEntity.h"
    3937
    4038namespace orxonox {
    4139
    42     /**
    43     @brief
    44         Drone, that is made to move upon a specified pattern.
    45         This class was constructed for the PPS tutorial.
    46     @author
    47         Oli Scheuss
    48     */
    4940    class _OrxonoxExport Arrow : public ControllableEntity
    5041    {
    5142        public:
    5243            Arrow(Context* context);
    53             virtual ~Arrow();
    54 
    55             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an Arrow through XML.
    56             virtual void tick(float dt); //!< Defines which actions the Arrow has to take in each tick.
    57 
    58             virtual void moveFrontBack(const Vector2& value);
    59             virtual void moveRightLeft(const Vector2& value);
    60             virtual void moveUpDown(const Vector2& value);
    61 
    62             virtual void rotateYaw(const Vector2& value);
    63             virtual void rotatePitch(const Vector2& value);
    64             virtual void rotateRoll(const Vector2& value);
    65 
    66             /**
    67             @brief Moves the Drone in the Front/Back-direction by the specifed amount.
    68             @param value  The amount by which the drone is to be moved.
    69             */
    70             inline void moveFrontBack(float value)
    71             { this->moveFrontBack(Vector2(value, 0)); }
    72             /**
    73             @brief Moves the Drone in the Right/Left-direction by the specifed amount.
    74             @param value  The amount by which the drone is to be moved.
    75             */
    76             inline void moveRightLeft(float value)
    77             { this->moveRightLeft(Vector2(value, 0)); }
    78             /**
    79             @brief Moves the Drone in the Up/Down-direction by the specifed amount.
    80             @param value  The amount by which the drone is to be moved.
    81             */
    82             inline void moveUpDown(float value)
    83             { this->moveUpDown(Vector2(value, 0)); }
    84 
    85             /**
    86             @brief Rotates the Drone around the y-axis by the specifed amount.
    87             @param value  The amount by which the drone is to be rotated.
    88             */
    89             inline void rotateYaw(float value)
    90             { this->rotateYaw(Vector2(value, 0)); }
    91             /**
    92             @brief Rotates the Drone around the x-axis by the specifed amount.
    93             @param value  The amount by which the drone is to be rotated.
    94             */
    95             inline void rotatePitch(float value)
    96             { this->rotatePitch(Vector2(value, 0)); }
    97             /**
    98             @brief Rotates the Drone around the z-axis by the specifed amount.
    99             @param value  The amount by which the drone is to be rotated.
    100             */
    101             inline void rotateRoll(float value)
    102             { this->rotateRoll(Vector2(value, 0)); }
    103 
    104             /**
    105             @brief Sets the primary thrust to the input amount.
    106             @param thrust The amount of thrust.
    107             */
    108             inline void setPrimaryThrust( float thrust )
    109                 { this->primaryThrust_ = thrust; }
    110             //TODO: Place your set-functions here.
    111 
    112             inline void setAuxiliaryThrust ( float thrust )
    113                 { this -> auxiliaryThrust_ = thrust; }
    114 
    115             inline void setRotationThrust (float thrust)
    116                 { this -> rotationThrust_ = thrust;}
    117             // Hint: auxiliary thrust, rotation thrust.
    118            
    119             /**
    120             @brief Gets the primary thrust to the input amount.
    121             @return The amount of thrust.
    122             */
    123             inline float getPrimaryThrust()
    124                 { return this->primaryThrust_; }
    125 
    126             inline float getAuxiliaryThrust()
    127                 { return this->auxiliaryThrust_;}
    128 
    129             inline float getRotationThrust()
    130                 { return this->rotationThrust_;}
    131 
    132             //TODO: Place your get-functions here.
    133 
    134         private:
    135             //ArrowController *myController_; //!< The controller of the Arrow.
    136 
    137             btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the Arrow the next tick.
    138             btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the Arrow the next tick.
    139             float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward.
    140             float auxiliaryThrust_; //!< The amount of auxiliary thrust. Used for all other movements (except for rotations).
    141             float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.s
    142        
     44            virtual ~Arrow() = default;
    14345    };
    14446
Note: See TracChangeset for help on using the changeset viewer.