- Timestamp:
- Oct 30, 2017, 4:05:01 PM (7 years ago)
- Location:
- code/branches/ScriptableController_HS17/src/orxonox/worldentities
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.cc
r11071 r11518 44 44 #include "worldentities/CameraPosition.h" 45 45 #include "overlays/OverlayGroup.h" 46 #include "scriptablecontroller/scriptable_controller.h" 46 47 47 48 namespace orxonox … … 337 338 } 338 339 340 void ControllableEntity::registerToScriptableController(ScriptableController *controller) 341 { 342 controller->registerControllableEntity(this->id_, this); 343 } 344 339 345 void ControllableEntity::setPlayer(PlayerInfo* player) 340 346 { -
code/branches/ScriptableController_HS17/src/orxonox/worldentities/ControllableEntity.h
r11071 r11518 175 175 inline int getTeam() const 176 176 { return this->team_; } 177 178 virtual void registerToScriptableController(ScriptableController *controller) override; 177 179 178 180 protected: -
code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.cc
r11083 r11518 45 45 #include "Scene.h" 46 46 #include "collisionshapes/WorldEntityCollisionShape.h" 47 #include "scriptablecontroller/scriptable_controller.h" 47 48 48 49 namespace orxonox … … 79 80 this->parentID_ = OBJECTID_UNKNOWN; 80 81 this->bDeleteWithParent_ = true; 82 this->id_ = -1; 81 83 82 84 this->node_->setPosition(Vector3::ZERO); … … 160 162 XMLPortParamTemplate(WorldEntity, "scale3D", setScale3D, getScale3D, xmlelement, mode, const Vector3&); 161 163 XMLPortParam (WorldEntity, "scale", setScale, getScale, xmlelement, mode); 164 XMLPortParamLoadOnly(WorldEntity, "id", setID, xmlelement, mode); 162 165 XMLPortParamLoadOnly(WorldEntity, "lookat", lookAt_xmlport, xmlelement, mode); 163 166 XMLPortParamLoadOnly(WorldEntity, "direction", setDirection_xmlport, xmlelement, mode); … … 275 278 } 276 279 280 void WorldEntity::registerToScriptableController(ScriptableController *controller) 281 { 282 controller->registerWorldEntity(this->id_, this); 283 } 284 277 285 /** 278 286 @brief -
code/branches/ScriptableController_HS17/src/orxonox/worldentities/WorldEntity.h
r11099 r11518 110 110 virtual void changedActivity(void) override; 111 111 virtual void changedVisibility(void) override; 112 113 inline void setID(int id) 114 { this->id_ = id; } 115 116 virtual void registerToScriptableController(ScriptableController *controller) override; 112 117 113 118 virtual void setPosition(const Vector3& position) = 0; … … 442 447 443 448 btRigidBody* physicalBody_; //!< Bullet rigid body. Everything physical is applied to this instance. 449 int id_; //!< Used by the ScriptableController to identify objects 444 450 445 451 private:
Note: See TracChangeset
for help on using the changeset viewer.