Changeset 1901 for code/branches/network/src/orxonox/objects
- Timestamp:
- Oct 12, 2008, 12:15:30 PM (17 years ago)
- Location:
- code/branches/network/src/orxonox/objects
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/orxonox/objects/Backlight.cc
r1755 r1901 53 53 this->traillength_ = 1; 54 54 55 this->getNode()->setInheritScale(false); 55 this->configure(maxspeed, brakingtime, scale); 56 } 57 58 bool Backlight::create(){ 59 if(!WorldEntity::create()) 60 return false; 61 62 this->getNode()->setInheritScale(false); 56 63 57 58 64 this->billboard_.setBillboardSet("Flares/backlightflare"); 65 this->attachObject(this->billboard_.getBillboardSet()); 59 66 60 61 62 63 67 this->ribbonTrail_ = GraphicsEngine::getInstance().getLevelSceneManager()->createRibbonTrail(this->getName() + "RibbonTrail"); 68 this->ribbonTrailNode_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName() + "RibbonTrailNode"); 69 this->ribbonTrailNode_->attachObject(this->ribbonTrail_); 70 this->ribbonTrail_->addNode(this->getNode()); 64 71 65 this->configure(maxspeed, brakingtime, scale);66 72 67 68 73 this->ribbonTrail_->setTrailLength(this->maxTraillength_); 74 this->ribbonTrail_->setMaterialName("Trail/backlighttrail"); 69 75 70 76 //this->setTimeFactor(Orxonox::getInstance().getTimeFactor()); 71 this->setTimeFactor(1.0f); 77 this->setTimeFactor(1.0f); 78 79 this->ribbonTrail_->setMaxChainElements(this->maxTrailsegments_); 80 this->ribbonTrail_->setTrailLength(this->traillength_ = 2 * this->maxTrailsegments_); 81 this->ribbonTrail_->setInitialWidth(0, this->width_ * this->getScale()); 82 this->ribbonTrail_->setWidthChange(0, this->width_ * this->getScale() / this->maxLifeTime_ * Backlight::timeFactor_s); 83 return true; 72 84 } 73 85 … … 100 112 { 101 113 this->ribbonTrail_->setColourChange(0, ColourValue(0, 0, 0, this->maxTraillength_ / this->traillength_ / this->maxLifeTime_ * Backlight::timeFactor_s)); 114 } 115 116 117 void Backlight::XMLPort(Element& xmlelement, XMLPort::Mode mode){ 118 SUPER(Backlight, XMLPort, xmlelement, mode); 119 120 Backlight::create(); 102 121 } 103 122 … … 136 155 this->maxTraillength_ = this->maxLifeTime_ * maxspeed; 137 156 this->maxTrailsegments_ = (size_t)(this->maxTraillength_ / this->trailSegmentLength_); 138 this->ribbonTrail_->setMaxChainElements(this->maxTrailsegments_);139 this->ribbonTrail_->setTrailLength(this->traillength_ = 2 * this->maxTrailsegments_);140 157 141 158 this->brakefactor_ = this->maxLifeTime_ / brakingtime; 142 159 143 160 this->scale(scale); 144 this->ribbonTrail_->setInitialWidth(0, this->width_ * scale);145 this->ribbonTrail_->setWidthChange(0, this->width_ * scale / this->maxLifeTime_ * Backlight::timeFactor_s);146 161 } 147 162 -
code/branches/network/src/orxonox/objects/Backlight.h
r1608 r1901 45 45 46 46 void setConfigValues(); 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 47 48 virtual void tick(float dt); 48 49 virtual void changedVisibility(); 50 virtual bool create(); 49 51 50 52 void setColour(const ColourValue& colour); -
code/branches/network/src/orxonox/objects/Model.cc
r1793 r1901 46 46 47 47 /** 48 * 48 * @brief Constructor 49 49 */ 50 50 Model::Model() … … 54 54 } 55 55 56 /** 57 * @brief Destructor 58 */ 56 59 Model::~Model() 57 60 { -
code/branches/network/src/orxonox/objects/Projectile.cc
r1834 r1901 41 41 #include "ParticleSpawner.h" 42 42 #include "Model.h" 43 #include "Settings.h" 43 44 44 45 namespace orxonox … … 64 65 } 65 66 66 this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject))); 67 if(!orxonox::Settings::isClient()) //only if not on client 68 this->destroyTimer_.setTimer(this->lifetime_, false, this, createExecutor(createFunctor(&Projectile::destroyObject))); 67 69 } 68 70 -
code/branches/network/src/orxonox/objects/SpaceShip.cc
r1834 r1901 181 181 this->setRadarObjectColour(this->getProjectileColour()); 182 182 } 183 assert(Model::create());183 Model::create(); 184 184 this->init(); 185 185 return true; … … 255 255 256 256 // START CREATING ADDITIONAL EFFECTS 257 /*this->backlight_ = new Backlight(this->maxSpeed_, 0.8); 258 this->attachObject(this->backlight_); 259 this->backlight_->setPosition(-2.35, 0, 0.2); 260 this->backlight_->setColour(this->getProjectileColour()); 261 262 this->smoke_ = new ParticleSpawner(); 263 this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3); 264 this->attachObject(this->smoke_); 265 266 this->fire_ = new ParticleSpawner(); 267 this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1); 268 this->attachObject(this->fire_); 269 */ 257 if(!network::Host::running()){ 258 this->backlight_ = new Backlight(this->maxSpeed_, 0.8); 259 this->backlight_->create(); 260 this->attachObject(this->backlight_); 261 this->backlight_->setPosition(-2.35, 0, 0.2); 262 this->backlight_->setColour(this->getProjectileColour()); 263 264 this->smoke_ = new ParticleSpawner(); 265 this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3); 266 this->attachObject(this->smoke_); 267 268 this->fire_ = new ParticleSpawner(); 269 this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1); 270 this->attachObject(this->fire_); 271 } 272 270 273 // END CREATING ADDITIONAL EFFECTS 271 274
Note: See TracChangeset
for help on using the changeset viewer.