实体

寻路 CPathFind

ThePaths 搜路与路径节点

CPathFind.h · 全局 ThePaths

车 / 人路径节点。搜路参数多,先小范围试。

搜路

DoPathSearch

从起点到终点填节点序列。

void DoPathSearch(unsigned char pathType, CVector origin, CNodeAddress originAddr,
    CVector target, CNodeAddress* pResultNodes, short* pNodesCount, int maxNodesToFind, float* pDistance,
    float maxSearchDistance, CNodeAddress* targetAddr, float maxUnkLimit, bool oneSideOnly,
    CNodeAddress forbiddenNodeAddr, bool includeNodesWithoutLinks, bool waterPath);

取节点

GetPathNode

CNodeAddressCPathNode*

CPathNode* GetPathNode(CNodeAddress address);

流式路径

SetPathsNeededAtPosition / UpdateStreaming

按位置拉路径区。

void SetPathsNeededAtPosition(const CVector& pos);
void UpdateStreaming(bool bForceStreaming);

水域节点

IsWaterNodeNearby
bool IsWaterNodeNearby(CVector position, float radius);

禁区字段

m_aForbiddenAreas / m_bForbiddenForScriptedCarsEnabled

脚本车绕行相关。

unsigned int m_dwNumForbiddenAreas;
CForbiddenArea m_aForbiddenAreas[64];
bool m_bForbiddenForScriptedCarsEnabled;
float m_fForbiddenForScrCarsX1; // X2 Y1 Y2

与交通

随机车挂节点见 CCarCtrl。本对象只持图数据与搜路。

On this page