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


C++ Any::isEmpty方法代码示例

本文整理汇总了C++中Any::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ Any::isEmpty方法的具体用法?C++ Any::isEmpty怎么用?C++ Any::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Any的用法示例。


在下文中一共展示了Any::isEmpty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: init

void BatchPage::init(PagedGeometry *_geom, const Any &data)
{
	geom = _geom;
	int datacast = data.isEmpty() ? 0 : Ogre::any_cast<int>(data);
#ifdef _DEBUG
	if ( datacast < 0)
		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,"Data of BatchPage must be a positive integer. It representing the LOD level this detail level stores.","BatchPage::BatchPage");
#endif
	mLODLevel = datacast; 

	sceneMgr = geom->getSceneManager();
	batch = new BatchedGeometry(sceneMgr, geom->getSceneNode());

	fadeEnabled = false;

	if(!geom->getShadersEnabled())
	{
		// shaders disabled by config
		shadersSupported = false;
	} else
	{
		// determine if shaders available
		const RenderSystemCapabilities *caps = Root::getSingleton().getRenderSystem()->getCapabilities();
		if (caps->hasCapability(RSC_VERTEX_PROGRAM))
			shadersSupported = true;
		else
			shadersSupported = false;
	}

	++refCount;
}
开发者ID:Antaresgames,项目名称:kbengine_ogre_demo,代码行数:31,代码来源:BatchPage.cpp

示例2: init

//-----------------------------------------------------------------------------
///
void BatchPage::init(PagedGeometry *geom_, const Any &data)
{
   assert(geom_ && "Can any code set null pointer?");

   int datacast = !data.isEmpty() ? Ogre::any_cast<int>(data) : 0;
#ifdef _DEBUG
	if (datacast < 0)
		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,"Data of BatchPage must be a positive integer. It representing the LOD level this detail level stores.","BatchPage::BatchPage");
#endif

   m_pPagedGeom   = geom_;
	m_pSceneMgr    = m_pPagedGeom->getSceneManager();
   m_pBatchGeom   = new BatchedGeometry(m_pSceneMgr, m_pPagedGeom->getSceneNode());
   m_nLODLevel    = datacast;
	m_bFadeEnabled = false;

	if (!m_pPagedGeom->getShadersEnabled())
		m_bShadersSupported = false;     // shaders disabled by config
   else
	{
		// determine if shaders available
		const RenderSystemCapabilities *caps = Root::getSingleton().getRenderSystem()->getCapabilities();
      // For example, GeForce4MX has vertex shadres 1.1 and no pixel shaders
      m_bShadersSupported = caps->hasCapability(RSC_VERTEX_PROGRAM) ? true : false;
	}

	++s_nRefCount;
}
开发者ID:drwbns,项目名称:ogre-paged-latest,代码行数:30,代码来源:BatchPage.cpp

示例3: getMtl

	//------------------------------------------------------------------------
	MtlPtr MaterialUtil::getMtl(const MaterialPtr& _material, MatGenParams& _rMatGenParams)
	{
		if(!_material->getNumTechniques())
			return MtlPtr();
		
		Technique* technique = _material->getTechnique(0);
		UserObjectBindings& uob = technique->getUserObjectBindings();
		Any mtlAny = uob.getUserAny( USER_MTL );
		Any matGenParamsAny = uob.getUserAny( USER_MAT_GEN_PARAMS );
		
		if(mtlAny.isEmpty() || matGenParamsAny.isEmpty())
			return MtlPtr();

		MtlPtr mtl = *any_cast<MtlPtr>(&mtlAny);
		_rMatGenParams = *any_cast<MatGenParams>(&matGenParamsAny);
		return mtl;	
	}
开发者ID:raduetsya,项目名称:GothOgre,代码行数:18,代码来源:___GothOgre_MaterialUtil.cpp

示例4: getMatGenParams

	//------------------------------------------------------------------------
	MatGenParams MaterialUtil::getMatGenParams(const MaterialPtr& _material)
	{
		if(!_material->getNumTechniques())
			return MatGenParams();
		
		Technique* technique = _material->getTechnique(0);
		UserObjectBindings& uob = technique->getUserObjectBindings();
		Any matGenParamsAny = uob.getUserAny( USER_MAT_GEN_PARAMS );
		
		if(matGenParamsAny.isEmpty())
			return MatGenParams();

		return *any_cast<MatGenParams>(&matGenParamsAny);
	}
开发者ID:raduetsya,项目名称:GothOgre,代码行数:15,代码来源:___GothOgre_MaterialUtil.cpp

示例5: init

//-----------------------------------------------------------------------------
///
void WindBatchPage::init(PagedGeometry *geom, const Any &data)
{
   int datacast = !data.isEmpty() ? Ogre::any_cast<int>(data) : 0;
#ifdef _DEBUG
	if (datacast < 0)
   {
		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
         "Data of WindBatchPage must be a positive integer. It representing the LOD level this detail level stores.",
         "WindBatchPage::WindBatchPage");
   }
#endif

   m_pBatchGeom   = new WindBatchedGeometry(geom->getSceneManager(), geom->getSceneNode(), geom);
	m_nLODLevel    = datacast; 
	m_pPagedGeom   = geom;
	m_bFadeEnabled = false;

	const RenderSystemCapabilities *caps = Root::getSingleton().getRenderSystem()->getCapabilities();
   m_bShadersSupported = caps->hasCapability(RSC_VERTEX_PROGRAM) ? true : false;    // <-- DELETE THIS

   ++s_nRefCount;
}
开发者ID:Kinthes,项目名称:Bullet_Terrain_Paging_test,代码行数:24,代码来源:WindBatchPage.cpp

示例6: init

void WindBatchPage::init(PagedGeometry *geom, const Any &data)
{
	int datacast = data.isEmpty() ? 0 : Ogre::any_cast<int>(data);
#ifdef _DEBUG
	if ( datacast < 0)
		OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,"Data of WindBatchPage must be a positive integer. It representing the LOD level this detail level stores.","WindBatchPage::WindBatchPage");
#endif
	mLODLevel = datacast; 

	mGeom = geom;
	sceneMgr = geom->getSceneManager();
	batch = new WindBatchedGeometry(sceneMgr, geom->getSceneNode());
	dynamic_cast<WindBatchedGeometry*>(batch)->setGeom(geom);
	fadeEnabled = false;

	const RenderSystemCapabilities *caps = Root::getSingleton().getRenderSystem()->getCapabilities();
	if (caps->hasCapability(RSC_VERTEX_PROGRAM))
		shadersSupported = true;
	else
		shadersSupported = false;

	++refCount;
}
开发者ID:Arsakes,项目名称:ember,代码行数:23,代码来源:WindBatchPage.cpp


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