本文整理汇总了C++中ogre::SceneManager::createRibbonTrail方法的典型用法代码示例。如果您正苦于以下问题:C++ SceneManager::createRibbonTrail方法的具体用法?C++ SceneManager::createRibbonTrail怎么用?C++ SceneManager::createRibbonTrail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::SceneManager
的用法示例。
在下文中一共展示了SceneManager::createRibbonTrail方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _prepare
//-----------------------------------------------------------------------
void RibbonTrailRenderer::_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();
if (!mChildNode)
{
// Create a childnode if not created earlier
std::stringstream ss;
ss << this;
String childNodeNodeName = "ParticleUniverse" + ss.str();
mChildNode = mParentTechnique->getParentSystem()->getParentSceneNode()->createChildSceneNode(childNodeNodeName);
mChildNode->setInheritOrientation(false);
}
if (mChildNode)
{
// Create RibbonTrail
Ogre::SceneManager* sceneManager = mParentTechnique->getParentSystem()->getSceneManager();
mTrail = sceneManager->createRibbonTrail(mRibbonTrailName);
mTrail->setNumberOfChains(mQuota);
mTrail->setMaxChainElements(mMaxChainElements);
mTrail->setMaterialName(technique->getMaterialName());
mTrail->setRenderQueueGroup(mQueueId);
if (mSetLength)
{
mTrail->setTrailLength(_mRendererScale.y * mTrailLength);
}
else
{
mTrail->setTrailLength(_mRendererScale.y * technique->getDefaultHeight());
}
mTrail->setUseVertexColours(mUseVertexColours);
// Create number of VisualData objects
String sceneNodeName;
std::stringstream ss;
ss << this;
for (size_t i = 0; i < mQuota; i++)
{
sceneNodeName = "ParticleUniverse" + ss.str() + StringConverter::toString(i);
RibbonTrailRendererVisualData* visualData =
PU_NEW_T(RibbonTrailRendererVisualData, MEMCATEGORY_SCENE_OBJECTS)(mChildNode->createChildSceneNode(sceneNodeName), mTrail);
visualData->node->setInheritOrientation(false);
visualData->index = i;
mAllVisualData.push_back(visualData); // Managed by this renderer
mVisualData.push_back(visualData); // Used to assign to a particle
if (mRandomInitialColour)
{
mTrail->setInitialColour(i, Math::UnitRandom(), Math::UnitRandom(), Math::UnitRandom());
}
else
{
mTrail->setInitialColour(i, mInitialColour);
}
mTrail->setColourChange(i, mColourChange);
if (mSetWidth)
{
mTrail->setInitialWidth(i, _mRendererScale.x * mTrailWidth);
}
else
{
mTrail->setInitialWidth(i, _mRendererScale.x * mParentTechnique->getDefaultWidth());
}
}
mChildNode->attachObject(mTrail);
mRendererInitialised = true;
}
}