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


C++ Frame::GetTranslation方法代码示例

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


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

示例1: LoadScene


//.........这里部分代码省略.........

		// Ensure the new material is valid.
		if( m_mesh->GetStaticMesh()->materials[m] == NULL )
			continue;

		// Iterate through the already existing render caches.
		m_renderCaches->Iterate( true );
		while( m_renderCaches->Iterate() )
		{
			// Check if the new material already exists.
			if( m_renderCaches->GetCurrent()->GetMaterial() == m_mesh->GetStaticMesh()->materials[m] )
			{
				found = true;
				break;
			}
		}

		// Add the material if it wasn't found and not set to ignore faces.
		if( found == false && m_mesh->GetStaticMesh()->materials[m]->GetIgnoreFace() == false )
			m_renderCaches->Add( new RenderCache( g_engine->GetDevice(), m_mesh->GetStaticMesh()->materials[m] ) );
	}

	// Get a pointer to the mesh's frame list.
	LinkedList< Frame > *frames = m_mesh->GetFrameList();

	// Iterate through the frame list.
	frames->Iterate( true );
	while( frames->Iterate() != NULL )
	{
		// Check if this frame contains an occluder.
		if( strncmp( "oc_", frames->GetCurrent()->Name, 3 ) == 0 )
		{
			// If so, load the occluder, and continue to the next frame.
			m_occludingObjects->Add( new SceneOccluder( frames->GetCurrent()->GetTranslation(), ( (MeshContainer*)frames->GetCurrent()->pMeshContainer )->originalMesh, &frames->GetCurrent()->finalTransformationMatrix ) );
			continue;
		}

		// Check if this frame is a spawn point.
		if( strncmp( "sp_", frames->GetCurrent()->Name, 3 ) == 0 )
		{
			// Get the actual name of the spawner object at this spawn point.
			char *firstDash = strpbrk( frames->GetCurrent()->Name, "_" );
			firstDash++;
			char *lastDash = strrchr( firstDash, '_' );
			unsigned long length = lastDash - firstDash;
			char *name = new char[length + 5];
			ZeroMemory( name, sizeof( char ) * ( length + 5 ) );
			strncpy( name, firstDash, length );
			strcat( name, ".txt" );

			// Check if it is a player spawn point.
			if( stricmp( name, "player.txt" ) == 0 )
			{
				// Get the name of the player spawn point's radius frame.
				char *radiusName = new char[strlen( firstDash ) + 8];
				ZeroMemory( radiusName, sizeof( char ) * ( strlen( firstDash ) + 8 ) );
				strncpy( radiusName, firstDash, strlen( firstDash ) );
				strcat( radiusName, "_radius" );

				// Find the player spawn point's radius frame.
				Frame *radiusFrame = frames->GetFirst();
				while( radiusFrame != NULL )
				{
					if( stricmp( radiusFrame->Name, radiusName ) == 0 )
						break;
开发者ID:ericrrichards,项目名称:fps,代码行数:66,代码来源:SceneManager.cpp


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