本文整理汇总了C++中CNavArea::GetZ方法的典型用法代码示例。如果您正苦于以下问题:C++ CNavArea::GetZ方法的具体用法?C++ CNavArea::GetZ怎么用?C++ CNavArea::GetZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNavArea
的用法示例。
在下文中一共展示了CNavArea::GetZ方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildTrivialPath
/**
* Build trivial path when start and goal are in the same nav area
*/
bool CNavPath::BuildTrivialPath( const Vector *start, const Vector *goal )
{
m_segmentCount = 0;
CNavArea *startArea = TheNavAreaGrid.GetNearestNavArea( start );
if (startArea == NULL)
return false;
CNavArea *goalArea = TheNavAreaGrid.GetNearestNavArea( goal );
if (goalArea == NULL)
return false;
m_segmentCount = 2;
m_path[0].area = startArea;
m_path[0].pos.x = start->x;
m_path[0].pos.y = start->y;
m_path[0].pos.z = startArea->GetZ( start );
m_path[0].ladder = NULL;
m_path[0].how = NUM_TRAVERSE_TYPES;
m_path[1].area = goalArea;
m_path[1].pos.x = goal->x;
m_path[1].pos.y = goal->y;
m_path[1].pos.z = goalArea->GetZ( goal );
m_path[1].ladder = NULL;
m_path[1].how = NUM_TRAVERSE_TYPES;
return true;
}
示例2: NavMeshGetPositionNearestNavArea
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
Vector NavMeshGetPositionNearestNavArea( const Vector &pos, float beneathlimit, bool bCheckBlocked )
{
CNavArea *pArea;
//pArea = TheNavMesh->GetNearestNavArea(pos, false, 64.0f);
pArea = TheNavMesh->GetNavArea(pos, beneathlimit, bCheckBlocked);
if( pArea ) {
Vector vAreaPos(pos);
vAreaPos.z = pArea->GetZ(pos);
return vAreaPos;
}
return vec3_origin;
}