102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference | GitLab repository
Loading...
Searching...
No Matches
geometry.c
Go to the documentation of this file.
1/* Recovered game implementation; original addresses identify provenance. */
10#include "pcdogs/math/types.h"
17#include "pcdogs/scene/types.h"
21#include <math.h>
22#include <stdarg.h>
23#include <string.h>
24
25// Original pcdogs.exe: 0x439320
26// Searches the navigation network for a bone-guidance path and returns the generated point count. It uses the extra goal-sentinel node and clears search state through that sentinel during cleanup.
27int32_t Trail_FindBonePath(struct Math_Vec3I32 *start_pos, struct Nav_Network *nav_network, int32_t skip_dynamic_targets)
28{
29 struct Scene_Node *object_root = g_objectNodeRoot;
30 // Save object node root for restoration after pathfinding
31 struct Mesh_RuntimeVertex *saved_runtime_vertices = object_root->runtime_vertices;
32
33 object_root->runtime_vertices = NULL;
34
35 struct Math_Vec3I32 *path_cursor = &Trail_BonePathNodes[1];
36 struct Nav_GroundProbeActorView ground_probe;
37
39
40 int32_t start_x = start_pos->x;
41
42 ground_probe.behavior_flags = 0;
43 g_boneTrailPathNodes = start_x;
44 ground_probe.ground_collision_node = 0;
45 // Find ground polygon under starting position
46 //
47 // Detect initial ground polygon via collision detection
48 g_boneTrailPathBuffer_Y = start_pos->y;
49 g_boneTrailPathBuffer_Z = start_pos->z;
50 ground_probe.position.x = start_pos->x;
51 ground_probe.position.y = start_pos->y;
52 ground_probe.position.z = start_pos->z;
53 // DetectStaticGeometryCollision finds ground polygon under start position
54 Collision_ResolveActorGroundContact((struct Actor_State *)(&ground_probe));
55
56 struct Collision_Node *ground_collision_node = ground_probe.ground_collision_node;
57
58 ground_probe.position.y += 0x1000;
59
60 char first_ground_polygon = 1;
61
62 if (!ground_collision_node)
63 g_objectNodeRoot->runtime_vertices = saved_runtime_vertices;
64 else
65 {
66 struct Math_Vec3I32 *backup_path_cursor = &Trail_BonePathNodes[2];
67
68 while (true)
69 {
70 struct Collision_Polygon *ground_contact_polygon = ground_probe.ground_contact_polygon;
71 struct Pkg_CollisionFacePlane *face_plane = ground_contact_polygon->face_plane;
72
73 if (!face_plane->navigation_offset_present || (!face_plane->navigation_offset.x && !face_plane->navigation_offset.y && !face_plane->navigation_offset.z))
74 {
75 g_objectNodeRoot->runtime_vertices = saved_runtime_vertices;
76
77 return 0;
78 }
79
80 if (first_ground_polygon)
81 {
82 first_ground_polygon = 0;
83 Nav_CalculatePolygonCenter(ground_collision_node, ground_contact_polygon, path_cursor);
84
85 struct Math_Vec3I32 *copied_center_destination = backup_path_cursor;
86
87 path_cursor->y += 0x1000;
88
89 struct Math_Vec3I32 *polygon_center_point = path_cursor;
90
91 path_cursor = &path_cursor[1];
92 copied_center_destination->x = polygon_center_point->x;
93 backup_path_cursor = &backup_path_cursor[1];
94 copied_center_destination->y = polygon_center_point->y;
95 copied_center_destination->z = polygon_center_point->z;
96
97 int32_t offset_base_y = path_cursor->y;
98
99 path_cursor->x += (int32_t)face_plane->navigation_offset.x << 6;
100
101 int32_t offset_base_z = path_cursor->z;
102
103 path_cursor->y = offset_base_y + ((int32_t)face_plane->navigation_offset.y << 6);
104 path_cursor->z = offset_base_z + ((int32_t)face_plane->navigation_offset.z << 6);
105
106 if (!Physics_CalculateMovementWithCollision(&ground_probe.position, path_cursor, NULL,
107 0x20, 1))
108 {
109 path_cursor -= 1;
110 backup_path_cursor -= 1;
111 path_cursor->x = (uint32_t)backup_path_cursor->x;
112 path_cursor->y = backup_path_cursor->y;
113 path_cursor->z = backup_path_cursor->z;
114 }
115 }
116 else
117 {
118 // Calculate polygon center for navigation waypoint positioning
119 //
120 // Calculate polygon center for navigation waypoint
121 int32_t probe_base_y = ground_probe.position.y;
122
123 path_cursor->x = ((int32_t)face_plane->navigation_offset.x << 6) + ground_probe.position.x;
124 path_cursor->y = ((int32_t)face_plane->navigation_offset.y << 6) + probe_base_y;
125 path_cursor->z = ((int32_t)face_plane->navigation_offset.z << 6) + ground_probe.position.z;
126 }
127
128 struct Math_Vec3I32 *next_probe_point = path_cursor;
129
130 path_cursor = &path_cursor[1];
131 backup_path_cursor = &backup_path_cursor[1];
132 ground_probe.position.x = next_probe_point->x;
133
134 int32_t next_probe_y = next_probe_point->y;
135
136 ground_probe.behavior_flags = 0;
137 ground_probe.ground_collision_node = 0;
138
139 int32_t next_probe_z = next_probe_point->z;
140
141 ground_probe.position.y = next_probe_y;
142 ground_probe.position.z = next_probe_z;
143 Collision_ResolveActorGroundContact((struct Actor_State *)(&ground_probe));
144
145 if (face_plane->navigation_link_id)
146 {
147 struct Math_Vec3I32 *result_path_end = path_cursor;
148 // Create priority queue (red-black tree) for A* open set
149 //
150 // Initialize TreeMap priority queue for A* open set
151 struct Math_Vec3I32 distance_delta = (struct Math_Vec3I32){
152 .x = path_cursor[-1].x - start_pos->x,
153 .z = (uint32_t)path_cursor[-1].z - start_pos->z,
154 .y = 0};
155
156 int64_t start_distance_x_square_wide = (int64_t)distance_delta.x * distance_delta.x;
157 int64_t start_distance_y_square_wide = (int64_t)distance_delta.y * distance_delta.y;
158 int64_t start_distance_z_square_wide = (int64_t)distance_delta.z * distance_delta.z;
159
160 if (((int32_t)(((uint64_t)start_distance_z_square_wide + (uint64_t)start_distance_x_square_wide + (uint64_t)start_distance_y_square_wide) >> 12)) < 0x6400)
161 result_path_end -= 1;
162
163 g_boneTrailPathEnd = result_path_end;
164
165 int32_t navigation_link = 0;
166 // Create TreeMap (red-black tree) as A* open set priority queue
167 struct Tree_Map *active_open_set = Tree_CreateMap(8, (int32_t (*)(void *, void *))(Trail_CompareBoneNodes));
168
169 navigation_link = face_plane->navigation_link_id;
170
171 struct Tree_Map *allocated_open_set = active_open_set;
172 struct Nav_Network *search_network; // Node IDs <= 500 are standard navigation nodes
173
174 if (navigation_link > NAVIGATION_ENTITY_GOAL_FIRST)
175 {
176 int32_t seed_edge_index = (navigation_link - (NAVIGATION_ENTITY_GOAL_FIRST + 1)) & NAVIGATION_LINK_EDGE_MASK;
177 int32_t seed_node_id = (navigation_link - (NAVIGATION_ENTITY_GOAL_FIRST + 1)) >> 5;
178
179 if (!(nav_network->nodes[seed_node_id].neighbor_list[seed_edge_index].packed_id & TRAIL_NAV_EDGE_BLOCKED))
180 {
181 struct Nav_OpenSetEntry *source_open_entry = Tree_AllocateMapNode(allocated_open_set);
182
183 if (source_open_entry)
184 {
185 source_open_entry->node_id = (uint16_t)seed_node_id;
186
187 struct Nav_Node *nodes = nav_network->nodes;
188 struct Math_Vec3I32 *path_end_for_source = g_boneTrailPathEnd;
189
190 distance_delta.x = path_end_for_source[-1].x - nodes[(int32_t)(int16_t)seed_node_id].pos.x;
191 distance_delta.y = path_end_for_source[-1].y - nodes[(int32_t)source_open_entry->node_id].pos.y;
192 distance_delta.z = (uint32_t)path_end_for_source[-1].z - nodes[(int32_t)source_open_entry->node_id].pos.z;
193
194 int64_t source_distance_x_square_wide = (int64_t)distance_delta.x * distance_delta.x;
195 int64_t source_distance_y_square_wide = (int64_t)distance_delta.y * distance_delta.y;
196 int64_t source_distance_z_square_wide = (int64_t)distance_delta.z * distance_delta.z;
197
198 source_open_entry->cost = Math_SqrtFP12((int32_t)(((uint64_t)source_distance_z_square_wide + (uint64_t)source_distance_x_square_wide + (uint64_t)source_distance_y_square_wide) >> 12)) >> 6;
199 Tree_InitializeMapNode(allocated_open_set, source_open_entry);
200 nav_network->nodes[(int32_t)source_open_entry->node_id].pathfind_state =
201 source_open_entry;
202 nav_network->nodes[(int32_t)source_open_entry->node_id].parent_link =
204 source_open_entry->path_depth = 0;
205 }
206 }
207
208 struct Nav_OpenSetEntry *neighbor_open_entry = Tree_AllocateMapNode(allocated_open_set);
209
210 if (neighbor_open_entry)
211 {
212 uint16_t neighbor_node_id =
213 nav_network->nodes[seed_node_id].neighbor_list[seed_edge_index].packed_id >> 5;
214
215 neighbor_open_entry->node_id = neighbor_node_id;
216
217 struct Nav_Node *neighbor_nodes = nav_network->nodes;
218 struct Math_Vec3I32 *path_end_for_neighbor = g_boneTrailPathEnd;
219
220 distance_delta.x = path_end_for_neighbor[-1].x - neighbor_nodes[(int32_t)neighbor_node_id].pos.x;
221 distance_delta.y = path_end_for_neighbor[-1].y - neighbor_nodes[(int32_t)neighbor_open_entry->node_id].pos.y;
222 distance_delta.z = (uint32_t)path_end_for_neighbor[-1].z - neighbor_nodes[(int32_t)neighbor_open_entry->node_id].pos.z;
223
224 int64_t neighbor_distance_x_square_wide = (int64_t)distance_delta.x * distance_delta.x;
225 int64_t neighbor_distance_y_square_wide = (int64_t)distance_delta.y * distance_delta.y;
226 int64_t neighbor_distance_z_square_wide = (int64_t)distance_delta.z * distance_delta.z;
227
228 neighbor_open_entry->cost = Math_SqrtFP12((int32_t)(((uint64_t)neighbor_distance_z_square_wide + (uint64_t)neighbor_distance_x_square_wide + (uint64_t)neighbor_distance_y_square_wide) >> 12)) >> 6;
229 Tree_InitializeMapNode(allocated_open_set, neighbor_open_entry);
230 nav_network->nodes[(int32_t)neighbor_open_entry->node_id].pathfind_state =
231 neighbor_open_entry;
232 nav_network->nodes[(int32_t)neighbor_open_entry->node_id].parent_link =
234 neighbor_open_entry->path_depth = 0;
235 }
236
237 search_network = nav_network;
238 active_open_set = allocated_open_set;
239 }
240 else
241 {
242 struct Nav_OpenSetEntry *seed_open_entry = Tree_AllocateMapNode(active_open_set);
243
244 if (!seed_open_entry)
245 search_network = nav_network;
246 else
247 {
248 seed_open_entry->node_id = (uint16_t)navigation_link - 1;
249 seed_open_entry->cost = 0;
250 Tree_InitializeMapNode(active_open_set, seed_open_entry);
251 search_network = nav_network;
252 search_network->nodes[(int32_t)seed_open_entry->node_id].pathfind_state =
253 seed_open_entry;
254 // Calculate heuristic: distance to goal (FastSquareRoot >> 6)
255 search_network->nodes[(int32_t)seed_open_entry->node_id].parent_link = NAVIGATION_LINK_NO_PARENT;
256 seed_open_entry->path_depth = 0;
257 }
258 }
259
260 struct Nav_OpenSetEntry *popped_open_entry = Tree_GetFirstMapNode(active_open_set);
261
262 if (popped_open_entry) // A* main loop: process lowest cost node from open set
263 {
264 while (true)
265 {
266 int32_t node_id = (int32_t)popped_open_entry->node_id;
267
268 if (node_id == search_network->node_count)
269 {
270 int32_t goal_selector = 0;
271
272 // Goal reached - backtrack via parent links to build path
273 goal_selector = (uint16_t)search_network->nodes[node_id].neighbor_count;
275
276 int16_t path_depth = popped_open_entry->path_depth;
277
278 if (path_depth < 0)
279 {
280 struct Math_Vec3I32 *shortcut_path_end = g_boneTrailPathEnd;
281
282 if ((uintptr_t)shortcut_path_end > (uintptr_t)&g_boneTrailTargetPosition)
283 {
284 shortcut_path_end -= 1;
285 g_boneTrailPathEnd = shortcut_path_end;
286 }
287
288 struct Math_Vec3I32 *goal_position = (struct Math_Vec3I32 *)(search_network->nodes[node_id].neighbor_list);
289
290 shortcut_path_end->x = (uint32_t)goal_position->x;
291 shortcut_path_end->y = goal_position->y;
292 shortcut_path_end->z = goal_position->z;
293 result_path_end = &g_boneTrailPathEnd[1];
294 Tree_FreeMapNode(popped_open_entry);
295
296 break;
297 }
298
299 struct Math_Vec3I32 *goal_point_destination = &g_boneTrailPathEnd[(int32_t)path_depth];
300 struct Math_Vec3I32 *reverse_path_cursor = goal_point_destination - 1;
301 struct Math_Vec3I32 *goal_position = (struct Math_Vec3I32 *)(search_network->nodes[node_id].neighbor_list);
302
303 goal_point_destination->x = (uint32_t)goal_position->x;
304 goal_point_destination->y = goal_position->y;
305 goal_point_destination->z = goal_position->z;
306
307 struct Nav_Node *goal_nodes = search_network->nodes;
308 uint16_t parent_link = goal_nodes[node_id].parent_link;
309
310 goal_nodes[node_id].parent_link = parent_link & TRAIL_NAV_PARENT_NODE_MASK;
311
312 struct Nav_Node *parent_nodes = search_network->nodes;
313 struct Nav_Node *goal_node = &parent_nodes[node_id];
314 int32_t packed_parent_link = goal_node->parent_link;
315 uint32_t parent_node_id = packed_parent_link >> 5;
316 uint8_t parent_neighbor_flags = parent_nodes[parent_node_id].neighbor_list[parent_link & NAVIGATION_LINK_EDGE_MASK].flags_and_node_low;
317
318 if ((parent_neighbor_flags & NAVIGATION_LINK_EDGE_MASK) - 1 >= 0)
319 {
320 struct Math_Vec3I32 *projection_point_destination = reverse_path_cursor;
321
322 reverse_path_cursor -= 1;
323 projection_point_destination->x = goal_node->pos.x;
324 projection_point_destination->y = goal_node->pos.y;
325 projection_point_destination->z = goal_node->pos.z;
326 }
327
328 if ((parent_neighbor_flags & NAVIGATION_LINK_EDGE_MASK) - 1 < 0 || popped_open_entry->path_depth != 1)
329 parent_node_id = node_id;
330
331 struct Nav_Node *backtrack_nodes = search_network->nodes;
332 int32_t backtrack_parent_link = 0;
333 int32_t retained_path_points = (int32_t)popped_open_entry->path_depth + 1;
334
335 backtrack_parent_link = backtrack_nodes[parent_node_id].parent_link;
336
337 int32_t shortcut_path_points = retained_path_points;
338
339 if (backtrack_parent_link != NAVIGATION_LINK_NO_PARENT)
340 {
341 do
342 {
343 struct Nav_Node *parent_node = &backtrack_nodes[backtrack_parent_link >> 5];
344
345 if (parent_node->neighbor_list[backtrack_parent_link & NAVIGATION_LINK_EDGE_MASK].flags_and_node_low & TRAIL_NAV_EDGE_SHORTCUT &&
346 (shortcut_path_points > 2 || face_plane->navigation_link_id > NAVIGATION_ENTITY_GOAL_FIRST))
347 {
348 shortcut_path_points = ((char *)reverse_path_cursor - (char *)g_boneTrailPathEnd) / 12 + 1;
349 }
350
351 struct Math_Vec3I32 *parent_point_destination = reverse_path_cursor;
352
353 reverse_path_cursor -= 1;
354 parent_point_destination->x = (uint32_t)parent_node->pos.x;
355 parent_point_destination->y = parent_node->pos.y;
356 parent_point_destination->z = parent_node->pos.z;
357 backtrack_nodes = search_network->nodes;
358 backtrack_parent_link = backtrack_nodes[backtrack_parent_link >> 5].parent_link;
359 } while (backtrack_parent_link != NAVIGATION_LINK_NO_PARENT);
360
361 retained_path_points = shortcut_path_points;
362 }
363
364 active_open_set = allocated_open_set;
365 result_path_end = &reverse_path_cursor[retained_path_points + 1];
366 Tree_FreeMapNode(popped_open_entry);
367
368 break;
369 }
370
371 search_network->nodes[node_id].pathfind_state = (struct Nav_OpenSetEntry *)(0xffffffff);
372 Nav_ProcessPathNode(active_open_set, search_network, popped_open_entry,
373 skip_dynamic_targets);
374 Tree_FreeMapNode(popped_open_entry);
375
376 struct Nav_OpenSetEntry *goal_open_entry = Tree_GetFirstMapNode(active_open_set);
377
378 if (!goal_open_entry)
379 break;
380
381 popped_open_entry = goal_open_entry;
382 }
383 }
384
385 Tree_DestroyMap(active_open_set);
386
387 int32_t cleared_node_count = 0;
388
389 if (search_network->node_count >= 0)
390 {
391 struct Nav_Node *cleared_node = search_network->nodes;
392
393 do
394 {
395 cleared_node_count += 1;
396 cleared_node->pathfind_state = NULL;
397 ++cleared_node;
398 } while (cleared_node_count <= search_network->node_count);
399 }
400
401 g_objectNodeRoot->runtime_vertices = saved_runtime_vertices;
402
403 if (result_path_end == g_boneTrailPathEnd)
404 break;
405
406 int32_t result = (int32_t)(result_path_end - Trail_BonePathNodes);
407
408 if (result <= 2)
409 return result;
410
411 int32_t first_path_x = g_boneTrailTargetPosition;
412 struct Math_Vec3I32 initial_path_delta;
413
414 initial_path_delta.x = first_path_x - g_boneTrailPathNodes;
415
416 int32_t first_path_y = g_boneTrailAnimTime;
417
418 initial_path_delta.y = first_path_y - g_boneTrailPathBuffer_Y;
419
420 int32_t first_path_z = g_boneTrailPathBuffer_Z1;
421
422 initial_path_delta.z = first_path_z - g_boneTrailPathBuffer_Z;
423
424 struct Math_Vec3I32 second_segment_delta = (struct Math_Vec3I32){
425 .x = g_boneTrailPathBuffer_X2 - first_path_x,
426 .y = g_boneTrailPathBufferY2 - first_path_y,
427 .z = g_boneTrailPathBuffer_Z2 - first_path_z};
428
429 int64_t initial_second_dot_x_wide = (int64_t)initial_path_delta.x * second_segment_delta.x;
430 int64_t initial_second_dot_z_wide = (int64_t)initial_path_delta.z * second_segment_delta.z;
431
432 if (((int32_t)((uint64_t)initial_second_dot_z_wide >> 12)) + ((int32_t)((uint64_t)initial_second_dot_x_wide >> 12)) >= 0)
433 return result;
434
435 second_segment_delta.y = 0;
436
437 int64_t second_segment_x_square_wide = (int64_t)second_segment_delta.x * second_segment_delta.x;
438 int64_t second_segment_y_square_wide = (int64_t)second_segment_delta.y * second_segment_delta.y;
439 int64_t second_segment_z_square_wide = (int64_t)second_segment_delta.z * second_segment_delta.z;
440 int32_t second_segment_length =
441 Math_SqrtFP12((int32_t)(((uint64_t)second_segment_z_square_wide + (uint64_t)second_segment_x_square_wide + (uint64_t)second_segment_y_square_wide) >> 12));
442
443 if (second_segment_length)
444 {
445 int32_t second_segment_inverse_length = INT64_C(4294967296) / second_segment_length;
446 int64_t second_segment_scaled_x_wide = (int64_t)second_segment_inverse_length * second_segment_delta.x;
447
448 second_segment_delta.x = ((int32_t)((uint64_t)second_segment_scaled_x_wide >> 12)) >> 8;
449
450 int64_t second_segment_scaled_y_wide = (int64_t)second_segment_inverse_length * second_segment_delta.y;
451
452 second_segment_delta.y = ((int32_t)((uint64_t)second_segment_scaled_y_wide >> 12)) >> 8;
453
454 int64_t second_segment_scaled_z_wide = (int64_t)second_segment_inverse_length * second_segment_delta.z;
455
456 second_segment_delta.z = ((int32_t)((uint64_t)second_segment_scaled_z_wide >> 12)) >> 8;
457 }
458 else
459 __builtin_memset(&second_segment_delta, 0, 0xc);
460
461 int64_t segment_cross_zx_wide = (int64_t)second_segment_delta.z * initial_path_delta.x;
462 int64_t segment_cross_xz_wide = (int64_t)second_segment_delta.x * initial_path_delta.z;
463
464 if ((uint32_t)(((int32_t)((uint64_t)segment_cross_zx_wide >> 12)) - ((int32_t)((uint64_t)segment_cross_xz_wide >> 12)) + 0x5000) <= 0xa000u)
465 {
466 result -= 1;
467 for (int32_t i = 1; i < result; ++i)
469 }
470
471 return result;
472 }
473
474 ground_collision_node = ground_probe.ground_collision_node;
475
476 if (ground_collision_node)
477 continue;
478
479 g_objectNodeRoot->runtime_vertices = saved_runtime_vertices;
480
481 return 0;
482 }
483 }
484
485 return 0;
486}
487
488// Original pcdogs.exe: 0x43a680
489// Compares bone-path cost keys by unsigned 32-bit subtraction, retaining wrapped results.
490int32_t Trail_CompareBoneNodes(int32_t const *lhs_key, int32_t const *rhs_key)
491{
492 return (uint32_t)*lhs_key - (uint32_t)*rhs_key;
493}
#define g_boneTrailPathBuffer_Z2
Definition globals.h:70
#define g_boneTrailPathBuffer_Z
Definition globals.h:52
#define g_boneTrailPathNodes
Definition globals.h:46
#define g_boneTrailPathBuffer_Z1
Definition globals.h:61
#define g_boneTrailAnimTime
Definition globals.h:58
#define g_boneTrailPathEnd
Definition globals.h:34
#define g_boneTrailTargetPosition
Definition globals.h:55
#define g_boneTrailPathBuffer_Y
Definition globals.h:49
#define g_boneTrailPathBuffer_X2
Definition globals.h:64
#define g_boneTrailPathBufferY2
Definition globals.h:67
struct Tree_Map * Tree_CreateMap(int32_t payload_size, int32_t(*compare_func)(void *, void *))
Definition tree.c:264
void * Tree_AllocateMapNode(struct Tree_Map *tree)
Definition tree.c:244
void * Tree_GetFirstMapNode(struct Tree_Map *tree)
Definition tree.c:197
void Tree_DestroyMap(struct Tree_Map *tree)
Definition tree.c:280
void Tree_InitializeMapNode(struct Tree_Map *tree, void *node_payload)
Definition tree.c:10
void Tree_FreeMapNode(void *node_payload)
Definition tree.c:256
@ COLLISION_CLASS_CAMERA_PROBE
Definition constants.h:15
void Collision_ResolveActorGroundContact(struct Actor_State *actor)
Definition ground.c:621
int32_t Math_SqrtFP12(uint32_t value)
#define NAVIGATION_LINK_NO_PARENT
Definition constants.h:9
#define NAVIGATION_ENTITY_GOAL_FIRST
Definition constants.h:4
#define NAVIGATION_LINK_EDGE_MASK
Definition constants.h:8
void Nav_ProcessPathNode(struct Tree_Map *open_set, struct Nav_Network *nav_network, struct Nav_OpenSetEntry *current_state, int32_t skip_dynamic_targets)
void Nav_CalculatePolygonCenter(struct Collision_Node *node, struct Collision_Polygon *polygon, struct Math_Vec3I32 *out_center)
Definition commands.c:131
int32_t Physics_CalculateMovementWithCollision(struct Math_Vec3I32 const *start_pos, struct Math_Vec3I32 const *end_pos, struct Actor_State const *collision_actor, int16_t probe_radius, int32_t collision_flags)
Definition movement.c:38
#define g_objectNodeRoot
Definition globals.h:12
struct Pkg_CollisionFacePlane * face_plane
Definition types.h:62
int16_t z
Definition types.h:460
int16_t x
Definition types.h:458
int16_t y
Definition types.h:459
int32_t y
Definition types.h:471
int32_t x
Definition types.h:470
int32_t z
Definition types.h:472
uint32_t behavior_flags
Definition types.h:88
struct Collision_Polygon * ground_contact_polygon
Definition types.h:93
struct Collision_Node * ground_collision_node
Definition types.h:92
struct Math_Vec3I32 position
Definition types.h:86
uint8_t collision_class
Definition types.h:90
uint8_t flags_and_node_low
Definition types.h:17
uint16_t packed_id
Definition types.h:13
struct Nav_Node * nodes
Definition types.h:35
int32_t node_count
Definition types.h:34
struct Math_Vec3I32 pos
Definition types.h:103
uint16_t parent_link
Definition types.h:104
struct Nav_NeighborEntry * neighbor_list
Definition types.h:107
struct Nav_OpenSetEntry * pathfind_state
Definition types.h:106
int16_t neighbor_count
Definition types.h:105
int16_t path_depth
Definition types.h:47
int16_t node_id
Definition types.h:46
uint32_t cost
Definition types.h:45
uint16_t navigation_offset_present
Definition types.h:1136
uint16_t navigation_link_id
Definition types.h:1139
struct Math_Vec3I16 navigation_offset
Definition types.h:1138
struct Mesh_RuntimeVertex * runtime_vertices
Definition types.h:144
#define TRAIL_NAV_EDGE_SHORTCUT
Definition constants.h:8
#define TRAIL_NAV_PARENT_NODE_MASK
Definition constants.h:9
#define TRAIL_NAV_EDGE_BLOCKED
Definition constants.h:7
int32_t Trail_CompareBoneNodes(int32_t const *lhs_key, int32_t const *rhs_key)
Definition geometry.c:490
int32_t Trail_FindBonePath(struct Math_Vec3I32 *start_pos, struct Nav_Network *nav_network, int32_t skip_dynamic_targets)
Definition geometry.c:27
int32_t Trail_CompareBoneNodes(int32_t const *lhs_key, int32_t const *rhs_key)
Definition geometry.c:490
#define Trail_ResetBone_CurrentPathNodeSelector
Definition globals.h:9
#define Trail_BonePathNodes
Definition globals.h:13