It took a few months to automatically create a navigation grid and a navigation grid.
□Definition of navigation grid data structure
Because there is a hierarchical relationship between data, XML is used for definition.
Basic elements of navmesh: Verts + edges + polys)
□Navigation grid pathfinding
1. Search for a star using a convex polygon as a node and a walking edge as a relation.
2. Search Results Using losAlgorithmThe path is smooth, and the line of sight is implemented by the horizontal plane of the Z axis instead of the straight line.
3. Search for convex polygon. Use the October tree to divide the space, and then search based on the intersection between the vertex and the AABB box.
□Automatic navigation grid generation
Mainly to provide
1. cleaner: Merge duplicate vertices (I .e. solder vertices), delete the colons, delete unused vertices, delete existing poly (I .e. delete nonstandard, delete Small Area) reset vertex ID and poly ID.
2. mergingpolys: Merge polygon, including merging the same edge and 32 merging.
3. polygonclipping: polygon cutting. The terrain data must be in a triangular mesh (if not, triangulate can be used for partitioning ). After an obstacle is entered, use the wrap method (Jarvis stepping method) to construct a convex polygon, and then cut each triangle mesh.
4. Triangulate: triangular.
5. generatingedges: Generate edge operation.
6. deleter: delete a specified vertex, delete a specified poly, and delete a specified edge.
7. boudingboxcreater: The AABB box can be used for obstacle input, but only an enclosed box is generated for the connected triangular mesh. For example, two fences on a bridge must generate two AABB boxes for it, instead, you cannot generate only one.
8. navmesh: import, export, and traverse operations
9. Poly: traversal and vertex Deletion
:
1. (non-path smooth)
2. After smooth path
Time spent: 0.412872 MS (related to the number of grids)
References:
1. Welding vertices, section 14.4.2 3D mathematical basics: graphics and Game Development
2. 32. in artificial intelligence game programming truth, there is an article titled "4.3 creating a navigation grid close to the optimal", which specifically describes how to build a 3D pathfinding based on a navigation grid, Section 4.3.6.
3. http://www.ai-blog.net/archives/000152.html
4. Edge generation: http://www.terathon.com/code/edges.php
5. generate triangle mesh based on points, http://www.travellermap.com/tmp/delaunay.htm
Http://local.wasp.uwa.edu.au /~ Pbourke/papers/triangulate/
6. Geometric operations: detailed explanation of computer graphics geometric tools and Algorithms
7 ......