本文整理汇总了C++中CAI_Hint::GetNodeId方法的典型用法代码示例。如果您正苦于以下问题:C++ CAI_Hint::GetNodeId方法的具体用法?C++ CAI_Hint::GetNodeId怎么用?C++ CAI_Hint::GetNodeId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAI_Hint
的用法示例。
在下文中一共展示了CAI_Hint::GetNodeId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DumpHints
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CAI_HintManager::DumpHints()
{
AIHintIter_t iter;
CAI_Hint *pCurHint = GetFirstHint( &iter );
while (pCurHint)
{
const Vector &v = pCurHint->GetAbsOrigin();
Msg( "(%.1f, %.1f, %.1f) -- Node ID: %d; WC id %d; type %d\n",
v.x, v.y, v.z,
pCurHint->GetNodeId(),
pCurHint->GetWCId(),
pCurHint->HintType() );
pCurHint = GetNextHint( &iter );
}
}
示例2: DrawHintOverlays
//------------------------------------------------------------------------------
// Purpose :
// Input :
// Output :
//------------------------------------------------------------------------------
void CAI_HintManager::DrawHintOverlays(float flDrawDuration)
{
int c = gm_AllHints.Count();
for ( int i = 0; i < c; ++i )
{
CAI_Hint *pHint = gm_AllHints[ i ];
int r = 0;
int g = 0;
int b = 255;
Vector vHintPos;
if (pHint->m_NodeData.nNodeID != NO_NODE)
{
vHintPos = g_pBigAINet->GetNode(pHint->m_NodeData.nNodeID)->GetPosition(g_pAINetworkManager->GetEditOps()->m_iHullDrawNum);
}
else
{
vHintPos = pHint->GetAbsOrigin();
}
if ( pHint->GetNodeId() != NO_NODE )
NDebugOverlay::Text( vHintPos + Vector(0,6,8), CFmtStr("(%d), (%d)", pHint->HintType(), pHint->GetNodeId()), true, flDrawDuration );
else
NDebugOverlay::Text( vHintPos + Vector(0,6,8), CFmtStr("(%d)", pHint->HintType()), true, flDrawDuration );
// If node is currently locked
if (pHint->m_NodeData.iDisabled)
{
r = 100;
g = 100;
b = 100;
}
else if (pHint->m_hHintOwner != NULL)
{
r = 255;
g = 0;
b = 0;
CBaseEntity* pOwner = pHint->User();
if (pOwner)
{
char owner[255];
Q_strncpy(owner,pOwner->GetDebugName(),sizeof(owner));
Vector loc = vHintPos;
loc.x+=6;
loc.y+=6;
loc.z+=6;
NDebugOverlay::Text( loc, owner, true, flDrawDuration );
NDebugOverlay::Line( vHintPos, pOwner->WorldSpaceCenter(), 128, 128, 128, false, 0);
}
}
else if (pHint->IsLocked())
{
r = 200;
g = 150;
b = 10;
}
NDebugOverlay::Box(vHintPos, Vector(-3,-3,-3), Vector(3,3,3), r,g,b,0,flDrawDuration);
// Draw line in facing direction
Vector offsetDir = 12.0 * Vector(cos(DEG2RAD(pHint->Yaw())),sin(DEG2RAD(pHint->Yaw())),0);
NDebugOverlay::Line(vHintPos, vHintPos+offsetDir, r,g,b,false,flDrawDuration);
}
}