- Timestamp:
- Dec 16, 2008, 6:01:13 PM (16 years ago)
- Location:
- code/branches/presentation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation
-
code/branches/presentation/src/orxonox/tools/ParticleInterface.cc
r2459 r2485 52 52 ParticleInterface::ParticleInterface(Ogre::SceneManager* scenemanager, const std::string& templateName, LODParticle::LOD detaillevel) 53 53 { 54 Register RootObject(ParticleInterface);54 RegisterObject(ParticleInterface); 55 55 56 56 assert(scenemanager); … … 62 62 this->bVisible_ = true; 63 63 this->bAllowedByLOD_ = true; 64 this->speedFactor_ = 1.0f; 64 65 65 66 if (Core::showsGraphics()) … … 68 69 { 69 70 this->particleSystem_ = this->scenemanager_->createParticleSystem("particles" + getConvertedValue<unsigned int, std::string>(ParticleInterface::counter_s++), templateName); 70 this->particleSystem_->setSpeedFactor(1.0f); 71 // this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor()); 71 this->setSpeedFactor(1.0f); 72 72 } 73 73 catch (...) … … 200 200 void ParticleInterface::setSpeedFactor(float factor) 201 201 { 202 if (this->particleSystem_) 203 { 204 // this->particleSystem_->setSpeedFactor(Orxonox::getInstance().getTimeFactor() * factor); 205 this->particleSystem_->setSpeedFactor(1.0f * factor); 206 } 207 } 208 float ParticleInterface::getSpeedFactor() const 209 { 210 if (this->particleSystem_) 211 { 212 // return (this->particleSystem_->getSpeedFactor() / Orxonox::getInstance().getTimeFactor()); 213 return (this->particleSystem_->getSpeedFactor() / 1.0f); 214 } 215 else 216 return 1.0f; 202 this->speedFactor_ = factor; 203 204 if (this->particleSystem_) 205 this->particleSystem_->setSpeedFactor(factor * this->getTimeFactor()); 206 } 207 void ParticleInterface::changedTimeFactor(float factor_new, float factor_old) 208 { 209 this->setSpeedFactor(this->speedFactor_); 217 210 } 218 211
Note: See TracChangeset
for help on using the changeset viewer.