本文整理汇总了C++中CNavigator::AddFailedNode方法的典型用法代码示例。如果您正苦于以下问题:C++ CNavigator::AddFailedNode方法的具体用法?C++ CNavigator::AddFailedNode怎么用?C++ CNavigator::AddFailedNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNavigator
的用法示例。
在下文中一共展示了CNavigator::AddFailedNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
}
if ( foundClearPath )
{//clear!
//If we got set to blocked, clear it
NPC_ClearBlocked( self );
//Take the dir
memcpy( &info, &tempInfo, sizeof( info ) );
if ( self->s.weapon == WP_SABER )
{//jedi
if ( info.direction[2] * info.distance > 64 )
{
self->NPC->aiFlags |= NPCAI_BLOCKED;
VectorCopy( origin, NPCInfo->blockedDest );
goto failed;
}
}
}
else
{//blocked by ent!
if ( setBlockedInfo )
{
self->NPC->aiFlags |= NPCAI_BLOCKED;
navigator.GetNodePosition( bestNode, NPCInfo->blockedDest );
}
//Only set blocked info first time
setBlockedInfo = qfalse;
if ( inGoalWP )
{//we headed for our goal and failed and our goal's WP and failed
if ( self->waypoint == self->NPC->goalEntity->waypoint )
{//our waypoint is our goal's waypoint, nothing we can do
//remember that this node is blocked
navigator.AddFailedNode( self, self->waypoint );
goto failed;
}
else
{//try going for our waypoint this time
//goalWPFailed = qtrue;
inGoalWP = qfalse;
}
}
else if ( bestNode != self->waypoint )
{//we headed toward our next waypoint (instead of our waypoint) and failed
if ( d_altRoutes->integer )
{//mark this edge failed and try our waypoint
//NOTE: don't assume there is something blocking the direct path
// between my waypoint and the bestNode... I could be off
// that path because of collision avoidance...
if ( d_patched->integer &&//use patch-style navigation
( !navigator.NodesAreNeighbors( self->waypoint, bestNode )
|| NAVNEW_TestNodeConnectionBlocked( self->waypoint, bestNode, self, self->NPC->goalEntity->s.number, qfalse, qtrue ) ) )
{//the direct path between these 2 nodes is blocked by an ent
navigator.AddFailedEdge( self->s.number, self->waypoint, bestNode );
}
bestNode = self->waypoint;
}
else
{
//we should stop
goto failed;
}
}
else
{//we headed for *our* waypoint and couldn't get to it
if ( d_altRoutes->integer )