当前位置: 首页>>代码示例>>C++>>正文


C++ SceneManager::createBillboardChain方法代码示例

本文整理汇总了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);
		}
	}
开发者ID:Ketzer2002,项目名称:meridian59-engine,代码行数:58,代码来源:ParticleUniverseBeamRenderer.cpp

示例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");
}
开发者ID:prathyushk,项目名称:Interspace,代码行数:11,代码来源:ProjectileManager.cpp


注:本文中的ogre::SceneManager::createBillboardChain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。