Changeset 1098 for code/branches/network2/src/orxonox/objects
- Timestamp:
- Apr 17, 2008, 2:35:51 PM (17 years ago)
- Location:
- code/branches/network2/src/orxonox/objects
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network2/src/orxonox/objects/Ambient.cc
r1064 r1098 57 57 RegisterObject(Ambient); 58 58 Ambient::instance_s = this; 59 registerAllVariables(); 59 60 } 60 61 … … 63 64 } 64 65 66 bool Ambient::create(){ 67 Orxonox::getSingleton()->getSceneManager()->setAmbientLight(ambientLight_); 68 return true; 69 } 70 71 void Ambient::registerAllVariables(){ 72 registerVar(&ambientLight_, sizeof(ColourValue), network::DATA); 73 74 } 75 65 76 void Ambient::loadParams(TiXmlElement* xmlElem) 66 77 { … … 83 94 { 84 95 GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour); 96 ambientLight_=colour; 85 97 } 86 98 … … 96 108 97 109 XMLPortParamLoadOnly(Ambient, "colourvalue", setAmbientLight, xmlelement, mode); 110 create(); 98 111 } 99 112 } -
code/branches/network2/src/orxonox/objects/Ambient.h
r1056 r1098 34 34 #include "util/Math.h" 35 35 #include "core/BaseObject.h" 36 #include "network/Synchronisable.h" 36 37 37 38 namespace orxonox 38 39 { 39 class _OrxonoxExport Ambient : public BaseObject 40 class _OrxonoxExport Ambient : public BaseObject, network::Synchronisable 40 41 { 41 42 public: … … 46 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 47 48 void setAmbientLight(const ColourValue& colour); 49 bool create(); 50 void registerAllVariables(); 48 51 49 52 static void setAmbientLightTest(const ColourValue& colour) … … 52 55 private: 53 56 static Ambient* instance_s; 57 ColourValue ambientLight_; 54 58 55 59 }; -
code/branches/network2/src/orxonox/objects/Model.cc
r1064 r1098 82 82 83 83 bool Model::create(){ 84 WorldEntity::create(); 84 if(!WorldEntity::create()) 85 return false; 85 86 if ((this->meshSrc_ != "") && (this->meshSrc_.size() > 0)) 86 87 { 87 88 this->mesh_.setMesh(meshSrc_); 88 89 this->attachObject(this->mesh_.getEntity()); 89 COUT(4) << "Loader : Created model" << std::endl;90 COUT(4) << "Loader (Model.cc): Created model" << std::endl; 90 91 } 91 92 return true; … … 93 94 94 95 void Model::registerAllVariables(){ 95 WorldEntity::registerAllVariables(); 96 // WorldEntity::registerAllVariables(); 97 COUT(5) << "Model.cc:registering new meshsrc with size: " << meshSrc_.length()+1 << " this: " << this << std::endl; 96 98 registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING); 97 99 } -
code/branches/network2/src/orxonox/objects/NPC.cc
r1056 r1098 40 40 RegisterObject(NPC); 41 41 movable_ = true; 42 registerAllVariables(); 42 43 } 43 44 … … 59 60 this->translate(location); 60 61 movable_ = movable; 62 } 63 64 void NPC::registerAllVariables(){ 65 Model::registerAllVariables(); 66 registerVar(&movable_, sizeof(movable_), network::DATA); 67 } 68 69 bool NPC::create(){ 70 Model::create(); 71 return true; 61 72 } 62 73 -
code/branches/network2/src/orxonox/objects/NPC.h
r1056 r1098 52 52 void update(); 53 53 void setValues(Vector3 location, Vector3 speed, Vector3 acceleration, bool movable); 54 void registerAllVariables(); 55 bool create(); 54 56 55 57 private: -
code/branches/network2/src/orxonox/objects/Skybox.cc
r1064 r1098 47 47 { 48 48 RegisterObject(Skybox); 49 registerAllVariables(); 49 50 } 50 51 … … 57 58 if (xmlElem->Attribute("src")) 58 59 { 59 s td::string skyboxSrc= xmlElem->Attribute("src");60 this->setSkybox(skyboxSrc);60 skyboxSrc_ = xmlElem->Attribute("src"); 61 this->create(); 61 62 62 COUT(4) << "Loader: Set skybox: "<< skyboxSrc << std::endl << std::endl;63 COUT(4) << "Loader: Set skybox: "<< skyboxSrc_ << std::endl << std::endl; 63 64 } 64 65 } … … 69 70 } 70 71 72 void Skybox::setSkyboxSrc(std::string src){ 73 skyboxSrc_ = src; 74 } 75 71 76 /** 72 77 @brief XML loading and saving. … … 80 85 81 86 XMLPortParamLoadOnly(Skybox, "src", setSkybox, xmlelement, mode); 87 XMLPortParamLoadOnly(Skybox, "src", setSkyboxSrc, xmlelement, loading); 88 create(); 82 89 } 90 91 bool Skybox::create(){ 92 this->setSkybox(skyboxSrc_); 93 return true; 94 } 95 96 void Skybox::registerAllVariables(){ 97 registerVar(&skyboxSrc_, skyboxSrc_.length()+1 ,network::STRING); 98 } 99 83 100 } -
code/branches/network2/src/orxonox/objects/Skybox.h
r1056 r1098 33 33 34 34 #include "core/BaseObject.h" 35 #include "network/Synchronisable.h" 35 36 36 37 namespace orxonox 37 38 { 38 class _OrxonoxExport Skybox : public BaseObject 39 class _OrxonoxExport Skybox : public BaseObject, public network::Synchronisable 39 40 { 40 41 public: … … 45 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 46 47 void setSkybox(const std::string& skyboxname); 48 49 bool create(); 50 void registerAllVariables(); 51 void setSkyboxSrc(std::string src); 47 52 48 53 private: 54 std::string skyboxSrc_; 49 55 50 56 -
code/branches/network2/src/orxonox/objects/WorldEntity.cc
r1064 r1098 72 72 } 73 73 } 74 74 75 75 76 WorldEntity::~WorldEntity() … … 162 163 */ 163 164 } 165 164 166 165 167 void WorldEntity::setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll) … … 188 190 189 191 XMLPortObject(WorldEntity, WorldEntity, "attached", attachWorldEntity, getAttachedWorldEntity, xmlelement, mode, false, true); 192 193 //create(); 190 194 } 191 195
Note: See TracChangeset
for help on using the changeset viewer.