@recast-navigation/core 0.39.0 → 0.40.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.
@@ -39,5 +39,6 @@ export declare class DebugDrawerUtils {
39
39
  * Disposes of the debug drawer and releases resources.
40
40
  */
41
41
  dispose(): void;
42
+ private rgbToDuRgba;
42
43
  private vertex;
43
44
  }
package/dist/index.mjs CHANGED
@@ -1898,11 +1898,11 @@ class DebugDrawerUtils {
1898
1898
  return this.flush();
1899
1899
  }
1900
1900
  drawNavMeshPolysWithFlags(mesh, flags, col) {
1901
- Raw.DetourDebugDraw.debugDrawNavMeshPolysWithFlags(this.debugDrawImpl, mesh.raw.m_navMesh, flags, col);
1901
+ Raw.DetourDebugDraw.debugDrawNavMeshPolysWithFlags(this.debugDrawImpl, mesh.raw.m_navMesh, flags, this.rgbToDuRgba(col));
1902
1902
  return this.flush();
1903
1903
  }
1904
1904
  drawNavMeshPoly(mesh, ref, col) {
1905
- Raw.DetourDebugDraw.debugDrawNavMeshPoly(this.debugDrawImpl, mesh.raw.m_navMesh, ref, col);
1905
+ Raw.DetourDebugDraw.debugDrawNavMeshPoly(this.debugDrawImpl, mesh.raw.m_navMesh, ref, this.rgbToDuRgba(col));
1906
1906
  return this.flush();
1907
1907
  }
1908
1908
  /**
@@ -1911,10 +1911,17 @@ class DebugDrawerUtils {
1911
1911
  dispose() {
1912
1912
  Raw.Module.destroy(this.debugDrawImpl);
1913
1913
  }
1914
+ rgbToDuRgba(color) {
1915
+ // convert hexadecimal rgb color to duRGBA format
1916
+ const r = color & 0xff;
1917
+ const g = color >> 8 & 0xff;
1918
+ const b = color >> 16 & 0xff;
1919
+ return r | g << 8 | b << 16 | 255 << 24;
1920
+ }
1914
1921
  vertex(x, y, z, color) {
1915
- const r = (color >> 16 & 0xff) / 255;
1922
+ const r = (color & 0xff) / 255;
1916
1923
  const g = (color >> 8 & 0xff) / 255;
1917
- const b = (color & 0xff) / 255;
1924
+ const b = (color >> 16 & 0xff) / 255;
1918
1925
  const a = (color >> 24 & 0xff) / 255;
1919
1926
  this.currentVertices.push([x, y, z, r, g, b, a]);
1920
1927
  }
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.39.0",
9
+ "version": "0.40.0",
10
10
  "license": "MIT",
11
11
  "homepage": "https://github.com/isaac-mason/recast-navigation-js",
12
12
  "bugs": {
@@ -27,7 +27,7 @@
27
27
  "lint": "eslint src"
28
28
  },
29
29
  "dependencies": {
30
- "@recast-navigation/wasm": "0.39.0"
30
+ "@recast-navigation/wasm": "0.40.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@babel/core": "^7.24.5",