- Timestamp:
- Feb 14, 2009, 10:17:35 PM (15 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc
r2099 r2662 30 30 #include "BillboardProjectile.h" 31 31 32 #include <OgreBillboard .h>32 #include <OgreBillboardSet.h> 33 33 34 #include "core/Core.h" 34 35 #include "core/CoreIncludes.h" 36 #include "objects/Scene.h" 35 37 36 38 namespace orxonox … … 38 40 CreateFactory(BillboardProjectile); 39 41 40 BillboardProjectile::BillboardProjectile(BaseObject* creator , Weapon* owner) : Projectile(creator, owner)42 BillboardProjectile::BillboardProjectile(BaseObject* creator) : Projectile(creator) 41 43 { 42 44 RegisterObject(BillboardProjectile); 43 45 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); 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 } 52 53 this->setScale(0.2); 47 54 } 48 55 49 56 BillboardProjectile::~BillboardProjectile() 50 57 { 51 if (this->isInitialized() && this->owner_)52 this->detachO bject(this->billboard_.getBillboardSet());58 if (this->isInitialized() && Core::showsGraphics() && this->billboard_.getBillboardSet()) 59 this->detachOgreObject(this->billboard_.getBillboardSet()); 53 60 } 54 61 55 62 void BillboardProjectile::setColour(const ColourValue& colour) 56 63 { 57 this->billboard_. getBillboardSet()->getBillboard(0)->setColour(colour);64 this->billboard_.setColour(colour); 58 65 } 59 66 … … 61 68 { 62 69 SUPER(BillboardProjectile, changedVisibility); 70 63 71 this->billboard_.setVisible(this->isVisible()); 64 72 }
Note: See TracChangeset
for help on using the changeset viewer.