@recast-navigation/core 0.15.1 → 0.16.1

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,6 +1,16 @@
1
1
  import { NavMesh } from './nav-mesh';
2
2
  import type R from './raw-module';
3
3
  import { Vector3 } from './utils';
4
+ export declare class QueryFilter {
5
+ raw: R.dtQueryFilter;
6
+ get includeFlags(): number;
7
+ set includeFlags(flags: number);
8
+ get excludeFlags(): number;
9
+ set excludeFlags(flags: number);
10
+ constructor(raw?: R.dtQueryFilter);
11
+ getAreaCost(i: number): number;
12
+ setAreaCost(i: number, cost: number): void;
13
+ }
4
14
  export type NavMeshQueryParams = {
5
15
  navMesh: NavMesh;
6
16
  /**
@@ -10,7 +20,7 @@ export type NavMeshQueryParams = {
10
20
  };
11
21
  export declare class NavMeshQuery {
12
22
  raw: R.NavMeshQuery;
13
- defaultFilter: R.dtQueryFilter;
23
+ defaultFilter: QueryFilter;
14
24
  defaultQueryHalfExtents: {
15
25
  x: number;
16
26
  y: number;
@@ -21,7 +31,7 @@ export declare class NavMeshQuery {
21
31
  * Finds the polygon nearest to the given position.
22
32
  */
23
33
  findNearestPoly(position: Vector3, options?: {
24
- filter?: R.dtQueryFilter;
34
+ filter?: QueryFilter;
25
35
  halfExtents?: Vector3;
26
36
  }): {
27
37
  success: boolean;
@@ -51,21 +61,21 @@ export declare class NavMeshQuery {
51
61
  * Returns the closest point on the NavMesh to the given position.
52
62
  */
53
63
  getClosestPoint(position: Vector3, options?: {
54
- filter?: R.dtQueryFilter;
64
+ filter?: QueryFilter;
55
65
  halfExtents?: Vector3;
56
66
  }): Vector3;
57
67
  /**
58
68
  * Returns a random point on the NavMesh within the given radius of the given position.
59
69
  */
60
70
  getRandomPointAround(position: Vector3, radius: number, options?: {
61
- filter?: R.dtQueryFilter;
71
+ filter?: QueryFilter;
62
72
  halfExtents?: Vector3;
63
73
  }): Vector3;
64
74
  /**
65
75
  * Moves from the start to the end position constrained to the navigation mesh.
66
76
  */
67
77
  moveAlongSurface(startRef: number, startPosition: Vector3, endPosition: Vector3, options?: {
68
- filter?: R.dtQueryFilter;
78
+ filter?: QueryFilter;
69
79
  maxVisitedSize?: number;
70
80
  }): {
71
81
  success: boolean;
@@ -91,7 +101,7 @@ export declare class NavMeshQuery {
91
101
  * @returns an array of Vector3 positions that make up the path, or an empty array if no path was found.
92
102
  */
93
103
  computePath(start: Vector3, end: Vector3, options?: {
94
- filter?: R.dtQueryFilter;
104
+ filter?: QueryFilter;
95
105
  maxPolyPathLength?: number;
96
106
  }): Vector3[];
97
107
  /**
package/dist/raw.d.ts CHANGED
@@ -5,6 +5,11 @@ export declare const Arrays: {
5
5
  UnsignedCharArray: typeof RawModule.UnsignedCharArray;
6
6
  UnsignedShortArray: typeof RawModule.UnsignedShortArray;
7
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;
8
13
  };
9
14
  /**
10
15
  * Lower level bindings for the Recast and Detour libraries.
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.15.1",
9
+ "version": "0.16.1",
10
10
  "license": "MIT",
11
11
  "homepage": "https://github.com/isaac-mason/recast-navigation-js",
12
12
  "bugs": {
@@ -21,10 +21,11 @@
21
21
  "LICENSE"
22
22
  ],
23
23
  "scripts": {
24
+ "test": "tsc",
24
25
  "build": "rollup --config rollup.config.js --bundleConfigAsCjs"
25
26
  },
26
27
  "dependencies": {
27
- "@recast-navigation/wasm": "0.15.1"
28
+ "@recast-navigation/wasm": "0.16.1"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@babel/core": "^7.22.11",
@@ -32,7 +33,7 @@
32
33
  "@rollup/plugin-node-resolve": "^15.0.1",
33
34
  "@rollup/plugin-terser": "^0.4.3",
34
35
  "@rollup/plugin-typescript": "^11.1.5",
35
- "@types/three": "^0.155.0",
36
+ "@types/three": "^0.159.0",
36
37
  "@typescript-eslint/eslint-plugin": "^6.10.0",
37
38
  "@typescript-eslint/parser": "^6.7.3",
38
39
  "babel-loader": "^9.1.3",
@@ -46,11 +47,11 @@
46
47
  "eslint-plugin-prettier": "^5.0.1",
47
48
  "eslint-plugin-simple-import-sort": "^10.0.0",
48
49
  "eslint-plugin-typescript-enum": "^2.1.0",
49
- "prettier": "^3.0.2",
50
- "rollup": "^3.26.3",
50
+ "prettier": "^3.1.0",
51
+ "rollup": "^4.6.0",
51
52
  "rollup-plugin-copy": "^3.4.0",
52
53
  "rollup-plugin-filesize": "^10.0.0",
53
- "typescript": "^5.1.6"
54
+ "typescript": "^5.3.2"
54
55
  },
55
56
  "packageManager": "yarn@3.2.1"
56
57
  }