- Timestamp:
- Nov 20, 2017, 4:48:03 PM (7 years ago)
- Location:
- code/branches/ScriptableController_HS17/src/orxonox/worldentities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.cc
r11518 r11583 39 39 40 40 #include "Scene.h" 41 #include "Level.h" 41 42 #include "infos/PlayerInfo.h" 42 43 #include "controllers/NewHumanController.h" … … 68 69 this->camera_ = nullptr; 69 70 this->xmlcontroller_ = nullptr; 70 //this->controller_ = nullptr;71 71 this->reverseCamera_ = nullptr; 72 72 this->bDestroyWhenPlayerLeft_ = false; … … 127 127 XMLPortObject(ControllableEntity, CameraPosition, "camerapositions", addCameraPosition, getCameraPosition, xmlelement, mode); 128 128 XMLPortObject(ControllableEntity, Controller, "controller", setXMLController, getXMLController, xmlelement, mode); 129 130 if(!this->id_.empty() && this->getLevel() != nullptr) 131 this->getLevel()->getScriptableController()->registerControllableEntity(this->id_, this); 129 132 } 130 133 … … 338 341 } 339 342 340 void ControllableEntity::registerToScriptableController(ScriptableController *controller)341 {342 controller->registerControllableEntity(this->id_, this);343 }344 345 343 void ControllableEntity::setPlayer(PlayerInfo* player) 346 344 { -
code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.h
r11518 r11583 176 176 { return this->team_; } 177 177 178 virtual void registerToScriptableController(ScriptableController *controller) override;179 178 180 179 protected: -
code/branches/ScriptableController_HS17/src/orxonox/worldentities/MobileEntity.cc
r11562 r11583 115 115 116 116 this->node_->setPosition(position); 117 this->getLevel()->getScriptableController()->objectMoved(this);118 117 } 119 118 -
code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.cc
r11562 r11583 44 44 #include "core/XMLPort.h" 45 45 #include "Scene.h" 46 #include "Level.h" 46 47 #include "collisionshapes/WorldEntityCollisionShape.h" 47 48 #include "scriptablecontroller/scriptable_controller.h" … … 185 186 XMLPortObject(WorldEntity, CollisionShape, "collisionShapes", attachCollisionShape, getAttachedCollisionShape, xmlelement, mode); 186 187 187 orxout(user_info) << "ID loaded" << std::endl; 188 if(!this->id_.empty() && this->getLevel() != nullptr) 189 this->getLevel()->getScriptableController()->registerWorldEntity(this->id_, this); 188 190 } 189 191 … … 280 282 } 281 283 282 void WorldEntity::registerToScriptableController(ScriptableController *controller)283 {284 orxout(user_info) << "Registering object to SC (" << this->id_ << ")" << std::endl;285 controller->registerWorldEntity(this->id_, this);286 }287 288 284 /** 289 285 @brief -
code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.h
r11562 r11583 111 111 virtual void changedVisibility(void) override; 112 112 113 inline intgetID(void)113 inline std::string getID(void) 114 114 { return this->id_; } 115 115 116 inline void setID( intid)116 inline void setID(std::string id) 117 117 { this->id_ = id; } 118 119 virtual void registerToScriptableController(ScriptableController *controller) override;120 118 121 119 virtual void setPosition(const Vector3& position) = 0; … … 450 448 451 449 btRigidBody* physicalBody_; //!< Bullet rigid body. Everything physical is applied to this instance. 452 intid_; //!< Used by the ScriptableController to identify objects450 std::string id_; //!< Used by the ScriptableController to identify objects 453 451 454 452 private:
Note: See TracChangeset
for help on using the changeset viewer.