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


C++ CNode::addEdge方法代码示例

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


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

示例1: ProcessLevelNode


//.........这里部分代码省略.........
						nextAdjacent++;
						continue;
					}
					if ((int)tempName[i] == 'e')
					{
						break;
					}

					int firstNum = (int)tempName[i] - 48;
					int secondNum = (int)tempName[i + 1] - 48;
					int thirdNum = (int)tempName[i + 2] - 48;

					AdjacentIDs[nextAdjacent] = (firstNum * 100) + (secondNum * 10) + thirdNum;
					if (AdjacentIDs[nextAdjacent] >= 147)
					{
						break;
					}
					i += 2;
				}

				//create node
				tempMesh->ConvertVertices();
				XMFLOAT3 tempPos = GetAABBCentroid(tempMesh->GetVertices());
				CNode* tempNode = new CNode(WayPointID, tempPos);

				//create and add edges
				for (unsigned int i = 0; i < 4; i++)
				{
					if (AdjacentIDs[i] == -1)
					{
						continue;
					}

					tempNode->addEdge(new CEdge(1.0f, AdjacentIDs[i]));
				}

				//add node to navgraph
				m_cpMinotaurNavGraph->AddNode(tempNode);

#pragma endregion
			}
			else if (strcmp(prefix.c_str(), "CWL_") == 0)//cracked wall location
			{
				//tempMesh->ConvertVertices();

				//CCrackedWall* tempCrackedWall = new CCrackedWall("CrackedWall");
				//tempCrackedWall->AddCollider(new CCollider(false, Bounds::AABB, tempMesh->GetVertices()));
				//tempCrackedWall->SetRenderMesh(new CRenderMesh(tempMesh->GetIndices(), tempMesh->GetVertices(), GRAPHICS->GetVertexShader(), GRAPHICS->GetPixelShader(), nullptr, nullptr, nullptr));

				//m_cpEnvironmentObjects.push_back(tempCrackedWall);

				//m_cpObjectManager->AddObject(tempCrackedWall, CObjectManager::eObjectType::Static);
			}
			else if (strcmp(prefix.c_str(), "LWC_") == 0)//light weapon upgrade chest location
			{
			}
			else if (strcmp(prefix.c_str(), "HWC_") == 0)//heavy weapon upgrade chest location
			{
			}
			else if (strcmp(prefix.c_str(), "HUC_") == 0)//health upgrade chest location
			{
			}
			else if (strcmp(prefix.c_str(), "Tor_") == 0)//torch location
			{
#pragma region Torches
开发者ID:CMcLaine92,项目名称:The-Exile,代码行数:66,代码来源:LevelLoader.cpp


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