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/PacmanPointSphere.h

    r11844 r11859  
    2727 */
    2828
    29 #ifndef _PacmanGhost_H__
    30 #define _PacmanGhost_H__
     29#ifndef _PacmanPointSphere_H__
     30#define _PacmanPointSphere_H__
    3131
    3232#include "OrxonoxPrereqs.h"
    3333
    3434#include "core/XMLPort.h"
    35 #include "controllers/PacmanGhostController.h"
    3635
    37 #include "ControllableEntity.h"
     36#include "worldentities/ControllableEntity.h"
    3837
    3938namespace orxonox {
    4039
    41     class _OrxonoxExport PacmanGhost : public ControllableEntity
     40    class _OrxonoxExport PacmanPointSphere : public ControllableEntity
    4241    {
    4342        public:
    44             PacmanGhost(Context* context);
    45             virtual ~PacmanGhost();
     43            PacmanPointSphere(Context* context);
     44            virtual ~PacmanPointSphere();
    4645
    4746            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an AutonomousDrone through XML.
    4847            virtual void tick(float dt); //!< Defines which actions the AutonomousDrone has to take in each tick.
    4948
    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();
    5351
    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; }   
    10454           
    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; }       
    11257
    11358        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;
    12261    };
    12362
Note: See TracChangeset for help on using the changeset viewer.