Changeset 2362 for code/branches
- Timestamp:
- Dec 9, 2008, 2:16:49 AM (16 years ago)
- Location:
- code/branches/objecthierarchy2/src/orxonox
- Files:
-
- 8 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/orxonox/OrxonoxPrereqs.h
r2350 r2362 149 149 class Controller; 150 150 class HumanController; 151 class ArtificialController; 152 class AIController; 153 class ScriptController; 151 154 152 155 class Info; 153 156 class PlayerInfo; 154 157 class HumanPlayer; 158 class Bot; 155 159 156 160 class Gametype; -
code/branches/objecthierarchy2/src/orxonox/objects/controllers/CMakeLists.txt
r2131 r2362 2 2 Controller.cc 3 3 HumanController.cc 4 ArtificialController.cc 5 AIController.cc 6 ScriptController.cc 4 7 ) 5 8 -
code/branches/objecthierarchy2/src/orxonox/objects/controllers/Controller.h
r2087 r2362 47 47 { return this->player_; } 48 48 49 virtual inline void setControllableEntity(ControllableEntity* entity) 50 { this->controllableEntity_ = entity; } 51 virtual inline ControllableEntity* getControllableEntity() const 49 inline void setControllableEntity(ControllableEntity* entity) 50 { 51 if (entity != this->controllableEntity_) 52 { 53 this->controllableEntity_ = entity; 54 this->changedControllableEntity(); 55 } 56 } 57 inline ControllableEntity* getControllableEntity() const 52 58 { return this->controllableEntity_; } 59 virtual void changedControllableEntity() {} 53 60 54 61 protected: -
code/branches/objecthierarchy2/src/orxonox/objects/infos/CMakeLists.txt
r2171 r2362 1 1 SET( SRC_FILES 2 Bot.cc 2 3 Info.cc 3 4 PlayerInfo.cc -
code/branches/objecthierarchy2/src/orxonox/objects/infos/HumanPlayer.h
r2171 r2362 33 33 34 34 #include "PlayerInfo.h" 35 #include "core/Identifier.h"36 #include "objects/controllers/Controller.h"37 35 38 36 namespace orxonox -
code/branches/objecthierarchy2/src/orxonox/objects/infos/PlayerInfo.cc
r2171 r2362 46 46 this->bLocalPlayer_ = false; 47 47 this->bReadyToSpawn_ = false; 48 this->bSetUnreadyAfterSpawn_ = true; 48 49 this->controller_ = 0; 49 50 this->controllableEntity_ = 0; … … 122 123 this->controllableEntityID_ = entity->getObjectID(); 123 124 entity->setPlayer(this); 124 this->bReadyToSpawn_ = false;125 this->bReadyToSpawn_ &= (!this->bSetUnreadyAfterSpawn_); 125 126 } 126 127 else -
code/branches/objecthierarchy2/src/orxonox/objects/infos/PlayerInfo.h
r2171 r2362 73 73 protected: 74 74 void createController(); 75 void networkcallback_changedcontrollableentityID();76 75 77 76 bool bHumanPlayer_; 78 77 bool bLocalPlayer_; 78 bool bSetUnreadyAfterSpawn_; 79 SubclassIdentifier<Controller> defaultController_; 80 unsigned int clientID_; 81 82 private: 83 void networkcallback_changedcontrollableentityID(); 84 79 85 bool bReadyToSpawn_; 80 SubclassIdentifier<Controller> defaultController_;81 86 Controller* controller_; 82 87 ControllableEntity* controllableEntity_; 83 88 unsigned int controllableEntityID_; 84 unsigned int clientID_;85 89 }; 86 90 } -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/ControllableEntity.h
r2254 r2362 64 64 virtual void rotatePitch(const Vector2& value) {} 65 65 virtual void rotateRoll(const Vector2& value) {} 66 67 inline void moveFrontBack(float value) 68 { this->moveFrontBack(Vector2(value, 0)); } 69 inline void moveRightLeft(float value) 70 { this->moveRightLeft(Vector2(value, 0)); } 71 inline void moveUpDown(float value) 72 { this->moveUpDown(Vector2(value, 0)); } 73 74 inline void rotateYaw(float value) 75 { this->rotateYaw(Vector2(value, 0)); } 76 inline void rotatePitch(float value) 77 { this->rotatePitch(Vector2(value, 0)); } 78 inline void rotateRoll(float value) 79 { this->rotateRoll(Vector2(value, 0)); } 66 80 67 81 virtual void fire() {} -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Spectator.cc
r2254 r2362 31 31 32 32 #include "core/CoreIncludes.h" 33 #include "core/ConfigValueIncludes.h" 33 34 #include "core/Core.h" 34 35 #include "objects/worldentities/Model.h" … … 49 50 RegisterObject(Spectator); 50 51 51 this->speed_ = 100;52 this->speed_ = 200; 52 53 this->rotationSpeed_ = 3; 53 54 … … 68 69 this->bGreeting_ = false; 69 70 71 this->setConfigValues(); 70 72 this->registerVariables(); 71 73 } … … 84 86 } 85 87 88 void Spectator::setConfigValues() 89 { 90 SetConfigValue(speed_, 200.0f); 91 SetConfigValue(rotationSpeed_, 3.0f); 92 } 93 86 94 void Spectator::registerVariables() 87 95 { … … 137 145 { 138 146 ControllableEntity::startLocalHumanControl(); 139 // if (this->hasLocalController())140 // this->testmesh_->setVisible(false);141 147 } 142 148 -
code/branches/objecthierarchy2/src/orxonox/objects/worldentities/pawns/Spectator.h
r2254 r2362 42 42 virtual ~Spectator(); 43 43 44 void setConfigValues(); 44 45 void registerVariables(); 45 46 virtual void tick(float dt);
Note: See TracChangeset
for help on using the changeset viewer.