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


C++ CAnimation::GetName方法代码示例

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


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

示例1: Load


//.........这里部分代码省略.........
	/*}*/
	
	// Load all the effect libraries
	//for ( CUInt i = 0; i < dom->getLibrary_effects_array().getCount(); i++)
	//{
	//	ReadEffectLibrary( dom->getLibrary_effects_array()[i] );			
	//}

	//// Load all the material libraries
	//for ( CUInt i = 0; i < dom->getLibrary_materials_array().getCount(); i++)
	//{
 //		ReadMaterialLibrary( dom->getLibrary_materials_array()[i] );			
	//}

	// Load all the animation libraries
	for ( CUInt i = 0; i < dom->getLibrary_animations_array().getCount(); i++)
	{
		ReadAnimationLibrary( dom->getLibrary_animations_array()[i] );		
		m_hasAnimation = CTrue;
	}
	//Load all animation clips
	for ( CUInt i = 0; i < dom->getLibrary_animation_clips_array().getCount(); i++)
	{
		ReadAnimationClipLibrary( dom->getLibrary_animation_clips_array()[i] );			
	}

	//If there's no clip in COLLADA file, try to create a default clip
	if( m_numClips == 0 && dom->getLibrary_animations_array().getCount() > 0 )
	{
		//Create a default clip and attach all the animations to this clip
		PrintInfo( "\nAdding default animation clip..." );
		CAnimationClip * newAnimClip = CNew(CAnimationClip); 
		//CAssert("No memory\n", newAnimClip!=NULL);
		newAnimClip->SetName( "defaultClip" );
		newAnimClip->SetIndex(0);
		newAnimClip->SetStart(0.0);
		CFloat endTime = 0.0;
		for(CUInt i=0; i<m_animations.size(); i++)
		{
			CAnimation * anim = m_animations[i];

			PrintInfo( "\nAttaching animation ' ", COLOR_WHITE );PrintInfo( anim->GetName(), COLOR_RED_GREEN );
			PrintInfo( " ' to the default animation clip", COLOR_WHITE  );
			
			anim->SetClipTarget( newAnimClip );
			newAnimClip->m_animations.push_back( anim );
			if( anim->GetEndTime() > endTime )
				endTime = anim->GetEndTime();
		}
		newAnimClip->SetEnd((CDouble)endTime);
		m_numClips = 1;
		m_animationClips.push_back( newAnimClip );
	}

	// Find the scene we want
	daeElement* defaultScene = dom->getScene()->getInstance_visual_scene()->getUrl().getElement();
	domAsset::domUp_axis *up = dom->getAsset()->getUp_axis();

	switch( up->getValue() )
	{
		case UPAXISTYPE_X_UP:
			upAxis = eCXUp;
			break; 
		case UPAXISTYPE_Y_UP:
			upAxis = eCYUp;
			break;
		case UPAXISTYPE_Z_UP:
			upAxis = eCZUp;
			break; 
		default:
			break; 
	}

	if(defaultScene)
		ReadScene( (domVisual_scene *)defaultScene, upAxis );
	
	if (m_collada)
	{
		delete m_collada;
		m_collada = 0;
	}
	if( reportWarningsAndErrors )
	{
		char tempReport[MAX_NAME_SIZE];
		COLORREF color;
		if( numErrors > 0 )
			color = COLOR_RED;
		else if (numWarnings > 0 )
			color = COLOR_YELLOW;
		else
			color = COLOR_GREEN;
		sprintf( tempReport, "\n%s - %i error (s), %i warning (s)", nameOnly, numErrors, numWarnings );

		PrintInfo( tempReport, color );

		totalErrors += numErrors;
		totalWarnings += numWarnings;
	}
	return CTrue;
}
开发者ID:DCubix,项目名称:1.4.0,代码行数:101,代码来源:Scene.cpp


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