Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 12, 2018, 4:12:25 PM (6 years ago)
Author:
dreherm
Message:

Moving ghosts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGhost.h

    r11850 r11859  
    4747            virtual void tick(float dt); //!< Defines which actions the AutonomousDrone has to take in each tick.
    4848
    49             virtual void moveFrontBack(const Vector2& value);
    50             virtual void moveRightLeft(const Vector2& value);
    51             virtual void moveUpDown(const Vector2& value);
    52 
    53             virtual void rotateYaw(const Vector2& value);
    54             virtual void rotatePitch(const Vector2& value);
    55             virtual void rotateRoll(const Vector2& value);
    56 
    5749            void move(float dt, Vector3 actuelposition, Vector3 velocity);
    5850           
    59             //virtual void resetGhost();
    60             /**
    61             @brief Moves the Drone in the Front/Back-direction by the specifed amount.
    62             @param value  The amount by which the drone is to be moved.
    63             */
    64             inline void moveFrontBack(float value)
    65             { this->moveFrontBack(Vector2(value, 0)); }
    66             /**
    67             @brief Moves the Drone in the Right/Left-direction by the specifed amount.
    68             @param value  The amount by which the drone is to be moved.
    69             */
    70             inline void moveRightLeft(float value)
    71             { this->moveRightLeft(Vector2(value, 0)); }
    72             /**
    73             @brief Moves the Drone in the Up/Down-direction by the specifed amount.
    74             @param value  The amount by which the drone is to be moved.
    75             */
    76             inline void moveUpDown(float value)
    77             { this->moveUpDown(Vector2(value, 0)); }
    78 
    79             /**
    80             @brief Rotates the Drone around the y-axis by the specifed amount.
    81             @param value  The amount by which the drone is to be rotated.
    82             */
    83             inline void rotateYaw(float value)
    84             { this->rotateYaw(Vector2(value, 0)); }
    85             /**
    86             @brief Rotates the Drone around the x-axis by the specifed amount.
    87             @param value  The amount by which the drone is to be rotated.
    88             */
    89             inline void rotatePitch(float value)
    90             { this->rotatePitch(Vector2(value, 0)); }
    91             /**
    92             @brief Rotates the Drone around the z-axis by the specifed amount.
    93             @param value  The amount by which the drone is to be rotated.
    94             */
    95             inline void rotateRoll(float value)
    96             { this->rotateRoll(Vector2(value, 0)); }
    97 
    98             /**
    99             @brief Sets the primary thrust to the input amount.
    100             @param thrust The amount of thrust.
    101             */
    102             inline void setPrimaryThrust( float thrust )
    103                 { this->primaryThrust_ = thrust; }
    104             inline void setAuxiliaryThrust( float thrust )
    105                 { this->auxiliaryThrust_ = thrust; }
    106             inline void setRotationThrust( float thrust )
    107                 { this->rotationThrust_ = thrust; }
     51            void resetGhost();
    10852
    10953            inline void setResetPosition(Vector3 rpos)
    11054                { this->resetposition = rpos; }   
    111      
    112             /**
    113             @brief Gets the primary thrust to the input amount.
    114             @return The amount of thrust.
    115             */
    116             inline float getPrimaryThrust()
    117                 { return this->primaryThrust_; }
    118             inline float getAuxiliaryThrust()
    119                 { return this->auxiliaryThrust_; }
    120             inline float getRotationThrust()
    121                 { return this->rotationThrust_; }
    12255           
    12356            inline Vector3 getResetPosition()
     
    12760
    12861        private:
    129            
    130             btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the AutonomousDrone the next tick.
    131             btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the AutonomousDrone the next tick.
    132             float primaryThrust_=100; //!< The amount of primary thrust. This is just used, when moving forward.
    133             float auxiliaryThrust_=100; //!< The amount of auxilliary thrust. Used for all other movements (except for rotations).
    134             float rotationThrust_=100; //!< The amount of rotation thrust. Used for rotations only.s
    135             //Vector3 resetposition; //Start position for Ghost
    136        
    137             PacmanGhost* myGhost = nullptr;
    138 
    13962            bool ismoving = false;
     63            int decision = 0; //Gives the random which way information to the ghost.
    14064            int target_x = 0;
    14165            int target_z = 0;
Note: See TracChangeset for help on using the changeset viewer.