本文整理汇总了C++中CFrame::SetMeshCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CFrame::SetMeshCount方法的具体用法?C++ CFrame::SetMeshCount怎么用?C++ CFrame::SetMeshCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFrame
的用法示例。
在下文中一共展示了CFrame::SetMeshCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
bool CGmObjAnim3::ReadXML( TiXmlNode* poParent, unsigned int uiCounter )
{
if( !poParent )
return false;
static char acTxt_[256];
if( uiCounter == 0 )
{
}
switch ( poParent->Type() )
{
case TiXmlNode::DOCUMENT:
LOG( "XML: Document" );
break;
case TiXmlNode::ELEMENT:
{
const char *pcName = poParent->Value();
//LOG( "name: %s\n", pcName );
if( !strcmp( pcName, "animation" ) )
{
LOG( "animation:\n" );
TiXmlElement * poElement = poParent->ToElement();
if( poElement )
{
int iIdx;
CStr oMeshFileName;
CArray<CStr> oArrAnimFileName;
TiXmlAttribute* poAttrib = poElement->FirstAttribute();
while( poAttrib )
{
const char *pcName = poAttrib->Name();
if( !strcmp( pcName, "mesh" ) )
{
STRING_COPY( acTxt_, sizeof(acTxt_), poAttrib->Value() );
LOG( "%s: %s\n", poAttrib->Name(), acTxt_ );
oMeshFileName = acTxt_;
}
else if( SSCANF( pcName, "anim_%d", &iIdx ) == 1 )
{
LOG( "%s: %d\n", poAttrib->Name(), iIdx );
STRING_COPY( acTxt_, sizeof(acTxt_), poAttrib->Value() );
LOG( "%s: %s\n", poAttrib->Name(), acTxt_ );
if( iIdx >= int( oArrAnimFileName.GetSize() ) )
oArrAnimFileName.Resize( iIdx + 1 );
oArrAnimFileName[iIdx] = acTxt_;
}
poAttrib = poAttrib->Next();
}
if( oMeshFileName.GetSize() )
{
// Model.
m_poModel = m_poResMan_->NewModelMD5( oMeshFileName, oArrAnimFileName, false );
const unsigned int uiFrameCountTotal = m_poModel->GetFrameCountTotal();
const unsigned int uiMeshCount = m_poModel->GetMeshCount();
const unsigned int uiAnimCount = m_poModel->GetAnimCount();
m_oArrAnim.Resize( uiAnimCount );
m_oArrAnim.Fill( 0 );
m_poData->SetFrameCount( uiFrameCountTotal );
unsigned int uiFrameIdx = 0;
for( unsigned int uiAnim=0; uiAnim<uiAnimCount; ++uiAnim )
{
//m_poModel->SetAnim( uiAnim );
const unsigned int uiFrameCount = m_poModel->GetFrameCount( uiAnim );
CAnim * poAnim = new CAnim;
m_oArrAnim[uiAnim] = poAnim;
poAnim->SetFrameRate( m_poModel->GetFrameRate( uiAnim ) );
poAnim->SetFrameCount( uiFrameCount );
for( unsigned int uiFrame=0; uiFrame<uiFrameCount; ++uiFrame )
{
CFrame * poFrame = new CFrame;
m_poData->SetFrame( uiFrameIdx, poFrame );
poAnim->SetFrameIndex( uiFrame, uiFrameIdx );
++uiFrameIdx;
poFrame->SetMeshCount( uiMeshCount );
for( unsigned int uiMesh=0; uiMesh<uiMeshCount; ++uiMesh )
{
CGMeshMD5 * poMesh = m_poModel->GetPrecalcMesh( uiMesh, uiFrame, uiAnim );
ASSERT( poMesh );
poFrame->SetMesh( uiMesh, poMesh );
}
}
poAnim->Init();
}
ASSERT( uiFrameIdx == uiFrameCountTotal );
}
//.........这里部分代码省略.........