Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 10, 2008, 1:37:36 AM (16 years ago)
Author:
rgrieder
Message:

merged gui back to trunk.
update the media repository!

Location:
code/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/Ambient.cc

    r1747 r1755  
    4343#include "core/XMLPort.h"
    4444#include "core/ConsoleCommand.h"
     45#include "Settings.h"
    4546#include "GraphicsEngine.h"
    4647
     
    6667    bool Ambient::create()
    6768    {
    68         GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(ambientLight_);
     69        if (Settings::showsGraphics())
     70            GraphicsEngine::getInstance().getLevelSceneManager()->setAmbientLight(ambientLight_);
    6971        return Synchronisable::create();
    7072    }
     
    7779    void Ambient::setAmbientLight(const ColourValue& colour)
    7880    {
    79         GraphicsEngine::getSingleton().getSceneManager()->setAmbientLight(colour);
    80         ambientLight_=colour;
     81        if (Settings::showsGraphics())
     82            GraphicsEngine::getInstance().getLevelSceneManager()->setAmbientLight(colour);
     83        ambientLight_ = colour;
    8184    }
    8285
    8386    /**
    84         @brief XML loading and saving.
    85         @param xmlelement The XML-element
    86         @param loading Loading (true) or saving (false)
    87         @return The XML-element
     87    @brief
     88        XML loading and saving.
     89    @param
     90        xmlelement The XML-element
     91    @param
     92        loading Loading (true) or saving (false)
     93    @return
     94        The XML-element
    8895    */
    8996    void Ambient::XMLPort(Element& xmlelement, XMLPort::Mode mode)
  • code/trunk/src/orxonox/objects/Backlight.cc

    r1747 r1755  
    3232#include <OgreBillboard.h>
    3333#include <OgreRibbonTrail.h>
     34#include <OgreSceneManager.h>
    3435
    3536#include "core/CoreIncludes.h"
     
    3839#include "util/Math.h"
    3940#include "GraphicsEngine.h"
    40 #include "Orxonox.h"
    4141
    4242namespace orxonox
     
    5858        this->attachObject(this->billboard_.getBillboardSet());
    5959
    60         this->ribbonTrail_ = GraphicsEngine::getSingleton().getSceneManager()->createRibbonTrail(this->getName() + "RibbonTrail");
    61         this->ribbonTrailNode_ = GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName() + "RibbonTrailNode");
     60        this->ribbonTrail_ = GraphicsEngine::getInstance().getLevelSceneManager()->createRibbonTrail(this->getName() + "RibbonTrail");
     61        this->ribbonTrailNode_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName() + "RibbonTrailNode");
    6262        this->ribbonTrailNode_->attachObject(this->ribbonTrail_);
    6363        this->ribbonTrail_->addNode(this->getNode());
     
    6868        this->ribbonTrail_->setMaterialName("Trail/backlighttrail");
    6969
    70         this->setTimeFactor(Orxonox::getSingleton()->getTimeFactor());
     70        //this->setTimeFactor(Orxonox::getInstance().getTimeFactor());
     71        this->setTimeFactor(1.0f);
    7172    }
    7273
     
    7677        {
    7778            this->detachObject(this->billboard_.getBillboardSet());
    78             GraphicsEngine::getSingleton().getSceneManager()->destroySceneNode(this->getName() + "RibbonTrailNode");
    79             GraphicsEngine::getSingleton().getSceneManager()->destroyRibbonTrail(this->ribbonTrail_);
     79            GraphicsEngine::getInstance().getLevelSceneManager()->destroySceneNode(this->getName() + "RibbonTrailNode");
     80            GraphicsEngine::getInstance().getLevelSceneManager()->destroyRibbonTrail(this->ribbonTrail_);
    8081        }
    8182    }
  • code/trunk/src/orxonox/objects/Camera.cc

    r1747 r1755  
    5252  {
    5353    this->bHasFocus_ = false;
    54     this->cameraNode_ = GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(node->getName() + "Camera");
     54    this->cameraNode_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(node->getName() + "Camera");
    5555    if( node != NULL )
    5656      this->setPositionNode(node);
     
    6060  {
    6161    CameraHandler::getInstance()->releaseFocus(this);
    62     GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->removeAndDestroyChild(cameraNode_->getName());
     62    GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->removeAndDestroyChild(cameraNode_->getName());
    6363  }
    6464
  • code/trunk/src/orxonox/objects/CameraHandler.cc

    r1505 r1755  
    4444  CameraHandler::CameraHandler()
    4545  {
    46     this->cam_ = GraphicsEngine::getSingleton().getSceneManager()->createCamera("Cam");
    47     GraphicsEngine::getSingleton().getRenderWindow()->addViewport(this->cam_);
     46    this->cam_ = GraphicsEngine::getInstance().getLevelSceneManager()->createCamera("Cam");
     47    GraphicsEngine::getInstance().getViewport()->setCamera(this->cam_);
     48    //GraphicsEngine::getInstance().getRenderWindow()->addViewport(this->cam_, 2, 0.4, 0.4, 0.2, 0.2);
    4849    /*this->activeCamera_ = *ObjectList<Camera>::begin();
    4950    this->activeCamera_->cam_ = this->cam_;*/
  • code/trunk/src/orxonox/objects/ParticleSpawner.cc

    r1608 r1755  
    3030#include "ParticleSpawner.h"
    3131
     32#include <OgreSceneManager.h>
    3233#include "core/CoreIncludes.h"
    3334#include "core/Executor.h"
     
    7980        this->setPosition(this->getNode()->getParent()->getPosition());
    8081        this->getNode()->getParent()->removeChild(this->getNode());
    81         GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->addChild(this->getNode());
     82        GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->addChild(this->getNode());
    8283        if (this->particle_)
    8384            this->particle_->setEnabled(false);
  • code/trunk/src/orxonox/objects/Skybox.cc

    r1747 r1755  
    3939#include "core/XMLPort.h"
    4040#include "util/Debug.h"
     41#include "Settings.h"
    4142
    4243namespace orxonox
     
    5657    void Skybox::setSkybox(const std::string& skyboxname)
    5758    {
    58         GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(true, skyboxname);
     59        if (Settings::showsGraphics())
     60            GraphicsEngine::getInstance().getLevelSceneManager()->setSkyBox(true, skyboxname);
    5961    }
    6062
     
    8789    {
    8890        SUPER(Skybox, changedVisibility);
    89         GraphicsEngine::getSingleton().getSceneManager()->setSkyBox(this->isVisible(), this->skyboxSrc_);
     91        if (Settings::showsGraphics())
     92            GraphicsEngine::getInstance().getLevelSceneManager()->setSkyBox(this->isVisible(), this->skyboxSrc_);
    9093    }
    9194}
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r1751 r1755  
    4949#include "CameraHandler.h"
    5050#include "ParticleSpawner.h"
     51#include "Settings.h"
    5152#include "RotatingProjectile.h"
    5253#include "ParticleProjectile.h"
     
    7980      }
    8081      assert(0);
     82      return 0;
    8183    }
    8284
     
    194196    void SpaceShip::init()
    195197    {
    196         // START CREATING THRUSTERS
    197         this->tt1_ = new ParticleInterface("Orxonox/thruster1", LODParticle::low);
    198         this->tt1_->createNewEmitter();
    199         this->tt1_->getAllEmitters()->setDirection(-this->getInitialDir());
    200         this->tt1_->getEmitter(0)->setPosition(Vector3(-15, 20, -1));
    201         this->tt1_->getEmitter(1)->setPosition(Vector3(-15, -20, -1));
    202         this->tt1_->setSpeedFactor(3.0);
    203 
    204         Ogre::SceneNode* node2a = this->getNode()->createChildSceneNode(this->getName() + "particle2a");
    205         node2a->setInheritScale(false);
    206         node2a->setScale(1, 1, 1);
    207         tt1_->addToSceneNode(node2a);
    208 
    209         this->tt2_ = new ParticleInterface("Orxonox/thruster2", LODParticle::normal);
    210         this->tt2_->createNewEmitter();
    211         this->tt2_->getAllEmitters()->setDirection(Vector3(-1, 0, 0));
    212         this->tt2_->getEmitter(0)->setPosition(Vector3(-30, 40, -2));
    213         this->tt2_->getEmitter(1)->setPosition(Vector3(-30, -40, -2));
    214 
    215         Ogre::SceneNode* node2b = this->getNode()->createChildSceneNode(this->getName() + "particle2b");
    216         node2b->setInheritScale(false);
    217         node2b->setScale(0.5, 0.5, 0.5);
    218         tt2_->addToSceneNode(node2b);
    219 
    220         this->leftThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, -10, -0.5));
    221         this->rightThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, 10, -0.5));
    222 
    223         Ogre::SceneNode* node2c = this->getNode()->createChildSceneNode(this->getName() + "particle2c");
    224         node2c->setInheritScale(false);
    225         node2c->setScale(2, 2, 2);
    226         node2c->attachObject(this->leftThrusterFlare_.getBillboardSet());
    227         node2c->attachObject(this->rightThrusterFlare_.getBillboardSet());
    228         // END CREATING THRUSTERS
    229 
    230         // START CREATING BLINKING LIGHTS
    231         this->redBillboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
    232         this->greenBillboard_.setBillboardSet("Examples/Flare", ColourValue(0.0, 1.0, 0.0), 1);
    233 
    234         this->redNode_ = this->getNode()->createChildSceneNode(this->getName() + "red", Vector3(0.3, 4.0, -0.3));
    235         this->redNode_->setInheritScale(false);
    236         this->greenNode_ = this->getNode()->createChildSceneNode(this->getName() + "green", Vector3(0.3, -4.0, -0.3));
    237         this->greenNode_->setInheritScale(false);
    238 
    239         this->redNode_->attachObject(this->redBillboard_.getBillboardSet());
    240         this->redNode_->setScale(0.3, 0.3, 0.3);
    241 
    242         this->greenNode_->attachObject(this->greenBillboard_.getBillboardSet());
    243         this->greenNode_->setScale(0.3, 0.3, 0.3);
    244         // END CREATING BLINKING LIGHTS
    245 
    246         // START CREATING ADDITIONAL EFFECTS
    247         /*if(!network::Host::running() || network::Host::isServer()){
    248           this->backlight_ = new Backlight(this->maxSpeed_, 0.8);
    249           this->attachObject(this->backlight_);
    250           this->backlight_->setPosition(-2.35, 0, 0.2);
    251           this->backlight_->setColour(this->getProjectileColour());
    252    
    253           this->smoke_ = new ParticleSpawner();
    254           this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3);
    255           this->attachObject(this->smoke_);
    256    
    257           this->fire_ = new ParticleSpawner();
    258           this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1);
    259           this->attachObject(this->fire_);
    260         }*/
    261         // END CREATING ADDITIONAL EFFECTS
    262 
    263         if (this->isExactlyA(Class(SpaceShip)))
    264         {
    265             // START of testing crosshair
    266             this->crosshairNear_.setBillboardSet("Orxonox/Crosshair", ColourValue(1.0, 1.0, 0.0), 1);
    267             this->crosshairFar_.setBillboardSet("Orxonox/Crosshair", ColourValue(1.0, 1.0, 0.0), 1);
    268 
    269             this->chNearNode_ = this->getNode()->createChildSceneNode(this->getName() + "near", Vector3(50.0, 0.0, 0.0));
    270             this->chNearNode_->setInheritScale(false);
    271             this->chFarNode_ = this->getNode()->createChildSceneNode(this->getName() + "far", Vector3(200.0, 0.0, 0.0));
    272             this->chFarNode_->setInheritScale(false);
    273 
    274             this->chNearNode_->attachObject(this->crosshairNear_.getBillboardSet());
    275             this->chNearNode_->setScale(0.2, 0.2, 0.2);
    276 
    277             this->chFarNode_->attachObject(this->crosshairFar_.getBillboardSet());
    278             this->chFarNode_->setScale(0.4, 0.4, 0.4);
    279             // END of testing crosshair
     198        if (Settings::showsGraphics())
     199        {
     200            // START CREATING THRUSTERS
     201            this->tt1_ = new ParticleInterface("Orxonox/thruster1", LODParticle::low);
     202            this->tt1_->createNewEmitter();
     203            this->tt1_->getAllEmitters()->setDirection(-this->getInitialDir());
     204            this->tt1_->getEmitter(0)->setPosition(Vector3(-15, 20, -1));
     205            this->tt1_->getEmitter(1)->setPosition(Vector3(-15, -20, -1));
     206            this->tt1_->setSpeedFactor(3.0);
     207
     208            Ogre::SceneNode* node2a = this->getNode()->createChildSceneNode(this->getName() + "particle2a");
     209            node2a->setInheritScale(false);
     210            node2a->setScale(1, 1, 1);
     211            tt1_->addToSceneNode(node2a);
     212
     213            this->tt2_ = new ParticleInterface("Orxonox/thruster2", LODParticle::normal);
     214            this->tt2_->createNewEmitter();
     215            this->tt2_->getAllEmitters()->setDirection(Vector3(-1, 0, 0));
     216            this->tt2_->getEmitter(0)->setPosition(Vector3(-30, 40, -2));
     217            this->tt2_->getEmitter(1)->setPosition(Vector3(-30, -40, -2));
     218
     219            Ogre::SceneNode* node2b = this->getNode()->createChildSceneNode(this->getName() + "particle2b");
     220            node2b->setInheritScale(false);
     221            node2b->setScale(0.5, 0.5, 0.5);
     222            tt2_->addToSceneNode(node2b);
     223
     224            this->leftThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, -10, -0.5));
     225            this->rightThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, 10, -0.5));
     226
     227            Ogre::SceneNode* node2c = this->getNode()->createChildSceneNode(this->getName() + "particle2c");
     228            node2c->setInheritScale(false);
     229            node2c->setScale(2, 2, 2);
     230            node2c->attachObject(this->leftThrusterFlare_.getBillboardSet());
     231            node2c->attachObject(this->rightThrusterFlare_.getBillboardSet());
     232            // END CREATING THRUSTERS
     233
     234            // START CREATING BLINKING LIGHTS
     235            this->redBillboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
     236            this->greenBillboard_.setBillboardSet("Examples/Flare", ColourValue(0.0, 1.0, 0.0), 1);
     237
     238            this->redNode_ = this->getNode()->createChildSceneNode(this->getName() + "red", Vector3(0.3, 4.0, -0.3));
     239            this->redNode_->setInheritScale(false);
     240            this->greenNode_ = this->getNode()->createChildSceneNode(this->getName() + "green", Vector3(0.3, -4.0, -0.3));
     241            this->greenNode_->setInheritScale(false);
     242
     243            this->redNode_->attachObject(this->redBillboard_.getBillboardSet());
     244            this->redNode_->setScale(0.3, 0.3, 0.3);
     245
     246            this->greenNode_->attachObject(this->greenBillboard_.getBillboardSet());
     247            this->greenNode_->setScale(0.3, 0.3, 0.3);
     248            // END CREATING BLINKING LIGHTS
     249
     250            // START CREATING ADDITIONAL EFFECTS
     251            /*this->backlight_ = new Backlight(this->maxSpeed_, 0.8);
     252            this->attachObject(this->backlight_);
     253            this->backlight_->setPosition(-2.35, 0, 0.2);
     254            this->backlight_->setColour(this->getProjectileColour());
     255
     256            this->smoke_ = new ParticleSpawner();
     257            this->smoke_->setParticle("Orxonox/smoke5", LODParticle::normal, 0, 0, 3);
     258            this->attachObject(this->smoke_);
     259
     260            this->fire_ = new ParticleSpawner();
     261            this->fire_->setParticle("Orxonox/fire3", LODParticle::normal, 0, 0, 1);
     262            this->attachObject(this->fire_);
     263            */
     264            // END CREATING ADDITIONAL EFFECTS
     265
     266            if (this->isExactlyA(Class(SpaceShip)))
     267            {
     268                // START of testing crosshair
     269                this->crosshairNear_.setBillboardSet("Orxonox/Crosshair", ColourValue(1.0, 1.0, 0.0), 1);
     270                this->crosshairFar_.setBillboardSet("Orxonox/Crosshair", ColourValue(1.0, 1.0, 0.0), 1);
     271
     272                this->chNearNode_ = this->getNode()->createChildSceneNode(this->getName() + "near", Vector3(50.0, 0.0, 0.0));
     273                this->chNearNode_->setInheritScale(false);
     274                this->chFarNode_ = this->getNode()->createChildSceneNode(this->getName() + "far", Vector3(200.0, 0.0, 0.0));
     275                this->chFarNode_->setInheritScale(false);
     276
     277                this->chNearNode_->attachObject(this->crosshairNear_.getBillboardSet());
     278                this->chNearNode_->setScale(0.2, 0.2, 0.2);
     279
     280                this->chFarNode_->attachObject(this->crosshairFar_.getBillboardSet());
     281                this->chFarNode_->setScale(0.4, 0.4, 0.4);
     282                // END of testing crosshair
     283            }
    280284        }
    281285        // END of testing crosshair
     
    429433            this->cam_->tick(dt);
    430434
    431         if (this->smoke_)
    432             this->smoke_->setVisible(this->isVisible() && this->health_ < 40);
    433         if (this->fire_)
    434             this->fire_->setVisible(this->isVisible() && this->health_ < 20);
    435 
    436         if (this->backlight_)
    437         {   // (there's already fire ||                 we're to slow                 ||                  we're moving backwards                  )
    438             if (this->health_ < 20   || this->getVelocity().squaredLength() < 150*150 || this->getVelocity().dotProduct(this->getInitialDir()) < 0)
    439                 this->backlight_->setActive(false);
    440             else
    441                 this->backlight_->setActive(true);
    442         }
    443 
    444         if (this->redNode_ && this->greenNode_)
    445         {
    446             this->blinkTime_ += dt;
    447             float redScale = 0.15 + 0.15 * sin(this->blinkTime_ * 10.0);
    448             float greenScale = 0.15 - 0.15 * sin(this->blinkTime_ * 10.0);
    449             this->redNode_->setScale(redScale, redScale, redScale);
    450             this->greenNode_->setScale(greenScale, greenScale, greenScale);
     435        if (Settings::showsGraphics())
     436        {
     437            if (this->smoke_)
     438                this->smoke_->setVisible(this->isVisible() && this->health_ < 40);
     439            if (this->fire_)
     440                this->fire_->setVisible(this->isVisible() && this->health_ < 20);
     441
     442            if (this->backlight_)
     443            {   // (there's already fire ||                 we're to slow                 ||                  we're moving backwards                  )
     444                if (this->health_ < 20   || this->getVelocity().squaredLength() < 150*150 || this->getVelocity().dotProduct(this->getInitialDir()) < 0)
     445                    this->backlight_->setActive(false);
     446                else
     447                    this->backlight_->setActive(true);
     448            }
     449
     450            if (this->redNode_ && this->greenNode_)
     451            {
     452                this->blinkTime_ += dt;
     453                float redScale = 0.15 + 0.15 * sin(this->blinkTime_ * 10.0);
     454                float greenScale = 0.15 - 0.15 * sin(this->blinkTime_ * 10.0);
     455                this->redNode_->setScale(redScale, redScale, redScale);
     456                this->greenNode_->setScale(greenScale, greenScale, greenScale);
     457            }
    451458        }
    452459
  • code/trunk/src/orxonox/objects/SpaceShipAI.cc

    r1747 r1755  
    3939#include "core/XMLPort.h"
    4040#include "tools/ParticleInterface.h"
     41#include "Settings.h"
    4142
    4243#define ACTION_INTERVAL 1.0f
     
    102103            newenemy->XMLPort(xmlelement, XMLPort::LoadObject);
    103104
    104             ParticleSpawner* spawneffect = new ParticleSpawner("Orxonox/fairytwirl", LODParticle::normal, 2.0, 0, 0, newenemy->getOrth());
    105             spawneffect->setPosition(newenemy->getPosition() - newenemy->getOrth() * 50);
    106             spawneffect->create();
     105            if (Settings::showsGraphics())
     106            {
     107                ParticleSpawner* spawneffect = new ParticleSpawner("Orxonox/fairytwirl", LODParticle::normal, 2.0, 0, 0, newenemy->getOrth());
     108                spawneffect->setPosition(newenemy->getPosition() - newenemy->getOrth() * 50);
     109                spawneffect->create();
     110            }
    107111        }
    108112    }
     
    182186    void SpaceShipAI::kill()
    183187    {
    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);
    196         explosion->setPosition(this->getPosition());
    197         explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
    198         explosion->setScale(4);
    199         explosion->create();
    200 
    201         Vector3 ringdirection = Vector3(rnd(), rnd(), rnd());
    202         ringdirection.normalise();
    203         explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::normal, 3.0, 0.5, 0, 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, 0, ringdirection);
    209         explosion->setPosition(this->getPosition());
    210         explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
    211         explosion->setScale(4);
    212         explosion->create();
     188        if (Settings::showsGraphics())
     189        {
     190            ParticleSpawner* explosion = new ParticleSpawner("Orxonox/BigExplosion1part1", LODParticle::low, 3.0);
     191            explosion->setPosition(this->getPosition());
     192            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     193            explosion->setScale(4);
     194            explosion->create();
     195
     196            explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::normal, 3.0);
     197            explosion->setPosition(this->getPosition());
     198            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     199            explosion->setScale(4);
     200            explosion->create();
     201            explosion = new ParticleSpawner("Orxonox/BigExplosion1part2", LODParticle::high, 3.0);
     202            explosion->setPosition(this->getPosition());
     203            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     204            explosion->setScale(4);
     205            explosion->create();
     206
     207            Vector3 ringdirection = Vector3(rnd(), rnd(), rnd());
     208            ringdirection.normalise();
     209            explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::normal, 3.0, 0.5, 0, ringdirection);
     210            explosion->setPosition(this->getPosition());
     211            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     212            explosion->setScale(4);
     213            explosion->create();
     214            explosion = new ParticleSpawner("Orxonox/BigExplosion1part3", LODParticle::high, 3.0, 0.5, 0, ringdirection);
     215            explosion->setPosition(this->getPosition());
     216            explosion->getParticleInterface()->setKeepParticlesInLocalSpace(true);
     217            explosion->setScale(4);
     218            explosion->create();
     219        }
    213220
    214221        delete this;
  • code/trunk/src/orxonox/objects/Tickable.h

    r1747 r1755  
    2929/*!
    3030    @file Tickable.h
    31     @brief Definition of the Tickable interface.
     31    @brief Declaration of the Tickable interface.
    3232
    3333    The Tickable interface provides a tick(dt) function, that gets called every frame.
  • code/trunk/src/orxonox/objects/WorldEntity.cc

    r1747 r1755  
    3232#include <string>
    3333#include <sstream>
     34#include <OgreSceneManager.h>
    3435
    3536#include "tinyxml/tinyxml.h"
     
    4950        RegisterObject(WorldEntity);
    5051
    51         if (GraphicsEngine::getSingleton().getSceneManager())
     52        if (GraphicsEngine::getInstance().getLevelSceneManager())
    5253        {
    5354            std::ostringstream name;
    5455            name << (WorldEntity::worldEntityCounter_s++);
    5556            this->setName("WorldEntity" + name.str());
    56             this->node_ = GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());
     57            this->node_ = GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());
    5758
    5859            registerAllVariables();
     
    7778        {
    7879            this->getNode()->removeAndDestroyAllChildren();
    79             GraphicsEngine::getSingleton().getSceneManager()->destroySceneNode(this->getName());
     80            GraphicsEngine::getInstance().getLevelSceneManager()->destroySceneNode(this->getName());
    8081        }
    8182    }
     
    177178    void WorldEntity::attachObject(const WorldEntity& obj) const
    178179    {
    179         GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->removeChild(obj.getNode());
     180        GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->removeChild(obj.getNode());
    180181        this->getNode()->addChild(obj.getNode());
    181182    }
     
    183184    void WorldEntity::attachObject(WorldEntity* obj) const
    184185    {
    185         GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->removeChild(obj->getNode());
     186        GraphicsEngine::getInstance().getLevelSceneManager()->getRootSceneNode()->removeChild(obj->getNode());
    186187        this->getNode()->addChild(obj->getNode());
    187188    }
  • code/trunk/src/orxonox/objects/WorldEntity.h

    r1747 r1755  
    3131
    3232#include "OrxonoxPrereqs.h"
     33#include <OgrePrerequisites.h>
    3334
    34 #include <OgreSceneManager.h>
    3535#include <OgreSceneNode.h>
    36 
    3736#include "util/Math.h"
    3837#include "util/XMLIncludes.h"
Note: See TracChangeset for help on using the changeset viewer.