@recast-navigation/core 0.23.0 → 0.24.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.
@@ -124,9 +124,12 @@ export declare class NavMeshQuery {
124
124
  posOverPoly: boolean;
125
125
  };
126
126
  /**
127
- * Returns the closest point on the NavMesh to the given position.
127
+ * Finds the closest point on the NavMesh to the given position.
128
+ * @param position the position to find the closest point to
129
+ * @param options additional options
130
+ * @returns the result of the find closest point operation
128
131
  */
129
- getClosestPoint(position: Vector3, options?: {
132
+ findClosestPoint(position: Vector3, options?: {
130
133
  /**
131
134
  * The polygon filter to apply to the query.
132
135
  * @default this.defaultFilter
@@ -137,11 +140,30 @@ export declare class NavMeshQuery {
137
140
  * @default this.defaultQueryHalfExtents
138
141
  */
139
142
  halfExtents?: Vector3;
140
- }): Vector3;
143
+ }): {
144
+ success: boolean;
145
+ status: number;
146
+ polyRef: number;
147
+ point: {
148
+ x: number;
149
+ y: number;
150
+ z: number;
151
+ };
152
+ isPointOverPoly: boolean;
153
+ };
141
154
  /**
142
155
  * Returns a random point on the NavMesh within the given radius of the given position.
156
+ *
157
+ * @param position the center of the search circle
158
+ * @param radius the radius of the search circle
159
+ * @param options additional options
143
160
  */
144
- getRandomPointAround(position: Vector3, radius: number, options?: {
161
+ findRandomPointAroundCircle(position: Vector3, radius: number, options?: {
162
+ /**
163
+ * The reference id of the polygon to start the search from.
164
+ * If not provided, the nearest polygon to the position will be used.
165
+ */
166
+ startRef?: number;
145
167
  /**
146
168
  * The polygon filter to apply to the query.
147
169
  * @default this.defaultFilter
@@ -152,13 +174,18 @@ export declare class NavMeshQuery {
152
174
  * @default this.defaultQueryHalfExtents
153
175
  */
154
176
  halfExtents?: Vector3;
155
- }): Vector3;
177
+ }): {
178
+ success: boolean;
179
+ status: number;
180
+ randomPolyRef: number;
181
+ randomPoint: Vector3;
182
+ };
156
183
  /**
157
184
  * Moves from the start to the end position constrained to the navigation mesh.
158
185
  *
159
- * @param startRef The reference id of the start polygon.
160
- * @param startPosition A position of the mover within the start polygon.
161
- * @param endPosition The desired end position of the mover.
186
+ * @param startRef the reference id of the start polygon.
187
+ * @param startPosition a position of the mover within the start polygon.
188
+ * @param endPosition the desired end position of the mover.
162
189
  *
163
190
  * @returns The result of the move along surface operation.
164
191
  */
@@ -207,8 +234,8 @@ export declare class NavMeshQuery {
207
234
  /**
208
235
  * Gets the height of the polygon at the provided position using the height detail.
209
236
  *
210
- * @param polyRef The reference id of the polygon.
211
- * @param position A position within the xz-bounds of the polygon.
237
+ * @param polyRef the reference id of the polygon.
238
+ * @param position a position within the xz-bounds of the polygon.
212
239
  */
213
240
  getPolyHeight(polyRef: number, position: Vector3): {
214
241
  success: boolean;
@@ -218,8 +245,9 @@ export declare class NavMeshQuery {
218
245
  /**
219
246
  * Finds a straight path from the start position to the end position.
220
247
  *
221
- * @param start The start position.
222
- * @param end The end position.
248
+ * @param start the start position
249
+ * @param end the end position
250
+ * @param options additional options
223
251
  *
224
252
  * @returns an array of Vector3 positions that make up the path, or an empty array if no path was found.
225
253
  */
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.23.0",
9
+ "version": "0.24.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.23.0"
29
+ "@recast-navigation/wasm": "0.24.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@babel/core": "^7.24.4",