Changeset 12028 for code/branches/mergeFS18/src/orxonox/worldentities
- Timestamp:
- Oct 10, 2018, 3:16:51 PM (6 years ago)
- Location:
- code/branches/mergeFS18
- Files:
-
- 11 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/mergeFS18
- Property svn:mergeinfo changed
-
code/branches/mergeFS18/src/orxonox/worldentities/CMakeLists.txt
r11783 r12028 15 15 NameableStaticEntity.cc 16 16 Arrow.cc 17 AutonomousDrone.cc 17 18 ) 18 19 -
code/branches/mergeFS18/src/orxonox/worldentities/ControllableEntity.cc
r11071 r12028 39 39 40 40 #include "Scene.h" 41 #include "Level.h" 41 42 #include "infos/PlayerInfo.h" 42 43 #include "controllers/NewHumanController.h" … … 67 68 this->camera_ = nullptr; 68 69 this->xmlcontroller_ = nullptr; 69 //this->controller_ = nullptr;70 70 this->reverseCamera_ = nullptr; 71 71 this->bDestroyWhenPlayerLeft_ = false; -
code/branches/mergeFS18/src/orxonox/worldentities/ControllableEntity.h
r11071 r12028 175 175 inline int getTeam() const 176 176 { return this->team_; } 177 177 178 178 179 protected: -
code/branches/mergeFS18/src/orxonox/worldentities/MobileEntity.cc
r11071 r12028 36 36 37 37 #include "Scene.h" 38 #include "Level.h" 39 #include "scriptablecontroller/scriptable_controller.h" 38 40 39 41 namespace orxonox … … 72 74 this->setAngularVelocity(rotationAxis.normalisedCopy() * rotationRate.valueRadians()); 73 75 } 76 77 if(!this->id_.empty() && this->getLevel() != nullptr) 78 this->getLevel()->getScriptableController()->registerMobileEntity(this->id_, this); 74 79 } 75 80 -
code/branches/mergeFS18/src/orxonox/worldentities/WorldEntity.cc
r11795 r12028 44 44 #include "core/XMLPort.h" 45 45 #include "Scene.h" 46 #include "Level.h" 46 47 #include "collisionshapes/WorldEntityCollisionShape.h" 48 #include "scriptablecontroller/scriptable_controller.h" 47 49 48 50 namespace orxonox … … 79 81 this->parentID_ = OBJECTID_UNKNOWN; 80 82 this->bDeleteWithParent_ = true; 83 this->id_ = -1; 81 84 82 85 this->node_->setPosition(Vector3::ZERO); … … 160 163 XMLPortParamTemplate(WorldEntity, "scale3D", setScale3D, getScale3D, xmlelement, mode, const Vector3&); 161 164 XMLPortParam (WorldEntity, "scale", setScale, getScale, xmlelement, mode); 165 XMLPortParamLoadOnly(WorldEntity, "id", setID, xmlelement, mode); 162 166 XMLPortParamLoadOnly(WorldEntity, "lookat", lookAt_xmlport, xmlelement, mode); 163 167 XMLPortParamLoadOnly(WorldEntity, "direction", setDirection_xmlport, xmlelement, mode); … … 181 185 // Attached collision shapes 182 186 XMLPortObject(WorldEntity, CollisionShape, "collisionShapes", attachCollisionShape, getAttachedCollisionShape, xmlelement, mode); 187 188 if(!this->id_.empty() && this->getLevel() != nullptr) 189 this->getLevel()->getScriptableController()->registerWorldEntity(this->id_, this); 183 190 } 184 191 -
code/branches/mergeFS18/src/orxonox/worldentities/WorldEntity.h
r11099 r12028 110 110 virtual void changedActivity(void) override; 111 111 virtual void changedVisibility(void) override; 112 113 inline std::string getID(void) 114 { return this->id_; } 115 116 inline void setID(std::string id) 117 { this->id_ = id; } 112 118 113 119 virtual void setPosition(const Vector3& position) = 0; … … 442 448 443 449 btRigidBody* physicalBody_; //!< Bullet rigid body. Everything physical is applied to this instance. 450 std::string id_; //!< Used by the ScriptableController to identify objects 444 451 445 452 private: -
code/branches/mergeFS18/src/orxonox/worldentities/pawns/CMakeLists.txt
r11783 r12028 4 4 Pawn.cc 5 5 SpaceShip.cc 6 ScriptableControllerDrone.cc 6 7 ModularSpaceShip.cc 7 8 TeamBaseMatchBase.cc -
code/branches/mergeFS18/src/orxonox/worldentities/pawns/Pawn.cc
r11783 r12028 50 50 #include "sound/WorldSound.h" 51 51 #include "core/object/ObjectListIterator.h" 52 #include "Level.h" 53 #include "scriptablecontroller/scriptable_controller.h" 52 54 53 55 #include "controllers/FormationController.h" … … 160 162 161 163 XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode ); 164 165 if(!this->id_.empty() && this->getLevel() != nullptr) 166 this->getLevel()->getScriptableController()->registerPawn(this->id_, this); 162 167 } 163 168 … … 282 287 { 283 288 // Health-damage cannot be absorbed by shields. 284 // Shield-damage only reduces shield health. 289 // Shield-damage only reduces shield health. 285 290 // Normal damage can be (partially) absorbed by shields. 286 291 … … 302 307 this->setHealth(this->health_ - (damage - shielddamage) - healthdamage); 303 308 } 309 this->getLevel()->getScriptableController()->pawnHit(this, originator, this->health_, this->shieldHealth_); 304 310 305 311 this->lastHitOriginator_ = originator; … … 402 408 } 403 409 } 410 411 this->getLevel()->getScriptableController()->pawnKilled(this); 404 412 } 405 413 void Pawn::goWithStyle() … … 625 633 { 626 634 // delete all debug models 627 for(Model* model : debugWeaponSlotModels_) 635 for(Model* model : debugWeaponSlotModels_) 628 636 { 629 637 model->destroy(); -
code/branches/mergeFS18/src/orxonox/worldentities/pawns/SpaceShip.cc
r11083 r12028 163 163 engine->run(dt); 164 164 165 if (this->hasLocalController() )165 if (this->hasLocalController() || true) 166 166 { 167 167 // If not in mouse look apply the angular movement to the ship. -
code/branches/mergeFS18/src/orxonox/worldentities/pawns/SpaceShip.h
r11052 r12028 117 117 { this->steering_.y += value.x; } 118 118 119 inline void moveFrontBack(float value) 120 { this->moveFrontBack(Vector2(value, 0)); } 121 inline void moveRightLeft(float value) 122 { this->moveRightLeft(Vector2(value, 0)); } 123 inline void moveUpDown(float value) 124 { this->moveUpDown(Vector2(value, 0)); } 125 119 126 virtual void rotateYaw(const Vector2& value); // Rotate in yaw direction. 120 127 virtual void rotatePitch(const Vector2& value); // Rotate in pitch direction.
Note: See TracChangeset
for help on using the changeset viewer.