本文整理汇总了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);
}
}