32 #include <OgreSceneManager.h>
33 #include <OgreSceneNode.h>
35 #include <OgreQuaternion.h>
36 #include <OgreBillboardChain.h>
37 #include <OgreMaterialManager.h>
38 #include <OgreTechnique.h>
44 #define MAX_ELEMENTS (65536 / 4)
54 , max_points_per_line_(100)
57 , elements_in_current_chain_(0)
68 ss <<
"BillboardLineMaterial" << count++;
69 material_ = Ogre::MaterialManager::getSingleton().create(
70 ss.str(), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
72 material_->getTechnique(0)->setLightingEnabled(
false);
79 V_Chain::iterator it =
chains_.begin();
80 V_Chain::iterator end =
chains_.end();
81 for (; it != end; ++it)
88 Ogre::MaterialManager::getSingleton().remove(
material_->getName());
95 ss <<
"BillboardLine chain" << count++;
96 Ogre::BillboardChain* chain =
scene_manager_->createBillboardChain(ss.str());
107 V_Chain::iterator it =
chains_.begin();
108 V_Chain::iterator end =
chains_.end();
109 for (; it != end; ++it)
111 (*it)->clearAllChains();
134 for (uint32_t i =
chains_.size(); i < num_chains; ++i)
141 V_Chain::iterator it =
chains_.begin();
142 V_Chain::iterator end =
chains_.end();
143 for (; it != end; ++it)
159 (*it)->setNumberOfChains(lines_left);
230 Ogre::BillboardChain::Element e;
241 for (uint32_t line = 0; line <
num_lines_; ++line)
245 for (uint32_t i = 0; i < element_count; ++i)
248 Ogre::BillboardChain::Element e = c->getChainElement(line %
lines_per_chain_, i);
275 material_->getTechnique(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
276 material_->getTechnique(0)->setDepthWriteEnabled(
false);
280 material_->getTechnique(0)->setSceneBlending(Ogre::SBT_REPLACE);
281 material_->getTechnique(0)->setDepthWriteEnabled(
true);
284 color_ = Ogre::ColourValue(r, g, b, a);
286 for (uint32_t line = 0; line <
num_lines_; ++line)
290 for (uint32_t i = 0; i < element_count; ++i)
293 Ogre::BillboardChain::Element e = c->getChainElement(line %
lines_per_chain_, i);