@recast-navigation/generators 0.40.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OffMeshConnectionParams } from '@recast-navigation/core';
|
|
1
|
+
import { type OffMeshConnectionParams } from '@recast-navigation/core';
|
|
2
2
|
export declare const getBoundingBox: (positions: ArrayLike<number>, indices: ArrayLike<number>) => {
|
|
3
3
|
bbMin: import("@recast-navigation/core").Vector3Tuple;
|
|
4
4
|
bbMax: import("@recast-navigation/core").Vector3Tuple;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NavMesh, RecastBuildContext, RecastCompactHeightfield, RecastConfig, RecastContourSet, RecastHeightfield, RecastPolyMesh, RecastPolyMeshDetail, UnsignedCharArray, Vector3Tuple } from '@recast-navigation/core';
|
|
2
|
-
import { Pretty } from '../types';
|
|
3
|
-
import { OffMeshConnectionGeneratorParams } from './common';
|
|
1
|
+
import { NavMesh, RecastBuildContext, type RecastCompactHeightfield, type RecastConfig, type RecastContourSet, type RecastHeightfield, type RecastPolyMesh, type RecastPolyMeshDetail, type UnsignedCharArray, type Vector3Tuple } from '@recast-navigation/core';
|
|
2
|
+
import type { Pretty } from '../types';
|
|
3
|
+
import { type OffMeshConnectionGeneratorParams } from './common';
|
|
4
4
|
export type SoloNavMeshGeneratorConfig = Pretty<Omit<RecastConfig, 'tileSize'> & OffMeshConnectionGeneratorParams & {
|
|
5
5
|
/**
|
|
6
6
|
* @default true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NavMesh, RecastBuildContext, RecastChunkyTriMesh, RecastCompactHeightfield, RecastConfig, RecastHeightfield, RecastHeightfieldLayerSet, TileCache, TileCacheMeshProcess, Vector3Tuple } from '@recast-navigation/core';
|
|
2
|
-
import { Pretty } from '../types';
|
|
1
|
+
import { NavMesh, RecastBuildContext, RecastChunkyTriMesh, type RecastCompactHeightfield, type RecastConfig, type RecastHeightfield, type RecastHeightfieldLayerSet, TileCache, TileCacheMeshProcess, type Vector3Tuple } from '@recast-navigation/core';
|
|
2
|
+
import type { Pretty } from '../types';
|
|
3
3
|
type TileCacheRecastConfig = Omit<RecastConfig, 'minRegionArea' | 'maxEdgeLen'>;
|
|
4
4
|
export type TileCacheGeneratorConfig = Pretty<TileCacheRecastConfig & {
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FloatArray, IntArray, NavMesh, OffMeshConnectionParams, RawModule, RecastBuildContext, RecastChunkyTriMesh, RecastCompactHeightfield, RecastConfig, RecastContourSet, RecastHeightfield, RecastPolyMesh, RecastPolyMeshDetail, UnsignedCharArray, Vector3Tuple } from '@recast-navigation/core';
|
|
2
|
-
import { Pretty } from '../types';
|
|
3
|
-
import { OffMeshConnectionGeneratorParams } from './common';
|
|
1
|
+
import { type FloatArray, type IntArray, NavMesh, type OffMeshConnectionParams, type RawModule, RecastBuildContext, RecastChunkyTriMesh, type RecastCompactHeightfield, type RecastConfig, type RecastContourSet, type RecastHeightfield, type RecastPolyMesh, type RecastPolyMeshDetail, type UnsignedCharArray, type Vector3Tuple } from '@recast-navigation/core';
|
|
2
|
+
import type { Pretty } from '../types';
|
|
3
|
+
import { type OffMeshConnectionGeneratorParams } from './common';
|
|
4
4
|
export declare const buildTiledNavMeshRcConfig: ({ recastConfig, navMeshBounds: [navMeshBoundsMin, navMeshBoundsMax], }: {
|
|
5
5
|
recastConfig: RecastConfig;
|
|
6
6
|
navMeshBounds: [min: Vector3Tuple, max: Vector3Tuple];
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { vec3, recastConfigDefaults, RecastBuildContext, VerticesArray, TrianglesArray, createRcConfig, calcGridSize, allocHeightfield, createHeightfield, TriangleAreasArray, markWalkableTriangles, rasterizeTriangles, filterLowHangingWalkableObstacles, filterLedgeSpans, filterWalkableLowHeightSpans, allocCompactHeightfield, buildCompactHeightfield, freeHeightfield, erodeWalkableArea, buildDistanceField, buildRegions, allocContourSet, buildContours, Recast, allocPolyMesh, buildPolyMesh, allocPolyMeshDetail, buildPolyMeshDetail, freeCompactHeightfield, freeContourSet, NavMeshCreateParams, createNavMeshData, Raw, NavMesh, freePolyMesh, freePolyMeshDetail, TileCacheMeshProcess, TileCache, DetourTileCacheParams, NavMeshParams, RecastChunkyTriMesh, statusFailed,
|
|
1
|
+
import { vec3, recastConfigDefaults, RecastBuildContext, VerticesArray, TrianglesArray, createRcConfig, calcGridSize, allocHeightfield, createHeightfield, TriangleAreasArray, markWalkableTriangles, rasterizeTriangles, filterLowHangingWalkableObstacles, filterLedgeSpans, filterWalkableLowHeightSpans, allocCompactHeightfield, buildCompactHeightfield, freeHeightfield, erodeWalkableArea, buildDistanceField, buildRegions, allocContourSet, buildContours, Recast, allocPolyMesh, buildPolyMesh, allocPolyMeshDetail, buildPolyMeshDetail, freeCompactHeightfield, freeContourSet, NavMeshCreateParams, createNavMeshData, Raw, NavMesh, freePolyMesh, freePolyMeshDetail, TileCacheMeshProcess, TileCache, DetourTileCacheParams, NavMeshParams, RecastChunkyTriMesh, statusFailed, cloneRcConfig, ChunkIdsArray, allocHeightfieldLayerSet, buildHeightfieldLayers, TileCacheData, Detour, getHeightfieldLayerHeights, getHeightfieldLayerAreas, getHeightfieldLayerCons, buildTileCacheLayer, freeHeightfieldLayerSet, statusToReadableString } from '@recast-navigation/core';
|
|
2
2
|
|
|
3
3
|
const getBoundingBox = (positions, indices) => {
|
|
4
4
|
const bbMin = {
|
|
@@ -232,10 +232,10 @@ const generateSoloNavMeshData = (positions, indices, navMeshGeneratorConfig = {}
|
|
|
232
232
|
// Step 8. Create Detour data from Recast poly mesh.
|
|
233
233
|
//
|
|
234
234
|
for (let i = 0; i < polyMesh.npolys(); i++) {
|
|
235
|
-
if (polyMesh.areas(i)
|
|
235
|
+
if (polyMesh.areas(i) === Recast.RC_WALKABLE_AREA) {
|
|
236
236
|
polyMesh.setAreas(i, 0);
|
|
237
237
|
}
|
|
238
|
-
if (polyMesh.areas(i)
|
|
238
|
+
if (polyMesh.areas(i) === 0) {
|
|
239
239
|
polyMesh.setFlags(i, 1);
|
|
240
240
|
}
|
|
241
241
|
}
|
|
@@ -613,7 +613,6 @@ const generateTileCache = (positions, indices, navMeshGeneratorConfig = {}, keep
|
|
|
613
613
|
const addResult = tileCache.addTile(tileCacheData);
|
|
614
614
|
if (statusFailed(addResult.status)) {
|
|
615
615
|
buildContext.log(Recast.RC_LOG_WARNING, `Failed to add tile to tile cache - tx: ${x}, ty: ${y}`);
|
|
616
|
-
continue;
|
|
617
616
|
}
|
|
618
617
|
}
|
|
619
618
|
}
|
|
@@ -871,10 +870,10 @@ const generateTileNavMeshData = (positions, indices, rcConfig, chunkyTriMesh, ti
|
|
|
871
870
|
}
|
|
872
871
|
// Update poly flags from areas.
|
|
873
872
|
for (let i = 0; i < polyMesh.npolys(); i++) {
|
|
874
|
-
if (polyMesh.areas(i)
|
|
873
|
+
if (polyMesh.areas(i) === Recast.RC_WALKABLE_AREA) {
|
|
875
874
|
polyMesh.setAreas(i, 0);
|
|
876
875
|
}
|
|
877
|
-
if (polyMesh.areas(i)
|
|
876
|
+
if (polyMesh.areas(i) === 0) {
|
|
878
877
|
polyMesh.setFlags(i, 1);
|
|
879
878
|
}
|
|
880
879
|
}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"email": "isaac@isaacmason.com",
|
|
7
7
|
"url": "https://isaacmason.com/"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.42.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"homepage": "https://github.com/isaac-mason/recast-navigation-js",
|
|
12
12
|
"bugs": {
|
|
@@ -23,25 +23,21 @@
|
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "rollup --config rollup.config.js --bundleConfigAsCjs",
|
|
26
|
-
"test": "tsc"
|
|
27
|
-
"lint": "eslint src"
|
|
26
|
+
"test": "tsc"
|
|
28
27
|
},
|
|
29
28
|
"dependencies": {
|
|
30
|
-
"@recast-navigation/core": "0.
|
|
31
|
-
"@recast-navigation/wasm": "0.
|
|
29
|
+
"@recast-navigation/core": "0.42.0",
|
|
30
|
+
"@recast-navigation/wasm": "0.42.0"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
|
-
"@babel/core": "^7.
|
|
35
|
-
"@babel/preset-env": "^7.
|
|
36
|
-
"@babel/preset-typescript": "^7.
|
|
37
|
-
"@isaac-mason/eslint-config-typescript": "^0.0.9",
|
|
33
|
+
"@babel/core": "^7.28.0",
|
|
34
|
+
"@babel/preset-env": "^7.28.0",
|
|
35
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
38
36
|
"@rollup/plugin-babel": "^6.0.4",
|
|
39
|
-
"@rollup/plugin-commonjs": "^
|
|
40
|
-
"@rollup/plugin-node-resolve": "^
|
|
41
|
-
"@rollup/plugin-typescript": "^
|
|
42
|
-
"
|
|
43
|
-
"prettier": "^3.1.0",
|
|
44
|
-
"rollup": "^4.14.0",
|
|
37
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
38
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
39
|
+
"@rollup/plugin-typescript": "^12.1.4",
|
|
40
|
+
"rollup": "^4.44.2",
|
|
45
41
|
"rollup-plugin-copy": "^3.4.0",
|
|
46
42
|
"rollup-plugin-filesize": "^10.0.0",
|
|
47
43
|
"typescript": "^5.4.3"
|