Changeset 1558 for code/trunk/src/orxonox/objects
- Timestamp:
- Jun 7, 2008, 2:06:41 AM (17 years ago)
- Location:
- code/trunk/src/orxonox/objects
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/objects/BillboardProjectile.cc
r1552 r1558 60 60 this->billboard_.getBillboardSet()->getBillboard(0)->setColour(colour); 61 61 } 62 63 void BillboardProjectile::changedVisibility() 64 { 65 Projectile::changedVisibility(); 66 this->billboard_.setVisible(this->isVisible()); 67 } 62 68 } -
code/trunk/src/orxonox/objects/BillboardProjectile.h
r1552 r1558 43 43 BillboardProjectile(SpaceShip* owner = 0); 44 44 virtual ~BillboardProjectile(); 45 45 46 virtual void setColour(const ColourValue& colour); 47 virtual void changedVisibility(); 46 48 47 49 private: -
code/trunk/src/orxonox/objects/Model.cc
r1552 r1558 96 96 registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING); 97 97 } 98 99 void Model::changedVisibility() 100 { 101 WorldEntity::changedVisibility(); 102 this->mesh_.setVisible(this->isVisible()); 103 } 98 104 } -
code/trunk/src/orxonox/objects/Model.h
r1505 r1558 44 44 virtual ~Model(); 45 45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 46 virtual void changedVisibility(); 46 47 void setMesh(const std::string& meshname); 47 48 virtual bool create(); -
code/trunk/src/orxonox/objects/ParticleProjectile.cc
r1552 r1558 55 55 delete this->particles_; 56 56 } 57 58 void ParticleProjectile::changedVisibility() 59 { 60 BillboardProjectile::changedVisibility(); 61 this->particles_->setEnabled(this->isVisible()); 62 } 57 63 } -
code/trunk/src/orxonox/objects/ParticleProjectile.h
r1553 r1558 43 43 ParticleProjectile(SpaceShip* owner = 0); 44 44 virtual ~ParticleProjectile(); 45 virtual void changedVisibility(); 45 46 46 47 private: -
code/trunk/src/orxonox/objects/Projectile.cc
r1554 r1558 82 82 WorldEntity::tick(dt); 83 83 84 if (!this->isActive()) 85 return; 86 84 87 float radius; 85 88 for (Iterator<Model> it = ObjectList<Model>::start(); it; ++it) -
code/trunk/src/orxonox/objects/RotatingProjectile.cc
r1552 r1558 73 73 void RotatingProjectile::tick(float dt) 74 74 { 75 this->time_ += dt; 75 if (this->isActive()) 76 { 77 this->time_ += dt; 76 78 77 this->rotatingNode1_->setPosition(0, 50 * sin(this->time_ * 20), 50 * cos(this->time_ * 20)); 78 this->rotatingNode2_->setPosition(0, -50 * sin(this->time_ * 20), -50 * cos(this->time_ * 20)); 79 this->rotatingNode1_->setPosition(0, 50 * sin(this->time_ * 20), 50 * cos(this->time_ * 20)); 80 this->rotatingNode2_->setPosition(0, -50 * sin(this->time_ * 20), -50 * cos(this->time_ * 20)); 81 } 79 82 80 83 Projectile::tick(dt); 81 84 } 85 86 void RotatingProjectile::changedVisibility() 87 { 88 BillboardProjectile::changedVisibility(); 89 this->rotatingBillboard1_.setVisible(this->isVisible()); 90 this->rotatingBillboard2_.setVisible(this->isVisible()); 91 } 82 92 } -
code/trunk/src/orxonox/objects/RotatingProjectile.h
r1552 r1558 15 15 void setConfigValues(); 16 16 virtual void tick(float dt); 17 virtual void changedVisibility(); 17 18 18 19 private: -
code/trunk/src/orxonox/objects/Skybox.cc
r1505 r1558 54 54 } 55 55 56 void Skybox:: loadParams(TiXmlElement* xmlElem)56 void Skybox::setSkybox(const std::string& skyboxname) 57 57 { 58 if (xmlElem->Attribute("src")) 59 { 60 skyboxSrc_ = xmlElem->Attribute("src"); 61 this->create(); 58 GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(true, skyboxname); 59 } 62 60 63 COUT(4) << "Loader: Set skybox: "<< skyboxSrc_ << std::endl << std::endl; 64 } 65 } 61 void Skybox::setSkyboxSrc(const std::string& src) 62 { 63 this->skyboxSrc_ = src; 64 } 66 65 67 void Skybox::setSkybox(const std::string& skyboxname)68 {69 GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(true, skyboxname);70 }71 72 void Skybox::setSkyboxSrc(const std::string& src){73 skyboxSrc_ = src;74 }75 76 66 /** 77 67 @brief XML loading and saving. … … 87 77 create(); 88 78 } 89 90 bool Skybox::create(){ 91 this->setSkybox(skyboxSrc_); 92 return Synchronisable::create(); 79 80 bool Skybox::create() 81 { 82 this->setSkybox(this->skyboxSrc_); 83 return Synchronisable::create(); 93 84 } 94 95 void Skybox::registerAllVariables(){ 96 registerVar(&skyboxSrc_, skyboxSrc_.length()+1 ,network::STRING); 85 86 void Skybox::registerAllVariables() 87 { 88 registerVar(&skyboxSrc_, skyboxSrc_.length()+1 ,network::STRING); 97 89 } 98 90 91 void Skybox::changedVisibility() 92 { 93 BaseObject::changedVisibility(); 94 GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(this->isVisible(), this->skyboxSrc_); 95 } 99 96 } -
code/trunk/src/orxonox/objects/Skybox.h
r1505 r1558 43 43 virtual ~Skybox(); 44 44 45 void loadParams(TiXmlElement* xmlElem);46 45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 46 virtual void changedVisibility(); 47 47 void setSkybox(const std::string& skyboxname); 48 48 49 49 virtual bool create(); 50 50 void registerAllVariables(); -
code/trunk/src/orxonox/objects/SpaceShip.cc
r1553 r1558 251 251 } 252 252 253 void SpaceShip::changedVisibility() 254 { 255 Model::changedVisibility(); 256 257 this->tt1_->setEnabled(this->isVisible()); 258 this->tt2_->setEnabled(this->isVisible()); 259 this->redBillboard_.setVisible(this->isVisible()); 260 this->greenBillboard_.setVisible(this->isVisible()); 261 this->crosshairNear_.setVisible(this->isVisible()); 262 this->crosshairFar_.setVisible(this->isVisible()); 263 } 264 265 void SpaceShip::changedActivity() 266 { 267 Model::changedActivity(); 268 269 this->tt1_->setEnabled(this->isVisible()); 270 this->tt2_->setEnabled(this->isVisible()); 271 this->redBillboard_.setVisible(this->isVisible()); 272 this->greenBillboard_.setVisible(this->isVisible()); 273 this->crosshairNear_.setVisible(this->isVisible()); 274 this->crosshairFar_.setVisible(this->isVisible()); 275 } 276 253 277 void SpaceShip::setCamera(const std::string& camera) 254 278 { … … 347 371 void SpaceShip::tick(float dt) 348 372 { 373 if (!this->isActive()) 374 return; 375 349 376 currentDir_ = getOrientation()*initialDir_; 350 377 currentOrth_ = getOrientation()*initialOrth_; -
code/trunk/src/orxonox/objects/SpaceShip.h
r1552 r1558 53 53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 54 54 virtual void tick(float dt); 55 virtual void changedVisibility(); 56 virtual void changedActivity(); 55 57 56 58 void setCamera(const std::string& camera = ""); -
code/trunk/src/orxonox/objects/SpaceShipAI.cc
r1553 r1558 208 208 void SpaceShipAI::tick(float dt) 209 209 { 210 if (!this->isActive()) 211 return; 212 210 213 if (this->target_) 211 214 this->aimAtTarget(); -
code/trunk/src/orxonox/objects/WorldEntity.cc
r1552 r1558 80 80 void WorldEntity::tick(float dt) 81 81 { 82 if (!this->bStatic_ )82 if (!this->bStatic_ && this->isActive()) 83 83 { 84 84 // COUT(4) << "acceleration: " << this->acceleration_ << " velocity: " << this->velocity_ << std::endl; … … 132 132 void WorldEntity::registerAllVariables() 133 133 { 134 // register inheritec variables from BaseObject 135 registerVar( (void*) &(this->bActive_), sizeof(this->bActive_), network::DATA, 0x3); 136 registerVar( (void*) &(this->bVisible_), sizeof(this->bVisible_), network::DATA, 0x3); 134 137 // register coordinates 135 138 registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA, 0x3);
Note: See TracChangeset
for help on using the changeset viewer.