本文整理汇总了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