Skip to content

Commit 7a29fde

Browse files
SunrisepeakSunrisepeak
andauthored
mcpplibs.mwrap.recastnavigation 1.6.0: recastnavigation-m (Recast & Detour, navigation meshes, path finding and crowds, as a C++23 module) (#788)
Co-authored-by: Sunrisepeak <speakshen@outlook.com>
1 parent b2a9488 commit 7a29fde

8 files changed

Lines changed: 310 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Add mcpplibs.mwrap.recastnavigation (recastnavigation-m 1.6.0)
2+
3+
## Form
4+
5+
- Third-party upstream [recastnavigation/recastnavigation](https://github.com/recastnavigation/recastnavigation), release
6+
v1.6.0, zlib.
7+
- Form A external mwrap module repository [mcpplibs/recastnavigation-m](https://github.com/mcpplibs/recastnavigation-m),
8+
package `mcpplibs.mwrap.recastnavigation`, version 1.6.0 (the first indexed release of the identity), tag `mwrap-1.6.0`;
9+
release asset `recastnavigation-m-1.6.0.tar.gz` (`13382f6c…daa05`), CN mirror `gitcode.com/mcpp-res/mwrap-recastnavigation`
10+
with identical bytes.
11+
- Implementation ownership: the library has no compat package in this index, so the wrapper vendors the four libraries
12+
(Recast, Detour, DetourCrowd, DetourTileCache: `Include/` and `Source/`) from the release archive (checksums of every
13+
file in `upstream/documents.json`) and builds them with `-ffp-contract=off` and no fast math, with `NDEBUG` in every
14+
profile (upstream declares its assert hooks only without it). DebugUtils, the demo and upstream's tests are not
15+
vendored. It deploys upstream's README and License.txt with its own LICENSE/NOTICE (`runtime.deploy`).
16+
17+
## Module
18+
19+
- `mcpplibs.mwrap.recastnavigation`: every name declared at global scope by the four libraries' public headers, by
20+
`export using ::name;` (99 types, 75 enumerators of unscoped enumerations, 170 functions).
21+
- Internal-linkage adaptation: 52 `static const` objects (`DT_VERTS_PER_POLYGON`, `DT_SUCCESS`, `DT_FAILURE`,
22+
`RC_WALKABLE_AREA`, `RC_PI` …) are declared again under their names, with their types and values, in
23+
`mcpplibs::mwrap::recastnavigation` (an integer from the header's constant, a float from its literal).
24+
- No `.macros` module: upstream's macros are its asserts, branch hints and `RC_SIZE_MAX`, used by its own sources.
25+
- The export list is derived by `tools/surface.py` from the headers as clang reads them (its JSON AST), recorded in
26+
`tools/surface.json`, and audited in CI: the module is the record on every row, and on the Linux LLVM row the record
27+
is derived again and compared.
28+
29+
## Verification
30+
31+
- Wrapper CI (Linux x86_64 and arm64 with GCC 16.1 and LLVM 23.1.3, macOS LLVM, Windows LLVM, each in the dev and
32+
release profiles; wasm32-emscripten under node): a navigation mesh built from a floor and a wall, the same bytes
33+
twice; a path around the wall, its straight path, a ray along the mesh stopped by the wall; a crowd of four walked
34+
through the doorway; the mesh's bytes and the crowd's places pinned and the same on every row; the adapted
35+
constants; the export audit; the default template from an installed copy with a strict build.
36+
- This index: consumer `tests/mwrap/recastnavigation-path` (the same pinned hashes); the installed-template check
37+
with `--deploy` (`STATIC_NOTICES`).

‎.github/workflows/validate.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,6 +1738,11 @@ jobs:
17381738
shell: bash
17391739
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.jolt@5.6.0 --deploy
17401740

1741+
- name: Installed recastnavigation wrapper archive, actual default path template and its relocated notices
1742+
if: contains(format(' {0} ', env.MEMBERS), ' recastnavigation-path ') && matrix.toolchain == 'default'
1743+
shell: bash
1744+
run: python3 tests/mwrap/check_installed_template.py --mcpp "$MCPP" --package mcpplibs.mwrap.recastnavigation@1.6.0 --deploy
1745+
17411746
- name: Installed libjpeg-turbo wrapper archive, actual default decoding template and its relocated notices
17421747
if: contains(format(' {0} ', env.MEMBERS), ' libjpeg-turbo-decode ') && matrix.toolchain == 'default'
17431748
shell: bash

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@
4141

4242
### Added
4343

44+
- **mcpplibs.mwrap.recastnavigation 1.6.0(新包)。** recastnavigation-m:Recast & Detour 1.6.0(由三角形构建导航网格、寻路、群体、
45+
带障碍物的分块网格)的 C++23 模块,以 `export using` 在全局命名空间导出 Recast、Detour、DetourCrowd、DetourTileCache 头文件的
46+
全部公开名字(99 个类型、75 个无作用域枚举的枚举项、170 个函数);52 个内部链接的 `static const` 常量(`DT_VERTS_PER_POLYGON`、
47+
`DT_SUCCESS`、`RC_WALKABLE_AREA`、`RC_PI` 等)以原名、原类型和原值位于 `mcpplibs::mwrap::recastnavigation`。导出清单由 clang 读头文件
48+
推出并在 CI 中审计。封装仓库从上游 1.6.0 发布包取源码,以 `-ffp-contract=off`、不用快速数学构建,`NDEBUG` 使各配置相同:同一
49+
组三角形与群体在 Linux x86-64 与 arm64、macOS、Windows、wasm32 上,dev 与 release,网格字节与群体位置的哈希相同(钉住)。不含
50+
DebugUtils 与演示程序。消费者测试 `tests/mwrap/recastnavigation-path`,安装后模板检查带 `--deploy`。GLOBAL 为 GitHub 发布资产,
51+
CN 为 GitCode `mcpp-res/mwrap-recastnavigation` 镜像,sha256 相同。
4452
- **mcpplibs.mwrap.jolt 5.6.0(新包)。** jolt-m:Jolt Physics 5.6.0(刚体与软体物理:形状、约束、查询、角色、载具)的 C++23
4553
模块,以 `export using` 在上游的命名空间里导出 `<Jolt/…>` 下各头文件的全部公开名字(`JPH` 450 个类型、127 个函数与运算符、
4654
6 个对象,及嵌套命名空间 `ClosestPoint`、`HalfFloatConversion`、`ScaleHelpers`、`StreamUtils`、`literals` 的名字);50 个内部链接的

‎mcpp.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ members = [
3939
"tests/mwrap/cgltf-inspect",
4040
"tests/mwrap/manifold-boolean",
4141
"tests/mwrap/jolt-world",
42+
"tests/mwrap/recastnavigation-path",
4243
"tests/mwrap/basis-universal-transcode",
4344
"tests/mwrap/libjpeg-turbo-decode",
4445
"tests/mwrap/libarchive-bundle",

‎pkgs/mwrap/recastnavigation.lua‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
-- Immutable upstream-aligned mwrap source release (recastnavigation-m mwrap-1.6.0, the first release of upstream
2+
-- 1.6.0); GLOBAL and CN bytes are identical.
3+
--
4+
-- The wrapper is Apache-2.0; the libraries it vendors and links statically,
5+
-- Recast & Detour 1.6.0, are zlib: the package deploys their README and
6+
-- License.txt beside programs (runtime.deploy).
7+
package = {
8+
spec = "1",
9+
namespace = "mcpplibs.mwrap",
10+
name = "recastnavigation",
11+
description = "recastnavigation-m: Recast & Detour 1.6.0 (navigation meshes built from triangles, path finding, crowds, tiled meshes with obstacles) as a C++23 module",
12+
licenses = { "Apache-2.0" },
13+
repo = "https://github.com/mcpplibs/recastnavigation-m",
14+
type = "package",
15+
extensions = {
16+
autoupdate = {
17+
tag = "mwrap-${version}",
18+
url = "https://github.com/mcpplibs/recastnavigation-m/releases/download/${tag}/recastnavigation-m-${version}.tar.gz",
19+
},
20+
},
21+
xpm = {
22+
linux = {
23+
["1.6.0"] = {
24+
url = {
25+
GLOBAL = "https://github.com/mcpplibs/recastnavigation-m/releases/download/mwrap-1.6.0/recastnavigation-m-1.6.0.tar.gz",
26+
CN = "https://gitcode.com/mcpp-res/mwrap-recastnavigation/releases/download/1.6.0/recastnavigation-m-1.6.0.tar.gz",
27+
},
28+
sha256 = "13382f6c751ee5d000987c8e45e3721a4106f928753e004856dc339fbf5daa05",
29+
},
30+
},
31+
macosx = {
32+
["1.6.0"] = {
33+
url = {
34+
GLOBAL = "https://github.com/mcpplibs/recastnavigation-m/releases/download/mwrap-1.6.0/recastnavigation-m-1.6.0.tar.gz",
35+
CN = "https://gitcode.com/mcpp-res/mwrap-recastnavigation/releases/download/1.6.0/recastnavigation-m-1.6.0.tar.gz",
36+
},
37+
sha256 = "13382f6c751ee5d000987c8e45e3721a4106f928753e004856dc339fbf5daa05",
38+
},
39+
},
40+
windows = {
41+
["1.6.0"] = {
42+
url = {
43+
GLOBAL = "https://github.com/mcpplibs/recastnavigation-m/releases/download/mwrap-1.6.0/recastnavigation-m-1.6.0.tar.gz",
44+
CN = "https://gitcode.com/mcpp-res/mwrap-recastnavigation/releases/download/1.6.0/recastnavigation-m-1.6.0.tar.gz",
45+
},
46+
sha256 = "13382f6c751ee5d000987c8e45e3721a4106f928753e004856dc339fbf5daa05",
47+
},
48+
},
49+
},
50+
}

‎tests/mwrap/check_installed_template.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"mcpplibs.mwrap.meshoptimizer": ("meshoptimizer.cppm", "upstream/meshoptimizer/LICENSE.md", b"MIT License", b"Arseny Kapoulkine"),
2424
"mcpplibs.mwrap.cgltf": ("cgltf.cppm", "upstream/cgltf/LICENSE", b"Permission is hereby granted", b"Kuhlmann"),
2525
"mcpplibs.mwrap.manifold": ("manifold.cppm", "upstream/manifold/LICENSE", b"Apache License", b"The Manifold Authors"),
26+
"mcpplibs.mwrap.recastnavigation": ("recastnavigation.cppm", "upstream/recastnavigation/License.txt", b"This software is provided 'as-is'", b"Recast & Detour is Copyright (c) 2009 Mikko"),
2627
"mcpplibs.mwrap.jolt": ("jolt.cppm", "upstream/jolt/LICENSE", b"Permission is hereby granted", b"Jolt Physics is Copyright (c) 2021 Jorrit"),
2728
"mcpplibs.mwrap.libjpeg_turbo": ("libjpeg_turbo.cppm", "upstream/libjpeg-turbo/README.ijg", b"Independent JPEG Group", b"libjpeg-turbo Project"),
2829
"mcpplibs.mwrap.basis_universal": ("basis_universal.cppm", "upstream/basis_universal/NOTICE", b"Binomial LLC", b"Basis Universal"),
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "recastnavigation-path"
3+
version = "1.6.0"
4+
description = "Consume the immutable Recast & Detour wrapper: a navigation mesh built from triangles, a path around a wall, a crowd walked through a doorway; the mesh's bytes and the crowd's places pinned"
5+
6+
[indices]
7+
# Use the complete candidate built-in index prepared by tests/run_members.sh.
8+
# An explicit empty table overrides the legacy workspace redirect.
9+
10+
[dependencies]
11+
mcpplibs.mwrap.recastnavigation = "1.6.0"
12+
13+
# Detour's inline math compiled here too, as the library is built.
14+
[build]
15+
cxxflags = ["-ffp-contract=off"]
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
// The installed Recast & Detour wrapper: a navigation mesh built from a floor with a wall across it, the same
2+
// bytes twice; a path around the wall and a ray along the mesh stopped by it; a crowd of four walked through the
3+
// doorway to the far side. The mesh's bytes and the crowd's places are pinned, as the wrapper's CI pins them on
4+
// every platform; the adapted constants.
5+
import std;
6+
import mcpplibs.mwrap.recastnavigation;
7+
8+
namespace nav = mcpplibs::mwrap::recastnavigation;
9+
10+
namespace {
11+
12+
int failures = 0;
13+
void check(bool held) { failures += held ? 0 : 1; }
14+
15+
// A 20 m square floor at y 0, and a wall 0.4 m thick and 2 m high across x = 0 from z = -10 to z = 6 (a
16+
// doorway from z = 6 to 10), as triangles.
17+
struct Soup {
18+
std::vector<float> vertices;
19+
std::vector<int> triangles;
20+
void quad(std::array<float, 3> a, std::array<float, 3> b, std::array<float, 3> c, std::array<float, 3> d) {
21+
const int base = static_cast<int>(vertices.size() / 3);
22+
for (const auto& corner : {a, b, c, d}) vertices.insert(vertices.end(), corner.begin(), corner.end());
23+
triangles.insert(triangles.end(), {base, base + 1, base + 2, base, base + 2, base + 3});
24+
}
25+
// A box from `low` to `high`, its faces wound counter-clockwise seen from outside.
26+
void box(std::array<float, 3> low, std::array<float, 3> high) {
27+
const auto [x0, y0, z0] = low;
28+
const auto [x1, y1, z1] = high;
29+
quad({x0, y1, z0}, {x0, y1, z1}, {x1, y1, z1}, {x1, y1, z0}); // top
30+
quad({x0, y0, z0}, {x1, y0, z0}, {x1, y0, z1}, {x0, y0, z1}); // bottom
31+
quad({x0, y0, z0}, {x0, y1, z0}, {x1, y1, z0}, {x1, y0, z0}); // -z
32+
quad({x0, y0, z1}, {x1, y0, z1}, {x1, y1, z1}, {x0, y1, z1}); // +z
33+
quad({x0, y0, z0}, {x0, y0, z1}, {x0, y1, z1}, {x0, y1, z0}); // -x
34+
quad({x1, y0, z0}, {x1, y1, z0}, {x1, y1, z1}, {x1, y0, z1}); // +x
35+
}
36+
};
37+
Soup scene() {
38+
Soup soup;
39+
soup.quad({-10, 0, -10}, {-10, 0, 10}, {10, 0, 10}, {10, 0, -10});
40+
soup.box({-0.2f, 0, -10}, {0.2f, 2, 6});
41+
return soup;
42+
}
43+
44+
// The fingerprint of bytes: FNV-1a, 64 bits.
45+
std::uint64_t fnv(std::span<const unsigned char> bytes, std::uint64_t hash = 0xcbf29ce484222325ull) {
46+
for (const unsigned char byte : bytes) hash = (hash ^ byte) * 0x100000001b3ull;
47+
return hash;
48+
}
49+
std::uint64_t fnv(std::span<const float> values, std::uint64_t hash = 0xcbf29ce484222325ull) {
50+
return fnv(std::as_bytes(values).size() ? std::span(reinterpret_cast<const unsigned char*>(values.data()), values.size_bytes()) : std::span<const unsigned char>{}, hash);
51+
}
52+
53+
// Recast's pipeline for one tile, as upstream's solo-mesh sample runs it: the triangles rasterised into a
54+
// heightfield, what an agent cannot stand on or pass under filtered out, regions, contours, polygons and the
55+
// detail mesh; then Detour's data of it.
56+
std::vector<unsigned char> build(const Soup& soup) {
57+
rcConfig config{};
58+
config.cs = 0.2f;
59+
config.ch = 0.1f;
60+
config.walkableSlopeAngle = 45;
61+
config.walkableHeight = 20; // 2 m in cells of 0.1
62+
config.walkableClimb = 4; // 0.4 m
63+
config.walkableRadius = 2; // 0.4 m in cells of 0.2
64+
config.maxEdgeLen = 60;
65+
config.maxSimplificationError = 1.3f;
66+
config.minRegionArea = 8 * 8;
67+
config.mergeRegionArea = 20 * 20;
68+
config.maxVertsPerPoly = 6;
69+
config.detailSampleDist = 1.2f;
70+
config.detailSampleMaxError = 0.1f;
71+
const int vertex_count = static_cast<int>(soup.vertices.size() / 3), triangle_count = static_cast<int>(soup.triangles.size() / 3);
72+
rcCalcBounds(soup.vertices.data(), vertex_count, config.bmin, config.bmax);
73+
rcCalcGridSize(config.bmin, config.bmax, config.cs, &config.width, &config.height);
74+
75+
rcContext context(false);
76+
rcHeightfield* solid = rcAllocHeightfield();
77+
check(rcCreateHeightfield(&context, *solid, config.width, config.height, config.bmin, config.bmax, config.cs, config.ch));
78+
std::vector<unsigned char> areas(static_cast<std::size_t>(triangle_count), 0);
79+
rcMarkWalkableTriangles(&context, config.walkableSlopeAngle, soup.vertices.data(), vertex_count, soup.triangles.data(), triangle_count, areas.data());
80+
check(rcRasterizeTriangles(&context, soup.vertices.data(), vertex_count, soup.triangles.data(), areas.data(), triangle_count, *solid, config.walkableClimb));
81+
rcFilterLowHangingWalkableObstacles(&context, config.walkableClimb, *solid);
82+
rcFilterLedgeSpans(&context, config.walkableHeight, config.walkableClimb, *solid);
83+
rcFilterWalkableLowHeightSpans(&context, config.walkableHeight, *solid);
84+
rcCompactHeightfield* compact = rcAllocCompactHeightfield();
85+
check(rcBuildCompactHeightfield(&context, config.walkableHeight, config.walkableClimb, *solid, *compact));
86+
rcFreeHeightField(solid);
87+
check(rcErodeWalkableArea(&context, config.walkableRadius, *compact));
88+
check(rcBuildDistanceField(&context, *compact));
89+
check(rcBuildRegions(&context, *compact, 0, config.minRegionArea, config.mergeRegionArea));
90+
rcContourSet* contours = rcAllocContourSet();
91+
check(rcBuildContours(&context, *compact, config.maxSimplificationError, config.maxEdgeLen, *contours));
92+
rcPolyMesh* mesh = rcAllocPolyMesh();
93+
check(rcBuildPolyMesh(&context, *contours, config.maxVertsPerPoly, *mesh));
94+
rcPolyMeshDetail* detail = rcAllocPolyMeshDetail();
95+
check(rcBuildPolyMeshDetail(&context, *mesh, *compact, config.detailSampleDist, config.detailSampleMaxError, *detail));
96+
rcFreeCompactHeightfield(compact);
97+
rcFreeContourSet(contours);
98+
for (int poly = 0; poly < mesh->npolys; ++poly)
99+
if (mesh->areas[poly] == nav::RC_WALKABLE_AREA) mesh->flags[poly] = 1;
100+
101+
dtNavMeshCreateParams params{};
102+
params.verts = mesh->verts;
103+
params.vertCount = mesh->nverts;
104+
params.polys = mesh->polys;
105+
params.polyAreas = mesh->areas;
106+
params.polyFlags = mesh->flags;
107+
params.polyCount = mesh->npolys;
108+
params.nvp = mesh->nvp;
109+
params.detailMeshes = detail->meshes;
110+
params.detailVerts = detail->verts;
111+
params.detailVertsCount = detail->nverts;
112+
params.detailTris = detail->tris;
113+
params.detailTriCount = detail->ntris;
114+
params.walkableHeight = 2.0f;
115+
params.walkableRadius = 0.4f;
116+
params.walkableClimb = 0.4f;
117+
std::copy_n(mesh->bmin, 3, params.bmin);
118+
std::copy_n(mesh->bmax, 3, params.bmax);
119+
params.cs = config.cs;
120+
params.ch = config.ch;
121+
params.buildBvTree = true;
122+
unsigned char* data = nullptr;
123+
int size = 0;
124+
check(dtCreateNavMeshData(&params, &data, &size));
125+
rcFreePolyMesh(mesh);
126+
rcFreePolyMeshDetail(detail);
127+
std::vector<unsigned char> out(data, data + size);
128+
dtFree(data);
129+
return out;
130+
}
131+
132+
// The mesh loaded: Detour takes a copy it frees.
133+
dtNavMesh* load(const std::vector<unsigned char>& bytes) {
134+
dtNavMesh* mesh = dtAllocNavMesh();
135+
auto* data = static_cast<unsigned char*>(dtAlloc(static_cast<int>(bytes.size()), DT_ALLOC_PERM));
136+
std::ranges::copy(bytes, data);
137+
check(dtStatusSucceed(mesh->init(data, static_cast<int>(bytes.size()), DT_TILE_FREE_DATA)));
138+
return mesh;
139+
}
140+
141+
} // namespace
142+
143+
int main() {
144+
const std::vector<unsigned char> bytes = build(scene());
145+
check(!bytes.empty() && bytes == build(scene()));
146+
dtNavMesh* mesh = load(bytes);
147+
dtNavMeshQuery* query = dtAllocNavMeshQuery();
148+
check(dtStatusSucceed(query->init(mesh, 2048)));
149+
dtQueryFilter filter;
150+
const float extents[3] = {1, 2, 1}, start[3] = {-5, 0, -5}, end[3] = {5, 0, -5};
151+
dtPolyRef start_ref = 0, end_ref = 0;
152+
float start_at[3], end_at[3];
153+
query->findNearestPoly(start, extents, &filter, &start_ref, start_at);
154+
query->findNearestPoly(end, extents, &filter, &end_ref, end_at);
155+
dtPolyRef polys[256];
156+
int poly_count = 0, corner_count = 0;
157+
float corners[3 * 32];
158+
check(dtStatusSucceed(query->findPath(start_ref, end_ref, start_at, end_at, &filter, polys, &poly_count, 256)));
159+
check(dtStatusSucceed(query->findStraightPath(start_at, end_at, polys, poly_count, corners, nullptr, nullptr, &corner_count, 32)));
160+
float through = -100;
161+
for (int corner = 0; corner < corner_count; ++corner) through = std::max(through, corners[3 * corner + 2]);
162+
check(corner_count >= 3 && through > 6.0f);
163+
float hit = 0, normal[3];
164+
dtPolyRef ray_polys[64];
165+
int ray_count = 0;
166+
check(dtStatusSucceed(query->raycast(start_ref, start_at, end_at, &filter, &hit, normal, ray_polys, &ray_count, 64)) && hit > 0.4f && hit < 0.5f);
167+
168+
dtCrowd* crowd = dtAllocCrowd();
169+
check(crowd->init(8, 0.4f, mesh));
170+
dtCrowdAgentParams agent{};
171+
agent.radius = 0.4f, agent.height = 2, agent.maxAcceleration = 8, agent.maxSpeed = 3.5f;
172+
agent.collisionQueryRange = agent.radius * 12, agent.pathOptimizationRange = agent.radius * 30, agent.separationWeight = 2;
173+
agent.updateFlags = DT_CROWD_ANTICIPATE_TURNS | DT_CROWD_OPTIMIZE_VIS | DT_CROWD_OPTIMIZE_TOPO | DT_CROWD_OBSTACLE_AVOIDANCE | DT_CROWD_SEPARATION;
174+
agent.obstacleAvoidanceType = 3;
175+
for (int index = 0; index < 4; ++index) {
176+
const float at[3] = {-5, 0, -6.0f + static_cast<float>(index)};
177+
check(crowd->addAgent(at, &agent) == index);
178+
check(crowd->requestMoveTarget(index, end_ref, end_at));
179+
}
180+
for (int step = 0; step < 600; ++step) crowd->update(1.0f / 60, nullptr);
181+
std::vector<float> places;
182+
for (int index = 0; index < 4; ++index) {
183+
const dtCrowdAgent* walker = crowd->getAgent(index);
184+
places.insert(places.end(), walker->npos, walker->npos + 3);
185+
check(dtVdist2D(walker->npos, end_at) < 2.5f);
186+
}
187+
check(fnv(bytes) == 0xd50409b3475ce9afull && fnv(places) == 0x040f1c330fce843bull);
188+
check(nav::DT_VERTS_PER_POLYGON == 6 && nav::RC_WALKABLE_AREA == 63 && dtStatusFailed(nav::DT_FAILURE));
189+
std::println("Recast & Detour 1.6.0 through import mcpplibs.mwrap.recastnavigation: {} polygon refs to the far side, {} corners; the mesh {:#018x}, the crowd {:#018x}{}",
190+
poly_count, corner_count, fnv(bytes), fnv(places), failures ? std::format(" — {} checks failed", failures) : "");
191+
dtFreeCrowd(crowd), dtFreeNavMeshQuery(query), dtFreeNavMesh(mesh);
192+
return failures;
193+
}

0 commit comments

Comments
 (0)