- Timestamp:
- Oct 27, 2008, 4:08:51 AM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox/objects/worldentities/pawns
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/objects/worldentities/pawns/Spectator.cc
r2006 r2019 33 33 #include "core/Core.h" 34 34 #include "objects/worldentities/Model.h" 35 #include "objects/Scene.h" 36 #include "objects/infos/PlayerInfo.h" 35 37 #include "tools/BillboardSet.h" 36 38 … … 39 41 CreateFactory(Spectator); 40 42 41 Spectator::Spectator( )43 Spectator::Spectator(BaseObject* creator) : ControllableEntity(creator) 42 44 { 43 45 RegisterObject(Spectator); … … 54 56 55 57 // test test test 58 if (this->getScene()->getSceneManager()) 56 59 { 57 60 this->testmesh_ = new Mesh(); 58 61 this->testnode_ = this->getNode()->createChildSceneNode(); 59 this->testmesh_->setMeshSource( "assff.mesh");62 this->testmesh_->setMeshSource(this->getScene()->getSceneManager(), "assff.mesh"); 60 63 if (this->testmesh_->getEntity()) 61 64 this->testnode_->attachObject(this->testmesh_->getEntity()); … … 64 67 this->testnode_->scale(10, 10, 10); 65 68 } 69 else 70 { 71 this->testmesh_ = 0; 72 this->testnode_ = 0; 73 } 66 74 // test test test 67 75 68 76 this->greetingFlare_ = new BillboardSet(); 69 this->greetingFlare_->setBillboardSet( "Examples/Flare", ColourValue(1.0, 1.0, 0.8), Vector3(0, 20, 0), 1);77 this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 1.0, 0.8), Vector3(0, 20, 0), 1); 70 78 this->getNode()->attachObject(this->greetingFlare_->getBillboardSet()); 71 79 this->greetingFlare_->setVisible(false); … … 80 88 if (this->isInitialized()) 81 89 { 82 delete this->greetingFlare_; 90 if (this->greetingFlare_) 91 { 92 this->getNode()->detachObject(this->greetingFlare_->getBillboardSet()); 93 delete this->greetingFlare_; 94 } 83 95 84 96 // test test test 85 97 { 86 delete this->testmesh_; 87 delete this->testnode_; 98 if (this->testmesh_ && this->testnode_) 99 this->testnode_->detachObject(this->testmesh_->getEntity()); 100 101 if (this->testmesh_) 102 delete this->testmesh_; 103 104 if (this->testnode_) 105 this->getNode()->removeAndDestroyChild(this->testnode_->getName()); 88 106 } 89 107 // test test test … … 177 195 void Spectator::fire() 178 196 { 197 if (this->getPlayer()) 198 this->getPlayer()->setReadyToSpawn(true); 179 199 } 180 200 -
code/branches/objecthierarchy/src/orxonox/objects/worldentities/pawns/Spectator.h
r2006 r2019 39 39 { 40 40 public: 41 Spectator( );41 Spectator(BaseObject* creator); 42 42 virtual ~Spectator(); 43 43
Note: See TracChangeset
for help on using the changeset viewer.