Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 7, 2008, 11:40:50 PM (17 years ago)
Author:
landauf
Message:
  • added configurable detaillevel for particle effects to [GraphicsEngine]
  • thrusters work properly with changing gamespeed
Location:
code/trunk/src/orxonox/objects
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/ParticleProjectile.cc

    r1560 r1563  
    4343        if (this->owner_)
    4444        {
    45             this->particles_ = new ParticleInterface("Orxonox/shot2");
     45            this->particles_ = new ParticleInterface("Orxonox/shot2", LODParticle::normal);
    4646            this->particles_->addToSceneNode(this->getNode());
    4747            this->particles_->getAllEmitters()->setDirection(-this->owner_->getInitialDir());
  • code/trunk/src/orxonox/objects/ParticleSpawner.cc

    r1559 r1563  
    4343    }
    4444
    45     ParticleSpawner::ParticleSpawner(const std::string& templateName, float lifetime, float delay, const Vector3& direction)
     45    ParticleSpawner::ParticleSpawner(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime, float delay, const Vector3& direction)
    4646    {
    4747        RegisterObject(ParticleSpawner);
     
    5050        executor->setDefaultValues(lifetime);
    5151        this->timer_.setTimer(delay, false, this, executor);
    52         this->particle_ = new ParticleInterface(templateName);
     52        this->particle_ = new ParticleInterface(templateName, detaillevel);
    5353        this->particle_->addToSceneNode(this->getNode());
    5454        this->particle_->setEnabled(false);
  • code/trunk/src/orxonox/objects/ParticleSpawner.h

    r1552 r1563  
    3333
    3434#include "WorldEntity.h"
    35 #include "../tools/Timer.h"
     35#include "tools/Timer.h"
    3636
    3737namespace orxonox
     
    4141        public:
    4242            ParticleSpawner();
    43             ParticleSpawner(const std::string& templateName, float lifetime, float delay = 0, const Vector3& direction = Vector3::ZERO);
     43            ParticleSpawner(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime, float delay = 0, const Vector3& direction = Vector3::ZERO);
    4444            virtual ~ParticleSpawner();
    4545            inline ParticleInterface* getParticleInterface() const
  • code/trunk/src/orxonox/objects/Projectile.cc

    r1558 r1563  
    9797                    if (it->isA(Class(SpaceShipAI)))
    9898                        ((SpaceShipAI*)(*it))->damage(this->damage_);
    99                     ParticleSpawner* explosion = new ParticleSpawner(this->explosionTemplateName_, 2.0);
     99                    ParticleSpawner* explosion = new ParticleSpawner(this->explosionTemplateName_, LODParticle::low, 2.0);
    100100                    explosion->setPosition(this->getPosition());
    101101                    explosion->create();
    102                     ParticleSpawner* smoke = new ParticleSpawner(this->smokeTemplateName_, 6.0, 0.0);
     102                    ParticleSpawner* smoke = new ParticleSpawner(this->smokeTemplateName_, LODParticle::normal, 6.0, 0.0);
    103103                    smoke->setPosition(this->getPosition());
    104104                    smoke->getParticleInterface()->setSpeedFactor(3.0);
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r1562 r1563  
    187187    {
    188188        // START CREATING THRUSTER
    189         this->tt1_ = new ParticleInterface("Orxonox/thruster1");
     189        this->tt1_ = new ParticleInterface("Orxonox/thruster1", LODParticle::low);
    190190        this->tt1_->createNewEmitter();
    191191        this->tt1_->getAllEmitters()->setDirection(-this->getInitialDir());
     
    199199        tt1_->addToSceneNode(node2a);
    200200
    201         this->tt2_ = new ParticleInterface("Orxonox/thruster2");
     201        this->tt2_ = new ParticleInterface("Orxonox/thruster2", LODParticle::normal);
    202202        this->tt2_->createNewEmitter();
    203203        this->tt2_->getAllEmitters()->setDirection(Vector3(-1, 0, 0));
  • code/trunk/src/orxonox/objects/SpaceShipAI.cc

    r1562 r1563  
    102102            newenemy->XMLPort(xmlelement, XMLPort::LoadObject);
    103103
    104             ParticleSpawner* spawneffect = new ParticleSpawner("Orxonox/fairytwirl", 2.0, 0.0, newenemy->getOrth());
     104            ParticleSpawner* spawneffect = new ParticleSpawner("Orxonox/fairytwirl", LODParticle::normal, 2.0, 0.0, newenemy->getOrth());
    105105            spawneffect->setPosition(newenemy->getPosition() - newenemy->getOrth() * 50);
    106106            spawneffect->create();
     
    182182    void SpaceShipAI::kill()
    183183    {
    184         ParticleSpawner* explosion = new ParticleSpawner("Orxonox/BigExplosion1part1", 3.0);
    185         explosion->setPosition(this->getPosition());
    186         explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
    187         explosion->setScale(4);
    188         explosion->create();
    189 
    190         explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", 3.0);
     184        ParticleSpawner* explosion = new ParticleSpawner("Orxonox/BigExplosion1part1", LODParticle::low, 3.0);
     185        explosion->setPosition(this->getPosition());
     186        explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     187        explosion->setScale(4);
     188        explosion->create();
     189
     190        explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::normal, 3.0);
     191        explosion->setPosition(this->getPosition());
     192        explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     193        explosion->setScale(4);
     194        explosion->create();
     195        explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::high, 3.0);
    191196        explosion->setPosition(this->getPosition());
    192197        explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     
    196201        Vector3 ringdirection = Vector3(rnd(), rnd(), rnd());
    197202        ringdirection.normalise();
    198         explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", 3.0, 0.5, ringdirection);
     203        explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::normal, 3.0, 0.5, ringdirection);
     204        explosion->setPosition(this->getPosition());
     205        explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     206        explosion->setScale(4);
     207        explosion->create();
     208        explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::high, 3.0, 0.5, ringdirection);
    199209        explosion->setPosition(this->getPosition());
    200210        explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
Note: See TracChangeset for help on using the changeset viewer.