本文整理汇总了C++中CCoreDispInfo::SetListIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ CCoreDispInfo::SetListIndex方法的具体用法?C++ CCoreDispInfo::SetListIndex怎么用?C++ CCoreDispInfo::SetListIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCoreDispInfo
的用法示例。
在下文中一共展示了CCoreDispInfo::SetListIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EmitDispLMAlphaAndNeighbors
void EmitDispLMAlphaAndNeighbors()
{
int i;
Msg( "Finding displacement neighbors...\n" );
// Build the CCoreDispInfos.
CUtlVector<dface_t*> faces;
// Create the core dispinfos and init them for use as CDispUtilsHelpers.
for ( int iDisp = 0; iDisp < nummapdispinfo; ++iDisp )
{
CCoreDispInfo *pDisp = new CCoreDispInfo;
if ( !pDisp )
{
g_CoreDispInfos.Purge();
return;
}
int nIndex = g_CoreDispInfos.AddToTail();
pDisp->SetListIndex( nIndex );
g_CoreDispInfos[nIndex] = pDisp;
}
for ( i=0; i < nummapdispinfo; i++ )
{
g_CoreDispInfos[i]->SetDispUtilsHelperInfo( g_CoreDispInfos.Base(), nummapdispinfo );
}
faces.SetSize( nummapdispinfo );
for( i = 0; i < numfaces; i++ )
{
dface_t *pFace = &dfaces[i];
if( pFace->dispinfo == -1 )
continue;
mapdispinfo_t *pMapDisp = &mapdispinfo[pFace->dispinfo];
// Set the displacement's face index.
ddispinfo_t *pDisp = &g_dispinfo[pFace->dispinfo];
pDisp->m_iMapFace = i;
// Get a CCoreDispInfo. All we need is the triangles and lightmap texture coordinates.
CCoreDispInfo *pCoreDispInfo = g_CoreDispInfos[pFace->dispinfo];
DispMapToCoreDispInfo( pMapDisp, pCoreDispInfo, pFace );
faces[pFace->dispinfo] = pFace;
}
// Generate and export neighbor data.
ExportNeighborData( g_CoreDispInfos.Base(), g_dispinfo.Base(), nummapdispinfo );
// Generate and export the active vert lists.
ExportAllowedVertLists( g_CoreDispInfos.Base(), g_dispinfo.Base(), nummapdispinfo );
// Now that we know which vertices are actually going to be around, snap the ones that won't
// be around onto the slightly-reduced mesh. This is so the engine's ray test code and
// overlay code works right.
SnapRemainingVertsToSurface( g_CoreDispInfos.Base(), g_dispinfo.Base(), nummapdispinfo );
Msg( "Finding lightmap sample positions...\n" );
for ( i=0; i < nummapdispinfo; i++ )
{
dface_t *pFace = faces[i];
ddispinfo_t *pDisp = &g_dispinfo[pFace->dispinfo];
CCoreDispInfo *pCoreDispInfo = g_CoreDispInfos[i];
pDisp->m_iLightmapSamplePositionStart = g_DispLightmapSamplePositions.Count();
CalculateLightmapSamplePositions( pCoreDispInfo, pFace, g_DispLightmapSamplePositions );
}
StartPacifier( "Displacement Alpha : ");
// Build lightmap alphas.
int dispCount = 0; // How many we've processed.
for( i = 0; i < nummapdispinfo; i++ )
{
dface_t *pFace = faces[i];
Assert( pFace->dispinfo == i );
mapdispinfo_t *pMapDisp = &mapdispinfo[pFace->dispinfo];
ddispinfo_t *pDisp = &g_dispinfo[pFace->dispinfo];
CCoreDispInfo *pCoreDispInfo = g_CoreDispInfos[i];
// Allocate space for the alpha values.
pDisp->m_iLightmapAlphaStart = 0; // not used anymore
++dispCount;
}
EndPacifier();
}