@recast-navigation/core 0.25.0 → 0.26.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.
- package/dist/arrays.d.ts +52 -0
- package/dist/detour.d.ts +5 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/nav-mesh-query.d.ts +6 -5
- package/dist/nav-mesh.d.ts +3 -2
- package/dist/raw.d.ts +5 -12
- package/dist/recast.d.ts +12 -11
- package/dist/tile-cache.d.ts +4 -3
- package/package.json +2 -2
package/dist/nav-mesh-query.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FloatArray, UnsignedCharArray, UnsignedIntArray } from './arrays';
|
|
1
2
|
import { NavMesh } from './nav-mesh';
|
|
2
3
|
import type R from './raw-module';
|
|
3
4
|
import { Vector3 } from './utils';
|
|
@@ -313,7 +314,7 @@ export declare class NavMeshQuery {
|
|
|
313
314
|
}): {
|
|
314
315
|
success: boolean;
|
|
315
316
|
status: number;
|
|
316
|
-
polys:
|
|
317
|
+
polys: UnsignedIntArray;
|
|
317
318
|
};
|
|
318
319
|
/**
|
|
319
320
|
* Finds the straight path from the start to the end position within the polygon corridor.
|
|
@@ -339,7 +340,7 @@ export declare class NavMeshQuery {
|
|
|
339
340
|
* @param options additional options
|
|
340
341
|
* @returns the straight path result
|
|
341
342
|
*/
|
|
342
|
-
findStraightPath(start: Vector3, end: Vector3, path:
|
|
343
|
+
findStraightPath(start: Vector3, end: Vector3, path: UnsignedIntArray, options?: {
|
|
343
344
|
/**
|
|
344
345
|
* The maximum number of points the straight path arrays can hold. [Limit: > 0]
|
|
345
346
|
* @default 256
|
|
@@ -363,11 +364,11 @@ export declare class NavMeshQuery {
|
|
|
363
364
|
/**
|
|
364
365
|
* The straight path points.
|
|
365
366
|
*/
|
|
366
|
-
straightPath:
|
|
367
|
+
straightPath: FloatArray;
|
|
367
368
|
/**
|
|
368
369
|
* The straight path flags.
|
|
369
370
|
*/
|
|
370
|
-
straightPathFlags:
|
|
371
|
+
straightPathFlags: UnsignedCharArray;
|
|
371
372
|
/**
|
|
372
373
|
* The reference ids of the visited polygons.
|
|
373
374
|
*
|
|
@@ -375,7 +376,7 @@ export declare class NavMeshQuery {
|
|
|
375
376
|
* Raw.Module.DT_STRAIGHTPATH_END
|
|
376
377
|
* Raw.Module.DT_STRAIGHTPATH_OFFMESH_CONNECTION
|
|
377
378
|
*/
|
|
378
|
-
straightPathRefs:
|
|
379
|
+
straightPathRefs: UnsignedIntArray;
|
|
379
380
|
/**
|
|
380
381
|
* The number of points in the straight path.
|
|
381
382
|
*/
|
package/dist/nav-mesh.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UnsignedCharArray } from './arrays';
|
|
1
2
|
import { DetourMeshTile, DetourOffMeshConnection, DetourPoly } from './detour';
|
|
2
3
|
import type R from './raw-module';
|
|
3
4
|
import { Vector3 } from './utils';
|
|
@@ -67,7 +68,7 @@ export declare class NavMesh {
|
|
|
67
68
|
* @param navMeshData the nav mesh data
|
|
68
69
|
* @returns the status of the operation
|
|
69
70
|
*/
|
|
70
|
-
initSolo(navMeshData:
|
|
71
|
+
initSolo(navMeshData: UnsignedCharArray): boolean;
|
|
71
72
|
/**
|
|
72
73
|
* Initializes the NavMesh for use with multiple tiles.
|
|
73
74
|
* @param params parameters for the NavMesh
|
|
@@ -81,7 +82,7 @@ export declare class NavMesh {
|
|
|
81
82
|
* @param lastRef
|
|
82
83
|
* @returns the status of the operation and the reference of the added tile
|
|
83
84
|
*/
|
|
84
|
-
addTile(navMeshData:
|
|
85
|
+
addTile(navMeshData: UnsignedCharArray, flags: number, lastRef: number): {
|
|
85
86
|
status: number;
|
|
86
87
|
tileRef: number;
|
|
87
88
|
};
|
package/dist/raw.d.ts
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
import RawModule from './raw-module';
|
|
2
|
-
export declare const Arrays: {
|
|
3
|
-
IntArray: typeof RawModule.IntArray;
|
|
4
|
-
UnsignedIntArray: typeof RawModule.UnsignedIntArray;
|
|
5
|
-
UnsignedCharArray: typeof RawModule.UnsignedCharArray;
|
|
6
|
-
UnsignedShortArray: typeof RawModule.UnsignedShortArray;
|
|
7
|
-
FloatArray: typeof RawModule.FloatArray;
|
|
8
|
-
VertsArray: typeof RawModule.FloatArray;
|
|
9
|
-
TrisArray: typeof RawModule.IntArray;
|
|
10
|
-
TriAreasArray: typeof RawModule.UnsignedCharArray;
|
|
11
|
-
ChunkIdsArray: typeof RawModule.IntArray;
|
|
12
|
-
TileCacheData: typeof RawModule.UnsignedCharArray;
|
|
13
|
-
};
|
|
14
2
|
/**
|
|
15
3
|
* Lower level bindings for the Recast and Detour libraries.
|
|
16
4
|
*
|
|
@@ -46,5 +34,10 @@ export declare const Raw: {
|
|
|
46
34
|
UnsignedCharRef: typeof RawModule.UnsignedCharRef;
|
|
47
35
|
UnsignedShortRef: typeof RawModule.UnsignedShortRef;
|
|
48
36
|
FloatRef: typeof RawModule.FloatRef;
|
|
37
|
+
IntArray: typeof RawModule.IntArray;
|
|
38
|
+
UnsignedIntArray: typeof RawModule.UnsignedIntArray;
|
|
39
|
+
UnsignedCharArray: typeof RawModule.UnsignedCharArray;
|
|
40
|
+
UnsignedShortArray: typeof RawModule.UnsignedShortArray;
|
|
41
|
+
FloatArray: typeof RawModule.FloatArray;
|
|
49
42
|
};
|
|
50
43
|
export declare const init: () => Promise<void>;
|
package/dist/recast.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Vector3Tuple } from 'three';
|
|
2
|
+
import { FloatArray, IntArray, UnsignedCharArray } from './arrays';
|
|
2
3
|
import type R from './raw-module';
|
|
3
4
|
import { Vector2Tuple, Vector3 } from './utils';
|
|
4
5
|
export type RecastConfig = {
|
|
@@ -119,9 +120,9 @@ export declare class RecastBuildContext {
|
|
|
119
120
|
export declare class RecastChunkyTriMesh {
|
|
120
121
|
raw: R.rcChunkyTriMesh;
|
|
121
122
|
constructor(raw?: R.rcChunkyTriMesh);
|
|
122
|
-
init(verts:
|
|
123
|
-
getChunksOverlappingRect(boundsMin: Vector2Tuple, boundsMax: Vector2Tuple, chunks:
|
|
124
|
-
getNodeTris(nodeId: number):
|
|
123
|
+
init(verts: FloatArray, tris: IntArray, ntris: number, trisPerChunk: number): boolean;
|
|
124
|
+
getChunksOverlappingRect(boundsMin: Vector2Tuple, boundsMax: Vector2Tuple, chunks: IntArray, maxChunks: number): number;
|
|
125
|
+
getNodeTris(nodeId: number): IntArray;
|
|
125
126
|
nodes(index: number): R.rcChunkyTriMeshNode;
|
|
126
127
|
maxTrisPerChunk(): number;
|
|
127
128
|
}
|
|
@@ -266,12 +267,12 @@ export declare class RecastPolyMeshDetail {
|
|
|
266
267
|
nverts(): number;
|
|
267
268
|
ntris(): number;
|
|
268
269
|
}
|
|
269
|
-
export declare const calcBounds: (verts:
|
|
270
|
+
export declare const calcBounds: (verts: FloatArray, nv: number) => R.RecastCalcBoundsResult;
|
|
270
271
|
export declare const calcGridSize: (bmin: Vector3Tuple, bmax: Vector3Tuple, cs: number) => R.RecastCalcGridSizeResult;
|
|
271
272
|
export declare const createHeightfield: (buildContext: RecastBuildContext, heightfield: RecastHeightfield, width: number, height: number, bmin: Vector3Tuple, bmax: Vector3Tuple, cs: number, ch: number) => boolean;
|
|
272
|
-
export declare const markWalkableTriangles: (buildContext: RecastBuildContext, walkableSlopeAngle: number, verts:
|
|
273
|
-
export declare const clearUnwalkableTriangles: (buildContext: RecastBuildContext, walkableSlopeAngle: number, verts:
|
|
274
|
-
export declare const rasterizeTriangles: (buildContext: RecastBuildContext, verts:
|
|
273
|
+
export declare const markWalkableTriangles: (buildContext: RecastBuildContext, walkableSlopeAngle: number, verts: FloatArray, nv: number, tris: IntArray, nt: number, areas: UnsignedCharArray) => void;
|
|
274
|
+
export declare const clearUnwalkableTriangles: (buildContext: RecastBuildContext, walkableSlopeAngle: number, verts: FloatArray, nv: number, tris: IntArray, nt: number, areas: UnsignedCharArray) => void;
|
|
275
|
+
export declare const rasterizeTriangles: (buildContext: RecastBuildContext, verts: FloatArray, nv: number, tris: IntArray, areas: UnsignedCharArray, nt: number, heightfield: RecastHeightfield, flagMergeThreshold?: number) => boolean;
|
|
275
276
|
export declare const filterLowHangingWalkableObstacles: (buildContext: RecastBuildContext, walkableClimb: number, heightfield: RecastHeightfield) => void;
|
|
276
277
|
export declare const filterLedgeSpans: (buildContext: RecastBuildContext, walkableHeight: number, walkableClimb: number, heightfield: RecastHeightfield) => void;
|
|
277
278
|
export declare const filterWalkableLowHeightSpans: (buildContext: RecastBuildContext, walkableHeight: number, heightfield: RecastHeightfield) => void;
|
|
@@ -280,7 +281,7 @@ export declare const buildCompactHeightfield: (buildContext: RecastBuildContext,
|
|
|
280
281
|
export declare const erodeWalkableArea: (buildContext: RecastBuildContext, radius: number, compactHeightfield: RecastCompactHeightfield) => boolean;
|
|
281
282
|
export declare const medianFilterWalkableArea: (buildContext: RecastBuildContext, compactHeightfield: RecastCompactHeightfield) => boolean;
|
|
282
283
|
export declare const markBoxArea: (buildContext: RecastBuildContext, bmin: Vector3Tuple, bmax: Vector3Tuple, areaId: number, compactHeightfield: RecastCompactHeightfield) => void;
|
|
283
|
-
export declare const markConvexPolyArea: (buildContext: RecastBuildContext, verts:
|
|
284
|
+
export declare const markConvexPolyArea: (buildContext: RecastBuildContext, verts: FloatArray, nverts: number, hmin: number, hmax: number, areaId: number, compactHeightfield: RecastCompactHeightfield) => void;
|
|
284
285
|
export declare const markCylinderArea: (buildContext: RecastBuildContext, pos: Vector3Tuple, radius: number, height: number, areaId: number, compactHeightfield: RecastCompactHeightfield) => void;
|
|
285
286
|
export declare const buildDistanceField: (buildContext: RecastBuildContext, compactHeightfield: RecastCompactHeightfield) => boolean;
|
|
286
287
|
export declare const buildRegions: (buildContext: RecastBuildContext, compactHeightfield: RecastCompactHeightfield, borderSize: number, minRegionArea: number, mergeRegionArea: number) => boolean;
|
|
@@ -298,9 +299,9 @@ export declare const mergePolyMeshes: (buildContext: RecastBuildContext, meshes:
|
|
|
298
299
|
export declare const buildPolyMeshDetail: (buildContext: RecastBuildContext, mesh: RecastPolyMesh, compactHeightfield: RecastCompactHeightfield, sampleDist: number, sampleMaxError: number, polyMeshDetail: RecastPolyMeshDetail) => boolean;
|
|
299
300
|
export declare const copyPolyMesh: (buildContext: RecastBuildContext, src: RecastPolyMesh, dest: RecastPolyMesh) => boolean;
|
|
300
301
|
export declare const mergePolyMeshDetails: (buildContext: RecastBuildContext, meshes: RecastPolyMeshDetail[], out: RecastPolyMeshDetail) => boolean;
|
|
301
|
-
export declare const getHeightfieldLayerHeights: (heightfieldLayer: RecastHeightfieldLayer) =>
|
|
302
|
-
export declare const getHeightfieldLayerAreas: (heightfieldLayer: RecastHeightfieldLayer) =>
|
|
303
|
-
export declare const getHeightfieldLayerCons: (heightfieldLayer: RecastHeightfieldLayer) =>
|
|
302
|
+
export declare const getHeightfieldLayerHeights: (heightfieldLayer: RecastHeightfieldLayer) => UnsignedCharArray;
|
|
303
|
+
export declare const getHeightfieldLayerAreas: (heightfieldLayer: RecastHeightfieldLayer) => UnsignedCharArray;
|
|
304
|
+
export declare const getHeightfieldLayerCons: (heightfieldLayer: RecastHeightfieldLayer) => UnsignedCharArray;
|
|
304
305
|
export declare const allocHeightfield: () => RecastHeightfield;
|
|
305
306
|
export declare const freeHeightfield: (heightfield: RecastHeightfield) => void;
|
|
306
307
|
export declare const allocCompactHeightfield: () => RecastCompactHeightfield;
|
package/dist/tile-cache.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UnsignedCharArray, UnsignedShortArray } from './arrays';
|
|
1
2
|
import { NavMeshCreateParams } from './detour';
|
|
2
3
|
import { NavMesh } from './nav-mesh';
|
|
3
4
|
import type R from './raw-module';
|
|
@@ -96,13 +97,13 @@ export declare class TileCache {
|
|
|
96
97
|
* Removes an obstacle from the navigation mesh.
|
|
97
98
|
*/
|
|
98
99
|
removeObstacle(obstacle: Obstacle | ObstacleRef): RemoveObstacleResult;
|
|
99
|
-
addTile(data:
|
|
100
|
+
addTile(data: UnsignedCharArray, flags?: number): R.TileCacheAddTileResult;
|
|
100
101
|
buildNavMeshTile(ref: R.dtCompressedTileRef, navMesh: NavMesh): number;
|
|
101
102
|
buildNavMeshTilesAt(tx: number, ty: number, navMesh: NavMesh): number;
|
|
102
103
|
destroy(): void;
|
|
103
104
|
}
|
|
104
105
|
export declare class TileCacheMeshProcess {
|
|
105
106
|
raw: R.TileCacheMeshProcess;
|
|
106
|
-
constructor(process: (navMeshCreateParams: NavMeshCreateParams, polyAreasArray:
|
|
107
|
+
constructor(process: (navMeshCreateParams: NavMeshCreateParams, polyAreasArray: UnsignedCharArray, polyFlagsArray: UnsignedShortArray) => void);
|
|
107
108
|
}
|
|
108
|
-
export declare const buildTileCacheLayer: (comp: R.RecastFastLZCompressor, header: R.dtTileCacheLayerHeader, heights:
|
|
109
|
+
export declare const buildTileCacheLayer: (comp: R.RecastFastLZCompressor, header: R.dtTileCacheLayerHeader, heights: UnsignedCharArray, areas: UnsignedCharArray, cons: UnsignedCharArray, tileCacheData: UnsignedCharArray) => number;
|
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.26.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"homepage": "https://github.com/isaac-mason/recast-navigation-js",
|
|
12
12
|
"bugs": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"lint": "eslint --ext .ts src"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@recast-navigation/wasm": "0.
|
|
29
|
+
"@recast-navigation/wasm": "0.26.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@babel/core": "^7.24.4",
|