Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 5:41:29 AM (15 years ago)
Author:
landauf
Message:
  • some changes, maybe fixed a crash, not sure
  • fixed strange camera behavior
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc

    r2493 r2497  
    3232#include <OgreBillboardSet.h>
    3333
     34#include "core/Core.h"
    3435#include "core/CoreIncludes.h"
    3536#include "objects/Scene.h"
     
    4344        RegisterObject(BillboardProjectile);
    4445
    45         assert(this->getScene()->getSceneManager()); // getScene() was already checked by WorldEntity
     46        if (Core::showsGraphics())
     47        {
     48            assert(this->getScene()->getSceneManager()); // getScene() was already checked by WorldEntity
     49            this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(0.5, 0.5, 0.7, 0.8), 1);
     50            this->attachOgreObject(this->billboard_.getBillboardSet());
     51        }
    4652
    47         this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(0.5, 0.5, 0.7, 0.8), 1);
    48         this->attachOgreObject(this->billboard_.getBillboardSet());
    49         this->scale(0.2);
     53        this->setScale(0.2);
    5054    }
    5155
    5256    BillboardProjectile::~BillboardProjectile()
    5357    {
    54         //if (this->isInitialized() && this->owner_)
    55             //this->detachObject(this->billboard_.getBillboardSet());
     58        if (this->isInitialized() && Core::showsGraphics() && this->billboard_.getBillboardSet())
     59            this->detachOgreObject(this->billboard_.getBillboardSet());
    5660    }
    5761
     
    6468    {
    6569        SUPER(BillboardProjectile, changedVisibility);
     70
    6671        this->billboard_.setVisible(this->isVisible());
    6772    }
Note: See TracChangeset for help on using the changeset viewer.