Changeset 2044 for code/branches/objecthierarchy/src/orxonox
- Timestamp:
- Oct 29, 2008, 11:37:19 AM (16 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox
- Files:
-
- 6 added
- 2 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/CMakeLists.txt
r2042 r2044 37 37 38 38 tools/BillboardSet.cc 39 tools/Light.cc40 39 tools/Mesh.cc 41 40 tools/ParticleInterface.cc … … 57 56 objects/worldentities/ControllableEntity.cc 58 57 objects/worldentities/Model.cc 58 objects/worldentities/Billboard.cc 59 objects/worldentities/BlinkingBillboard.cc 60 objects/worldentities/Light.cc 59 61 objects/worldentities/Camera.cc 60 62 objects/worldentities/CameraPosition.cc -
code/branches/objecthierarchy/src/orxonox/OrxonoxPrereqs.h
r2042 r2044 94 94 class Model; 95 95 class Billboard; 96 class BlinkingBillboard; 96 97 class Light; 97 class DirectionalLight;98 98 99 99 class Camera; -
code/branches/objecthierarchy/src/orxonox/objects/Scene.cc
r2040 r2044 74 74 { 75 75 Ogre::Light* light; 76 light = this->sceneManager_->createLight("Light 0");76 light = this->sceneManager_->createLight("Light-1"); 77 77 light->setType(Ogre::Light::LT_DIRECTIONAL); 78 78 light->setDiffuseColour(ColourValue(1.0, 0.9, 0.6, 1.0)); 79 79 light->setSpecularColour(ColourValue(1.0, 0.9, 0.6, 1.0)); 80 light->setDirection(1, -0. 2, 0.2);80 light->setDirection(1, -0.3, 0.3); 81 81 } 82 82 // test test test -
code/branches/objecthierarchy/src/orxonox/objects/worldentities/Backlight.h
r2027 r2044 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include " WorldEntity.h"34 #include "PositionableEntity.h" 35 35 #include "tools/BillboardSet.h" 36 36 37 37 namespace orxonox 38 38 { 39 class _OrxonoxExport Backlight : public WorldEntity39 class _OrxonoxExport Backlight : public PositionableEntity 40 40 { 41 41 public: -
code/branches/objecthierarchy/src/orxonox/objects/worldentities/Model.h
r2040 r2044 47 47 virtual void changedVisibility(); 48 48 49 inline const Mesh& getMesh() const 50 { return this->mesh_; } 51 49 52 inline void setMeshSource(const std::string& meshname) 50 53 { this->meshSrc_ = meshname; this->changedMesh(); } 51 54 inline const std::string& getMeshSource() const 52 55 { return this->meshSrc_; } 53 inline const Mesh& getMesh() const54 { return this->mesh_; }55 56 56 57 inline void setCastShadows(bool bCastShadows) -
code/branches/objecthierarchy/src/orxonox/objects/worldentities/ParticleSpawner.h
r2027 r2044 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include " WorldEntity.h"34 #include "PositionableEntity.h" 35 35 #include "tools/Timer.h" 36 36 37 37 namespace orxonox 38 38 { 39 class _OrxonoxExport ParticleSpawner : public WorldEntity39 class _OrxonoxExport ParticleSpawner : public PositionableEntity 40 40 { 41 41 public: -
code/branches/objecthierarchy/src/orxonox/tools/BillboardSet.cc
r2023 r2044 32 32 #include <sstream> 33 33 #include <cassert> 34 34 35 #include <OgreSceneManager.h> 36 #include <OgreBillboard.h> 35 37 36 #include "util/Math.h" 38 #include "util/Convert.h" 39 #include "util/String.h" 37 40 38 41 namespace orxonox … … 45 48 } 46 49 50 BillboardSet::~BillboardSet() 51 { 52 this->destroyBillboardSet(); 53 } 54 47 55 void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, int count) 48 56 { 49 assert(scenemanager); 50 51 std::ostringstream name; 52 name << (BillboardSet::billboardSetCounter_s++); 53 this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count); 54 this->billboardSet_->createBillboard(Vector3::ZERO); 55 this->billboardSet_->setMaterialName(file); 56 57 this->scenemanager_ = scenemanager; 57 this->setBillboardSet(scenemanager, file, Vector3::ZERO, count); 58 58 } 59 59 60 60 void BillboardSet::setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const ColourValue& colour, int count) 61 61 { 62 assert(scenemanager); 63 64 std::ostringstream name; 65 name << (BillboardSet::billboardSetCounter_s++); 66 this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count); 67 this->billboardSet_->createBillboard(Vector3::ZERO, colour); 68 this->billboardSet_->setMaterialName(file); 69 70 this->scenemanager_ = scenemanager; 62 this->setBillboardSet(scenemanager, file, colour, Vector3::ZERO, count); 71 63 } 72 64 … … 74 66 { 75 67 assert(scenemanager); 68 this->destroyBillboardSet(); 76 69 77 std::ostringstream name; 78 name << (BillboardSet::billboardSetCounter_s++); 79 this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count); 80 this->billboardSet_->createBillboard(position); 81 this->billboardSet_->setMaterialName(file); 70 try 71 { 72 this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(BillboardSet::billboardSetCounter_s++), count); 73 this->billboardSet_->createBillboard(position); 74 this->billboardSet_->setMaterialName(file); 75 } 76 catch (...) 77 { 78 COUT(1) << "Error: Couln't load billboard \"" << file << "\"" << std::endl; 79 } 82 80 83 81 this->scenemanager_ = scenemanager; … … 87 85 { 88 86 assert(scenemanager); 87 this->destroyBillboardSet(); 89 88 90 std::ostringstream name; 91 name << (BillboardSet::billboardSetCounter_s++); 92 this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + name.str(), count); 93 this->billboardSet_->createBillboard(position, colour); 94 this->billboardSet_->setMaterialName(file); 89 try 90 { 91 this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(BillboardSet::billboardSetCounter_s++), count); 92 this->billboardSet_->createBillboard(position, colour); 93 this->billboardSet_->setMaterialName(file); 94 } 95 catch (...) 96 { 97 COUT(1) << "Error: Couln't load billboard \"" << file << "\"" << std::endl; 98 } 95 99 96 100 this->scenemanager_ = scenemanager; 97 101 } 98 102 99 BillboardSet::~BillboardSet()103 void BillboardSet::destroyBillboardSet() 100 104 { 101 105 if (this->billboardSet_ && this->scenemanager_) 102 106 this->scenemanager_->destroyBillboardSet(this->billboardSet_); 103 107 } 108 109 const std::string& BillboardSet::getName() const 110 { 111 if (this->billboardSet_) 112 return this->billboardSet_->getName(); 113 else 114 return BLANKSTRING; 115 } 116 117 void BillboardSet::setVisible(bool visible) 118 { 119 if (this->billboardSet_) 120 this->billboardSet_->setVisible(visible); 121 } 122 123 bool BillboardSet::getVisible() const 124 { 125 if (this->billboardSet_) 126 return this->billboardSet_->getVisible(); 127 else 128 return false; 129 } 130 131 void BillboardSet::setColour(const ColourValue& colour) 132 { 133 if (this->billboardSet_) 134 { 135 for (int i = 0; i < this->billboardSet_->getNumBillboards(); ++i) 136 this->billboardSet_->getBillboard(i)->setColour(colour); 137 } 138 } 139 140 const ColourValue& BillboardSet::getColour() const 141 { 142 if (this->billboardSet_ && this->billboardSet_->getNumBillboards() > 0) 143 { 144 return this->billboardSet_->getBillboard(0)->getColour(); 145 } 146 else 147 return ColourValue::White; 148 } 149 150 void BillboardSet::setMaterial(const std::string& material) 151 { 152 if (this->billboardSet_) 153 this->billboardSet_->setMaterialName(material); 154 } 155 156 const std::string& BillboardSet::getMaterial() const 157 { 158 if (this->billboardSet_) 159 return this->billboardSet_->getMaterialName(); 160 else 161 return BLANKSTRING; 162 } 104 163 } -
code/branches/objecthierarchy/src/orxonox/tools/BillboardSet.h
r2019 r2044 44 44 BillboardSet(); 45 45 ~BillboardSet(); 46 46 47 void setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, int count = 1); 47 48 void setBillboardSet(Ogre::SceneManager* scenemanager, const std::string& file, const ColourValue& colour, int count = 1); … … 52 53 { return this->billboardSet_; } 53 54 54 inline const std::string& getName() const 55 { return this->billboardSet_->getName(); } 55 const std::string& getName() const; 56 56 57 inline void setVisible(bool visible) 58 { this->billboardSet_->setVisible(visible); } 59 inline bool getVisible() const 60 { return this->billboardSet_->getVisible(); } 57 void setVisible(bool visible); 58 bool getVisible() const; 59 60 void setColour(const ColourValue& colour); 61 const ColourValue& getColour() const; 62 63 void setMaterial(const std::string& material); 64 const std::string& getMaterial() const; 61 65 62 66 private: 67 void destroyBillboardSet(); 68 63 69 static unsigned int billboardSetCounter_s; 64 70 Ogre::BillboardSet* billboardSet_;
Note: See TracChangeset
for help on using the changeset viewer.