Changeset 1425 for code/branches/network/src/orxonox
- Timestamp:
- May 25, 2008, 11:08:19 PM (16 years ago)
- Location:
- code/branches/network/src/orxonox/objects
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/objects/Ambient.h
r1293 r1425 47 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 48 48 void setAmbientLight(const ColourValue& colour); 49 bool create();49 virtual bool create(); 50 50 void registerAllVariables(); 51 51 -
code/branches/network/src/orxonox/objects/Explosion.cc
r1421 r1425 80 80 }; 81 81 82 bool Explosion::create(){ 83 return WorldEntity::create(); 84 } 82 /*bool Explosion::create(){ 83 if(!WorldEntity::create()) 84 return false; 85 classID=this->getIdentifier()->getNetworkID(); 86 }*/ 85 87 86 88 void Explosion::destroyObject() -
code/branches/network/src/orxonox/objects/Explosion.h
r1421 r1425 43 43 virtual ~Explosion(); 44 44 void destroyObject(); 45 bool create();45 virtual bool create(){return WorldEntity::create();} 46 46 47 47 private: -
code/branches/network/src/orxonox/objects/Model.h
r1293 r1425 45 45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 46 46 void setMesh(const std::string& meshname); 47 bool create();47 virtual bool create(); 48 48 49 49 protected: -
code/branches/network/src/orxonox/objects/NPC.cc
r1293 r1425 67 67 } 68 68 69 bool NPC::create(){70 Model::create();71 return true;72 }73 69 74 70 /** -
code/branches/network/src/orxonox/objects/NPC.h
r1293 r1425 53 53 void setValues(Vector3 location, Vector3 speed, Vector3 acceleration, bool movable); 54 54 void registerAllVariables(); 55 bool create();55 virtual bool create(){return Model::create();} 56 56 57 57 private: -
code/branches/network/src/orxonox/objects/Projectile.cc
r1418 r1425 91 91 if (this->getPosition().squaredDistance(it->getPosition()) <= (radius*radius)) 92 92 { 93 new Explosion(this); 93 Explosion *exp = new Explosion(this); 94 exp->create(); 94 95 delete this; 95 96 return; -
code/branches/network/src/orxonox/objects/Projectile.h
r1056 r1425 46 46 void destroyObject(); 47 47 virtual void tick(float dt); 48 virtual bool create(){return WorldEntity::create();} 48 49 49 50 private: -
code/branches/network/src/orxonox/objects/Skybox.h
r1293 r1425 47 47 void setSkybox(const std::string& skyboxname); 48 48 49 bool create();49 virtual bool create(); 50 50 void registerAllVariables(); 51 51 void setSkyboxSrc(const std::string &src); -
code/branches/network/src/orxonox/objects/SpaceShip.cc
r1413 r1425 70 70 Iterator<SpaceShip> it; 71 71 for(it = ObjectList<SpaceShip>::start(); it; ++it){ 72 if( (it)->server_ || ( network::Client::getSingleton() && network::Client::getSingleton()->getShipID()==it->objectID ))72 if( (it)->myShip_ ) 73 73 return *it; 74 74 } … … 109 109 mouseY_(0.0f), 110 110 emitterRate_(0.0f), 111 server_(false)111 myShip_(false) 112 112 { 113 113 RegisterObject(SpaceShip); … … 140 140 141 141 bool SpaceShip::create(){ 142 if(!myShip_){ 143 if(network::Client::getSingleton() && objectID == network::Client::getSingleton()->getShipID()) 144 myShip_=true; 145 } 142 146 if(Model::create()) 143 147 this->init(); … … 299 303 XMLPortParamLoadOnly(SpaceShip, "transDamp", setTransDamp, xmlelement, mode); 300 304 XMLPortParamLoadOnly(SpaceShip, "rotDamp", setRotDamp, xmlelement, mode); 301 server_=true; // TODO: this is only a hack305 myShip_=true; // TODO: this is only a hack 302 306 SpaceShip::create(); 303 307 getFocus(); … … 354 358 355 359 Projectile *p = new Projectile(this); 360 p->create(); 356 361 357 362 p->setBacksync(true); … … 439 444 this->tt_->setRate(0); 440 445 441 if( (network::Client::getSingleton() && network::Client::getSingleton()->getShipID() == objectID) || server_ )446 if( myShip_ ) 442 447 { 443 448 COUT(4) << "steering our ship: " << objectID << std::endl; -
code/branches/network/src/orxonox/objects/SpaceShip.h
r1406 r1425 49 49 SpaceShip(); 50 50 ~SpaceShip(); 51 bool create();51 virtual bool create(); 52 52 void registerAllVariables(); 53 53 void init(); … … 81 81 Vector3 getOrth(); 82 82 Camera* getCamera(); 83 84 bool getMyShip(){return myShip_;} 83 85 84 86 private: … … 135 137 136 138 float emitterRate_; 137 bool server_;139 bool myShip_; 138 140 139 141 static SpaceShip* instance_s; -
code/branches/network/src/orxonox/objects/WorldEntity.cc
r1360 r1425 153 153 registerVar( (void*) &(this->bStatic_), sizeof(this->bStatic_), network::DATA, 0x3); 154 154 //register acceleration & momentum 155 registerVar( (void*) &(this->getAcceleration().x), sizeof(this->getAcceleration().x), network::DATA, 0x3);156 registerVar( (void*) &(this->getAcceleration().y), sizeof(this->getAcceleration().y), network::DATA, 0x3);157 registerVar( (void*) &(this->getAcceleration().z), sizeof(this->getAcceleration().z), network::DATA, 0x3);158 registerVar( (void*) &(this->getMomentum()), sizeof(this->getMomentum()), network::DATA); 155 // registerVar( (void*) &(this->getAcceleration().x), sizeof(this->getAcceleration().x), network::DATA, 0x2); 156 // registerVar( (void*) &(this->getAcceleration().y), sizeof(this->getAcceleration().y), network::DATA, 0x2); 157 // registerVar( (void*) &(this->getAcceleration().z), sizeof(this->getAcceleration().z), network::DATA, 0x2); 158 // registerVar( (void*) &(this->getMomentum()), sizeof(this->getMomentum()), network::DATA, 0x2); // only backsync 159 159 } 160 160 -
code/branches/network/src/orxonox/objects/WorldEntity.h
r1418 r1425 53 53 virtual void loadParams(TiXmlElement* xmlElem); 54 54 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 55 inline bool create(){ return Synchronisable::create(); }55 virtual inline bool create(){ return Synchronisable::create(); } 56 56 57 57 void attachWorldEntity(WorldEntity* entity);
Note: See TracChangeset
for help on using the changeset viewer.