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


C++ Model::GetPiece方法代码示例

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


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

示例1: QueueModelPieces

//queues all the pieces of the model into the global list
void ModelDraw::QueueModelPieces(ModelInstance* pInstance, const ModelHookData& HookData, CDeviceLightList& DeviceLightList)
{
	//get the distance to the model
	float fDistToModel = 0.0f;
	if(!(HookData.m_ObjectFlags & FLAG_REALLYCLOSE))
	{
		fDistToModel = (g_ViewParams.m_Pos - pInstance->GetPos()).Mag();
	}

	//Now handle queueing up all of our pieces
	bool bTexture = g_CV_TextureModels && (HookData.m_HookFlags & MHF_USETEXTURE);

	//cache the model pointer
	Model* pModel = pInstance->GetModelDB();
	
	//run through and queue up each piece
	for (uint32 nCurrPiece = 0; nCurrPiece < pModel->NumPieces(); nCurrPiece++) 
	{
		//just ignore this piece if it is currently hidden
		if (pInstance->IsPieceHidden(nCurrPiece)) 
		{
			continue;
		} 

		//get the piece and current LOD
		ModelPiece* pPiece		= pModel->GetPiece(nCurrPiece);
		CDIModelDrawable* pLOD  = pPiece->GetLODFromDist( g_CV_ModelLODOffset.m_Val, fDistToModel );		

		//if it doesn't have an associated LOD to render, we can't do anything
		if (!pLOD || (pLOD->GetPolyCount() == 0)) 
			continue;

		// setup the nodes we need to render this mesh.
		pInstance->SetupLODNodePath(pLOD);
		
		CRenderModelPieceList::GetSingleton().QueuePiece(pInstance, pPiece, pLOD, pInstance->GetRenderingTransforms(), &DeviceLightList, bTexture, &HookData);
	}
}
开发者ID:Joincheng,项目名称:lithtech,代码行数:39,代码来源:setupmodel.cpp


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