@recast-navigation/core 0.20.0 → 0.22.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.
@@ -31,7 +31,13 @@ export declare class NavMeshQuery {
31
31
  * Finds the polygon nearest to the given position.
32
32
  */
33
33
  findNearestPoly(position: Vector3, options?: {
34
+ /**
35
+ * The polygon filter to apply to the query.
36
+ */
34
37
  filter?: QueryFilter;
38
+ /**
39
+ * The search distance along each axis. [(x, y, z)]
40
+ */
35
41
  halfExtents?: Vector3;
36
42
  }): {
37
43
  success: boolean;
@@ -90,21 +96,39 @@ export declare class NavMeshQuery {
90
96
  * Returns the closest point on the NavMesh to the given position.
91
97
  */
92
98
  getClosestPoint(position: Vector3, options?: {
99
+ /**
100
+ * The polygon filter to apply to the query.
101
+ */
93
102
  filter?: QueryFilter;
103
+ /**
104
+ * The search distance along each axis. [(x, y, z)]
105
+ */
94
106
  halfExtents?: Vector3;
95
107
  }): Vector3;
96
108
  /**
97
109
  * Returns a random point on the NavMesh within the given radius of the given position.
98
110
  */
99
111
  getRandomPointAround(position: Vector3, radius: number, options?: {
112
+ /**
113
+ * The polygon filter to apply to the query.
114
+ */
100
115
  filter?: QueryFilter;
116
+ /**
117
+ * The search distance along each axis. [(x, y, z)]
118
+ */
101
119
  halfExtents?: Vector3;
102
120
  }): Vector3;
103
121
  /**
104
122
  * Moves from the start to the end position constrained to the navigation mesh.
105
123
  */
106
124
  moveAlongSurface(startRef: number, startPosition: Vector3, endPosition: Vector3, options?: {
125
+ /**
126
+ * The polygon filter to apply to the query.
127
+ */
107
128
  filter?: QueryFilter;
129
+ /**
130
+ * The maximum number of polygons the output visited array can hold.
131
+ */
108
132
  maxVisitedSize?: number;
109
133
  }): {
110
134
  success: boolean;
@@ -130,8 +154,18 @@ export declare class NavMeshQuery {
130
154
  * @returns an array of Vector3 positions that make up the path, or an empty array if no path was found.
131
155
  */
132
156
  computePath(start: Vector3, end: Vector3, options?: {
157
+ /**
158
+ * The polygon filter to apply to the query.
159
+ */
133
160
  filter?: QueryFilter;
134
- maxPolyPathLength?: number;
161
+ /**
162
+ * The maximum number of polygons the @p path array can hold. [Limit: >= 1]
163
+ */
164
+ maxPathPolys?: number;
165
+ /**
166
+ * The maximum number of points the straight path arrays can hold. [Limit: > 0]
167
+ */
168
+ maxStraightPathPoints?: number;
135
169
  }): Vector3[];
136
170
  /**
137
171
  * Destroys the NavMeshQuery instance
@@ -32,6 +32,20 @@ export declare class NavMeshStoreTileStateResult {
32
32
  data(): number[];
33
33
  dataSize(): number;
34
34
  }
35
+ export type NavMeshDecodePolyIdResult = {
36
+ /**
37
+ * The tile's salt value.
38
+ */
39
+ tileSalt: number;
40
+ /**
41
+ * The index of the tile. `it` in the C++ api.
42
+ */
43
+ tileIndex: number;
44
+ /**
45
+ * The index of the polygon within the tile. `ip` in the C++ api.
46
+ */
47
+ tilePolygonIndex: number;
48
+ };
35
49
  export type NavMeshParamsType = {
36
50
  orig: Vector3;
37
51
  tileWidth: number;
@@ -71,6 +85,20 @@ export declare class NavMesh {
71
85
  status: number;
72
86
  tileRef: number;
73
87
  };
88
+ /**
89
+ * Decodes a standard polygon reference.
90
+ * @param polyRef The polygon reference to decode
91
+ * @returns the decoded polygon reference
92
+ */
93
+ decodePolyId(polyRef: number): NavMeshDecodePolyIdResult;
94
+ /**
95
+ * Derives a standard polygon reference.
96
+ * @param salt The tile's salt value.
97
+ * @param tileIndex The index of the tile. `it` in the C++ api.
98
+ * @param tilePolygonIndex The index of the polygon within the tile. `ip` in the C++ api.
99
+ * @returns the derived polygon reference
100
+ */
101
+ encodePolyId(salt: number, tileIndex: number, tilePolygonIndex: number): number;
74
102
  /**
75
103
  * Removes a tile from the NavMesh
76
104
  * @param ref the tile ref
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.20.0",
9
+ "version": "0.22.0",
10
10
  "license": "MIT",
11
11
  "homepage": "https://github.com/isaac-mason/recast-navigation-js",
12
12
  "bugs": {
@@ -26,10 +26,10 @@
26
26
  "lint": "eslint --ext .ts src"
27
27
  },
28
28
  "dependencies": {
29
- "@recast-navigation/wasm": "0.20.0"
29
+ "@recast-navigation/wasm": "0.22.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@babel/core": "^7.23.9",
32
+ "@babel/core": "^7.24.4",
33
33
  "@isaac-mason/eslint-config-typescript": "^0.0.5",
34
34
  "@rollup/plugin-commonjs": "^25.0.7",
35
35
  "@rollup/plugin-node-resolve": "^15.0.1",