Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 2:10:11 AM (15 years ago)
Author:
landauf
Message:

merged weapon2 branch to presentation

Location:
code/branches/presentation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

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

    r2099 r2493  
    3030#include "BillboardProjectile.h"
    3131
    32 #include <OgreBillboard.h>
     32#include <OgreBillboardSet.h>
    3333
    3434#include "core/CoreIncludes.h"
     35#include "objects/Scene.h"
    3536
    3637namespace orxonox
     
    3839    CreateFactory(BillboardProjectile);
    3940
    40     BillboardProjectile::BillboardProjectile(BaseObject* creator, Weapon* owner) : Projectile(creator, owner)
     41    BillboardProjectile::BillboardProjectile(BaseObject* creator) : Projectile(creator)
    4142    {
    4243        RegisterObject(BillboardProjectile);
    4344
    44         this->billboard_.setBillboardSet("Examples/Flare", ColourValue(1.0, 1.0, 0.5), 1);
    45         this->attachObject(this->billboard_.getBillboardSet());
    46         this->scale(0.5);
     45        assert(this->getScene()->getSceneManager()); // getScene() was already checked by WorldEntity
     46
     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);
    4750    }
    4851
    4952    BillboardProjectile::~BillboardProjectile()
    5053    {
    51         if (this->isInitialized() && this->owner_)
    52             this->detachObject(this->billboard_.getBillboardSet());
     54        //if (this->isInitialized() && this->owner_)
     55            //this->detachObject(this->billboard_.getBillboardSet());
    5356    }
    5457
    5558    void BillboardProjectile::setColour(const ColourValue& colour)
    5659    {
    57         this->billboard_.getBillboardSet()->getBillboard(0)->setColour(colour);
     60        this->billboard_.setColour(colour);
    5861    }
    5962
Note: See TracChangeset for help on using the changeset viewer.