Changeset 3196 for code/trunk/src/orxonox/objects/controllers
- Timestamp:
- Jun 20, 2009, 9:20:47 AM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/pch (added) merged: 3114-3118,3124-3125,3127-3131,3133,3138-3194
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/controllers/AIController.cc
r3110 r3196 29 29 #include "AIController.h" 30 30 31 #include "util/Math.h" 31 32 #include "core/CoreIncludes.h" 32 33 #include "core/Executor.h" … … 107 108 this->moveToTargetPosition(); 108 109 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)) 110 111 this->getControllableEntity()->fire(0); 111 112 -
code/trunk/src/orxonox/objects/controllers/AIController.h
r2662 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "tools/Timer.h" 35 #include "interfaces/Tickable.h" 34 36 #include "ArtificialController.h" 35 #include "objects/Tickable.h"36 #include "tools/Timer.h"37 37 38 38 namespace orxonox -
code/trunk/src/orxonox/objects/controllers/ArtificialController.cc
r3110 r3196 32 32 #include "objects/worldentities/ControllableEntity.h" 33 33 #include "objects/worldentities/pawns/Pawn.h" 34 34 #include "objects/worldentities/pawns/TeamBaseMatchBase.h" 35 35 #include "objects/gametypes/TeamDeathmatch.h" 36 36 #include "objects/controllers/WaypointPatrolController.h" 37 #include "objects/worldentities/pawns/TeamBaseMatchBase.h"38 37 39 38 namespace orxonox -
code/trunk/src/orxonox/objects/controllers/ArtificialController.h
r3049 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "util/Math.h" 35 #include "interfaces/PawnListener.h" 34 36 #include "Controller.h" 35 #include "objects/worldentities/pawns/Pawn.h"36 #include "util/Math.h"37 37 38 38 namespace orxonox -
code/trunk/src/orxonox/objects/controllers/Controller.cc
r3110 r3196 28 28 29 29 #include "Controller.h" 30 31 30 #include "core/CoreIncludes.h" 32 #include "overlays/OverlayGroup.h"33 31 34 32 namespace orxonox -
code/trunk/src/orxonox/objects/controllers/Controller.h
r2826 r3196 31 31 32 32 #include "OrxonoxPrereqs.h" 33 34 33 #include "core/BaseObject.h" 35 34 -
code/trunk/src/orxonox/objects/controllers/HumanController.cc
r3110 r3196 192 192 HumanController::localController_s->controllableEntity_->dropItems(); 193 193 } 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 } 194 202 } -
code/trunk/src/orxonox/objects/controllers/HumanController.h
r3089 r3196 31 31 32 32 #include "OrxonoxPrereqs.h" 33 34 #include "util/Math.h"35 33 #include "Controller.h" 36 #include "objects/worldentities/pawns/Pawn.h"37 34 38 35 namespace orxonox … … 69 66 static inline HumanController* getLocalControllerSingleton() 70 67 { 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(); 80 69 //friend class, for mouselook 81 70 friend class Map; -
code/trunk/src/orxonox/objects/controllers/PongAI.cc
r3110 r3196 31 31 #include "core/CoreIncludes.h" 32 32 #include "core/ConfigValueIncludes.h" 33 #include "tools/Timer.h" 33 34 #include "objects/worldentities/ControllableEntity.h" 34 35 #include "objects/worldentities/PongBall.h" 35 #include "tools/Timer.h"36 36 37 37 namespace orxonox … … 39 39 CreateUnloadableFactory(PongAI); 40 40 41 const static float MAX_REACTION_TIME = 0.4 ;41 const static float MAX_REACTION_TIME = 0.4f; 42 42 43 43 PongAI::PongAI(BaseObject* creator) : Controller(creator) … … 49 49 this->ballEndPosition_ = 0; 50 50 this->randomOffset_ = 0; 51 this->relHysteresisOffset_ = 0.02 ;52 this->strength_ = 0.5 ;51 this->relHysteresisOffset_ = 0.02f; 52 this->strength_ = 0.5f; 53 53 this->movement_ = 0; 54 54 this->oldMove_ = 0; … … 171 171 172 172 // 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; 174 174 175 175 // Both sides are equally probable … … 190 190 191 191 // 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) 193 193 { 194 194 // 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 33 33 34 34 #include <list> 35 35 #include "util/Math.h" 36 #include "interfaces/Tickable.h" 36 37 #include "Controller.h" 37 #include "objects/Tickable.h"38 #include "util/Math.h"39 38 40 39 namespace orxonox -
code/trunk/src/orxonox/objects/controllers/ScriptController.cc
r3110 r3196 28 28 29 29 #include "ScriptController.h" 30 31 30 #include "core/CoreIncludes.h" 32 31 … … 39 38 RegisterObject(ScriptController); 40 39 } 41 42 ScriptController::~ScriptController()43 {44 }45 40 } -
code/trunk/src/orxonox/objects/controllers/ScriptController.h
r2662 r3196 31 31 32 32 #include "OrxonoxPrereqs.h" 33 34 33 #include "ArtificialController.h" 35 34 … … 40 39 public: 41 40 ScriptController(BaseObject* creator); 42 virtual ~ScriptController(); 43 44 protected: 41 virtual ~ScriptController() { } 45 42 46 43 private: -
code/trunk/src/orxonox/objects/controllers/WaypointController.cc
r3110 r3196 31 31 #include "core/CoreIncludes.h" 32 32 #include "core/XMLPort.h" 33 #include "objects/worldentities/ControllableEntity.h" 33 34 34 35 namespace orxonox -
code/trunk/src/orxonox/objects/controllers/WaypointController.h
r3078 r3196 33 33 34 34 #include <vector> 35 35 #include "interfaces/Tickable.h" 36 36 #include "ArtificialController.h" 37 #include "objects/Tickable.h"38 37 39 38 namespace orxonox -
code/trunk/src/orxonox/objects/controllers/WaypointPatrolController.cc
r3110 r3196 29 29 #include "WaypointPatrolController.h" 30 30 31 #include "util/Math.h" 31 32 #include "core/CoreIncludes.h" 32 33 #include "core/XMLPort.h" 34 #include "objects/worldentities/pawns/Pawn.h" 33 35 34 36 namespace orxonox -
code/trunk/src/orxonox/objects/controllers/WaypointPatrolController.h
r3078 r3196 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "tools/Timer.h" 34 35 #include "WaypointController.h" 35 #include "tools/Timer.h"36 36 37 37 namespace orxonox
Note: See TracChangeset
for help on using the changeset viewer.