21
24
Generate a path from startPos to the target defined by either peDef or (goalPos, goalRadius).
22
25
If no complete path from startPos to the path target could be found, then a path getting as
23
26
"close" as possible to target is generated.
41
44
Use goalRadius to define a goal area within any square could be accepted as path target.
42
45
If a singular goal position is wanted, then use goalRadius = 0.
44
unsigned int RequestPath(const MoveData* moveData, float3 startPos,
45
float3 goalPos, float goalRadius = 8, CSolidObject* caller = 0);
47
unsigned int RequestPath(const MoveData* moveData, float3 startPos,
48
CPathFinderDef* peDef,float3 goalPos, CSolidObject* caller);
47
unsigned int RequestPath(
48
const MoveData* moveData,
49
float3 startPos, float3 goalPos, float goalRadius = 8,
50
CSolidObject* caller = 0,
54
unsigned int RequestPath(
55
const MoveData* moveData,
57
CPathFinderDef* peDef,
52
65
Gives the next waypoint of the path.
53
Gives (-1,-1,-1) in case no new waypoint could be found.
66
Returns (-1,-1,-1) in case no new waypoint could be found.
56
69
The path-id returned by RequestPath.
59
72
The current position of the user of the path.
60
This extra information is needed to keep the path connected to it's user.
73
This extra information is needed to keep the path connected to its user.
63
76
Could be used to set a minimum required distance between callerPos and
69
82
float3 NextWaypoint(unsigned int pathId, float3 callerPos, float minDistance = 0,
70
int numRetries=0, int ownerId = 0) const;
83
int numRetries=0, int ownerId = 0, bool synced = true) const;
130
143
void TerrainChange(float3 upperCorner, float3 lowerCorner);
131
144
void TerrainChange(unsigned int x1, unsigned int z1, unsigned int x2, unsigned int z2);
135
Shall be called every 1/30sec during runtime.
141
Visualize all paths currently keept in the database.
146
boost::uint32_t GetPathChecksum();
147
void UpdatePath(const CSolidObject*, unsigned int);
151
boost::uint32_t GetPathCheckSum();
148
153
/** Enable/disable heat mapping */
149
154
void SetHeatMappingEnabled(bool enabled);
150
155
bool GetHeatMappingEnabled();
152
157
void SetHeatOnSquare(int x, int y, int value, int ownerId);
153
void SetHeatOnPos(float3, int value, int ownerId);
158
const int GetHeatOnSquare(int x, int y);
155
160
//Minimum distance between two waypoints.
156
161
static const unsigned int PATH_RESOLUTION;
160
165
MultiPath(const float3 start, const CPathFinderDef* peDef, const MoveData* moveData);
164
169
IPath::Path estimatedPath2;
165
170
IPath::Path estimatedPath;
166
171
IPath::Path detailedPath;
172
IPath::SearchResult searchResult;
168
174
//Request definition
169
175
const float3 start;
170
176
const CPathFinderDef* peDef;
171
177
const MoveData* moveData;
173
//Additional information.
179
// Additional information.
174
180
float3 finalGoal;
175
181
CSolidObject* caller;
179
185
unsigned int Store(MultiPath* path);
180
void Estimate2ToEstimate(MultiPath& path, float3 startPos, int ownerId) const;
186
void Estimate2ToEstimate(MultiPath& path, float3 startPos, int ownerId, bool synced) const;
181
187
void EstimateToDetailed(MultiPath& path, float3 startPos, int ownerId) const;