本文整理汇总了C++中ogre::SceneManager::createBillboardChain方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneManager::createBillboardChain方法的具体用法?C++ SceneManager::createBillboardChain怎么用?C++ SceneManager::createBillboardChain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SceneManager
的用法示例。
在下文中一共展示了SceneManager::createBillboardChain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _prepare
//-----------------------------------------------------------------------
void BeamRenderer::_prepare(ParticleTechnique* technique)
{
if (!technique || mRendererInitialised)
return;
// Register itself to the technique
if (mParentTechnique)
{
// Although it is safe to assume that technique == mParentTechnique, use the mParentTechnique, because the mParentTechnique is
// also used for unregistering.
mParentTechnique->addTechniqueListener(this);
}
mQuota = technique->getVisualParticleQuota();
Ogre::SceneNode* parentNode = technique->getParentSystem()->getParentSceneNode();
if (parentNode)
{
// Create BillboardChain
Ogre::SceneManager* sceneManager = mParentTechnique->getParentSystem()->getSceneManager();
std::stringstream ss;
ss << this;
mBillboardChainName = "Beam" + ss.str();
mBillboardChain = sceneManager->createBillboardChain(mBillboardChainName);
mBillboardChain->setDynamic(true);
mBillboardChain->setNumberOfChains(mQuota);
mBillboardChain->setMaxChainElements(mMaxChainElements);
mBillboardChain->setMaterialName(technique->getMaterialName());
mBillboardChain->setRenderQueueGroup(mQueueId);
mBillboardChain->setTextureCoordDirection(mTexCoordDirection);
setUseVertexColours(mUseVertexColours);
mBillboardChain->setOtherTextureCoordRange(0.0f, 1.0f);
mBillboardChain->setVisible(true);
// Create number of VisualData objects
for (size_t i = 0; i < mQuota; i++)
{
for (size_t j = 0; j < mMaxChainElements; j++)
{
Ogre::BillboardChain::Element element;
element = Ogre::BillboardChain::Element(Vector3::ZERO, _mRendererScale.x * mParentTechnique->getDefaultWidth(), 0.0f, ColourValue::White, Ogre::Quaternion::IDENTITY); // V1.51
mBillboardChain->addChainElement(i, element);
}
BeamRendererVisualData* visualData = PU_NEW_T(BeamRendererVisualData, MEMCATEGORY_SCENE_OBJECTS)(i, mBillboardChain);
for (size_t numDev = 0; numDev < mNumberOfSegments; ++numDev)
{
// Initialise the positions
visualData->half[numDev] = Vector3::ZERO;
visualData->destinationHalf[numDev] = Vector3::ZERO;
}
mAllVisualData.push_back(visualData); // Managed by this renderer
mVisualData.push_back(visualData); // Used to assign to a particle
}
mRendererInitialised = true;
parentNode->attachObject(mBillboardChain);
}
}
示例2:
ProjectileManager::ProjectileManager()
:bbc(0)
{
Ogre::SceneManager* scenemgr = Interspace::getSingletonPtr()->getSceneManager();
scenemgr->getRootSceneNode()->createChild("Projectiles");
bbc = scenemgr->createBillboardChain("lasers");
scenemgr->getSceneNode("Projectiles")->attachObject(bbc);
bbc->setMaxChainElements(2);
bbc->setNumberOfChains(1000);
bbc->setMaterialName("laser");
}