Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 20, 2009, 9:20:47 AM (15 years ago)
Author:
rgrieder
Message:

Merged pch branch back to trunk.

Location:
code/trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/controllers/AIController.cc

    r3110 r3196  
    2929#include "AIController.h"
    3030
     31#include "util/Math.h"
    3132#include "core/CoreIncludes.h"
    3233#include "core/Executor.h"
     
    107108            this->moveToTargetPosition();
    108109
    109         if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0))
     110        if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
    110111            this->getControllableEntity()->fire(0);
    111112
  • code/trunk/src/orxonox/objects/controllers/AIController.h

    r2662 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "tools/Timer.h"
     35#include "interfaces/Tickable.h"
    3436#include "ArtificialController.h"
    35 #include "objects/Tickable.h"
    36 #include "tools/Timer.h"
    3737
    3838namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/ArtificialController.cc

    r3110 r3196  
    3232#include "objects/worldentities/ControllableEntity.h"
    3333#include "objects/worldentities/pawns/Pawn.h"
    34 
     34#include "objects/worldentities/pawns/TeamBaseMatchBase.h"
    3535#include "objects/gametypes/TeamDeathmatch.h"
    3636#include "objects/controllers/WaypointPatrolController.h"
    37 #include "objects/worldentities/pawns/TeamBaseMatchBase.h"
    3837
    3938namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/ArtificialController.h

    r3049 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "util/Math.h"
     35#include "interfaces/PawnListener.h"
    3436#include "Controller.h"
    35 #include "objects/worldentities/pawns/Pawn.h"
    36 #include "util/Math.h"
    3737
    3838namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/Controller.cc

    r3110 r3196  
    2828
    2929#include "Controller.h"
    30 
    3130#include "core/CoreIncludes.h"
    32 #include "overlays/OverlayGroup.h"
    3331
    3432namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/Controller.h

    r2826 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "core/BaseObject.h"
    3534
  • code/trunk/src/orxonox/objects/controllers/HumanController.cc

    r3110 r3196  
    192192            HumanController::localController_s->controllableEntity_->dropItems();
    193193    }
     194
     195    Pawn* HumanController::getLocalControllerEntityAsPawn()
     196    {
     197        if (HumanController::localController_s)
     198            return dynamic_cast<Pawn*>(HumanController::localController_s->getControllableEntity());
     199        else
     200            return NULL;
     201    }
    194202}
  • code/trunk/src/orxonox/objects/controllers/HumanController.h

    r3089 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    34 #include "util/Math.h"
    3533#include "Controller.h"
    36 #include "objects/worldentities/pawns/Pawn.h"
    3734
    3835namespace orxonox
     
    6966            static inline HumanController* getLocalControllerSingleton()
    7067                { return HumanController::localController_s; }
    71             static inline Pawn* getLocalControllerEntityAsPawn()
    72             {
    73                 if (HumanController::localController_s) {
    74                     return dynamic_cast<Pawn*>(HumanController::localController_s->getControllableEntity());
    75                 } else {
    76                     return NULL;
    77                 }
    78             }
    79 
     68            static Pawn* getLocalControllerEntityAsPawn();
    8069            //friend class, for mouselook
    8170            friend class Map;
  • code/trunk/src/orxonox/objects/controllers/PongAI.cc

    r3110 r3196  
    3131#include "core/CoreIncludes.h"
    3232#include "core/ConfigValueIncludes.h"
     33#include "tools/Timer.h"
    3334#include "objects/worldentities/ControllableEntity.h"
    3435#include "objects/worldentities/PongBall.h"
    35 #include "tools/Timer.h"
    3636
    3737namespace orxonox
     
    3939    CreateUnloadableFactory(PongAI);
    4040
    41     const static float MAX_REACTION_TIME = 0.4;
     41    const static float MAX_REACTION_TIME = 0.4f;
    4242
    4343    PongAI::PongAI(BaseObject* creator) : Controller(creator)
     
    4949        this->ballEndPosition_ = 0;
    5050        this->randomOffset_ = 0;
    51         this->relHysteresisOffset_ = 0.02;
    52         this->strength_ = 0.5;
     51        this->relHysteresisOffset_ = 0.02f;
     52        this->strength_ = 0.5f;
    5353        this->movement_ = 0;
    5454        this->oldMove_ = 0;
     
    171171
    172172        // The position shouln't be larger than 0.5 (50% of the bat-length from the middle is the end)
    173         position *= 0.48;
     173        position *= 0.48f;
    174174
    175175        // Both sides are equally probable
     
    190190
    191191        // Calculate bounces
    192         for (float limit = 0.35; limit < this->strength_ || this->strength_ > 0.99; limit += 0.4)
     192        for (float limit = 0.35f; limit < this->strength_ || this->strength_ > 0.99f; limit += 0.4f)
    193193        {
    194194            // Calculate a random prediction error, based on the vertical speed of the ball and the strength of the AI
  • code/trunk/src/orxonox/objects/controllers/PongAI.h

    r2885 r3196  
    3333
    3434#include <list>
    35 
     35#include "util/Math.h"
     36#include "interfaces/Tickable.h"
    3637#include "Controller.h"
    37 #include "objects/Tickable.h"
    38 #include "util/Math.h"
    3938
    4039namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/ScriptController.cc

    r3110 r3196  
    2828
    2929#include "ScriptController.h"
    30 
    3130#include "core/CoreIncludes.h"
    3231
     
    3938        RegisterObject(ScriptController);
    4039    }
    41 
    42     ScriptController::~ScriptController()
    43     {
    44     }
    4540}
  • code/trunk/src/orxonox/objects/controllers/ScriptController.h

    r2662 r3196  
    3131
    3232#include "OrxonoxPrereqs.h"
    33 
    3433#include "ArtificialController.h"
    3534
     
    4039        public:
    4140            ScriptController(BaseObject* creator);
    42             virtual ~ScriptController();
    43 
    44         protected:
     41            virtual ~ScriptController() { }
    4542
    4643        private:
  • code/trunk/src/orxonox/objects/controllers/WaypointController.cc

    r3110 r3196  
    3131#include "core/CoreIncludes.h"
    3232#include "core/XMLPort.h"
     33#include "objects/worldentities/ControllableEntity.h"
    3334
    3435namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/WaypointController.h

    r3078 r3196  
    3333
    3434#include <vector>
    35 
     35#include "interfaces/Tickable.h"
    3636#include "ArtificialController.h"
    37 #include "objects/Tickable.h"
    3837
    3938namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/WaypointPatrolController.cc

    r3110 r3196  
    2929#include "WaypointPatrolController.h"
    3030
     31#include "util/Math.h"
    3132#include "core/CoreIncludes.h"
    3233#include "core/XMLPort.h"
     34#include "objects/worldentities/pawns/Pawn.h"
    3335
    3436namespace orxonox
  • code/trunk/src/orxonox/objects/controllers/WaypointPatrolController.h

    r3078 r3196  
    3232#include "OrxonoxPrereqs.h"
    3333
     34#include "tools/Timer.h"
    3435#include "WaypointController.h"
    35 #include "tools/Timer.h"
    3636
    3737namespace orxonox
Note: See TracChangeset for help on using the changeset viewer.