@onerjs/addons 8.51.2 → 8.51.3

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.
@@ -123,7 +123,7 @@ export class NavigationDebugger {
123
123
  this.triMaterial = materials.triMaterial;
124
124
  }
125
125
  else {
126
- this.triMaterial = new StandardMaterial("nav-debug-tris-material");
126
+ this.triMaterial = new StandardMaterial("nav-debug-tris-material", this._scene);
127
127
  this.triMaterial.backFaceCulling = false;
128
128
  this.triMaterial.specularColor = Color3.Black();
129
129
  this.triMaterial.alpha = 0.5;
@@ -132,7 +132,7 @@ export class NavigationDebugger {
132
132
  this.pointMaterial = materials.pointMaterial;
133
133
  }
134
134
  else {
135
- this.pointMaterial = new StandardMaterial("nav-debug-points-material");
135
+ this.pointMaterial = new StandardMaterial("nav-debug-points-material", this._scene);
136
136
  this.pointMaterial.backFaceCulling = false;
137
137
  this.pointMaterial.specularColor = Color3.Black();
138
138
  }
@@ -148,7 +148,7 @@ export class NavigationDebugger {
148
148
  greasedLineMeshOptions: {},
149
149
  };
150
150
  }
151
- this._pointMesh = CreateBox(NavigationDebugger.NAV_MESH_DEBUG_NAME_POINTS, { size: 0.02 });
151
+ this._pointMesh = CreateBox(NavigationDebugger.NAV_MESH_DEBUG_NAME_POINTS, { size: 0.02 }, this._scene);
152
152
  }
153
153
  /**
154
154
  * Resets the debug drawer by disposing of all child meshes in the debug drawer parent node.
@@ -474,7 +474,7 @@ export class NavigationDebugger {
474
474
  }
475
475
  const options = { ...this._lineMaterialOptions.greasedLineMeshOptions, points, instance: instance ?? undefined };
476
476
  const materialOptions = { ...this._lineMaterialOptions.greasedLineMaterialOptions, colors };
477
- const lines = CreateGreasedLine(NavigationDebugger.NAV_MESH_DEBUG_NAME_LINES, options, materialOptions);
477
+ const lines = CreateGreasedLine(NavigationDebugger.NAV_MESH_DEBUG_NAME_LINES, options, materialOptions, this._scene);
478
478
  lines.parent = this.debugDrawerParentNode;
479
479
  this.lineMaterials.push(lines.material);
480
480
  return lines;
@@ -498,7 +498,7 @@ export class NavigationDebugger {
498
498
  const vertexData = new VertexData();
499
499
  vertexData.positions = positions;
500
500
  vertexData.colors = colors;
501
- const customMesh = new Mesh(NavigationDebugger.NAV_MESH_DEBUG_NAME_TRIS);
501
+ const customMesh = new Mesh(NavigationDebugger.NAV_MESH_DEBUG_NAME_TRIS, this._scene);
502
502
  customMesh.isUnIndexed = true;
503
503
  vertexData.applyToMesh(customMesh);
504
504
  customMesh.material = this.triMaterial;
@@ -527,7 +527,7 @@ export class NavigationDebugger {
527
527
  const vertexData = new VertexData();
528
528
  vertexData.positions = positions;
529
529
  vertexData.colors = colors;
530
- const customMesh = new Mesh(NavigationDebugger.NAV_MESH_DEBUG_NAME_QUADS);
530
+ const customMesh = new Mesh(NavigationDebugger.NAV_MESH_DEBUG_NAME_QUADS, this._scene);
531
531
  customMesh.isUnIndexed = true;
532
532
  vertexData.applyToMesh(customMesh);
533
533
  customMesh.material = this.triMaterial;
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationDebugger.js","sourceRoot":"","sources":["../../../../../dev/addons/src/navigation/debug/NavigationDebugger.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,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AED,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QACzC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAEjE,MAAM,aAAa,GAAG,IAAI,UAAU,EAAE,CAAC;QACvC,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC;QACpC,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC;QAEhC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;;AA9pBD;;;GAGG;AACW,sCAAmB,GAAG,gBAAgB,AAAnB,CAAoB;AAErD;;GAEG;AACW,6CAA0B,GAAG,uBAAuB,AAA1B,CAA2B;AAEnE;;GAEG;AACW,2CAAwB,GAAG,qBAAqB,AAAxB,CAAyB;AAE/D;;GAEG;AACW,4CAAyB,GAAG,sBAAsB,AAAzB,CAA0B;AAEjE;;GAEG;AACW,4CAAyB,GAAG,sBAAsB,AAAzB,CAA0B","sourcesContent":["import {\n type DebugDrawerPrimitive,\n type DebugDrawerPrimitiveType,\n type NavMesh,\n type NavMeshQuery,\n type RecastCompactHeightfield,\n type RecastContourSet,\n type RecastHeightfield,\n type RecastHeightfieldLayer,\n type RecastHeightfieldLayerSet,\n type RecastPolyMesh,\n type RecastPolyMeshDetail,\n type DebugDrawerUtils,\n} from \"@recast-navigation/core\";\n\nimport { type GreasedLineMaterialOptions } from \"core/Materials/GreasedLine/greasedLineMaterialInterfaces\";\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\nimport { Color3 } from \"core/Maths/math.color\";\nimport { Matrix } from \"core/Maths/math.vector\";\nimport { CreateGreasedLine } from \"core/Meshes/Builders/greasedLineBuilder\";\nimport { type GreasedLineBaseMesh, type GreasedLineMeshOptions } from \"core/Meshes/GreasedLine/greasedLineBaseMesh\";\nimport { Mesh } from \"core/Meshes/mesh\";\nimport { VertexData } from \"core/Meshes/mesh.vertexData\";\nimport { TransformNode } from \"core/Meshes/transformNode\";\nimport { type Scene } from \"core/scene\";\nimport { type Nullable } from \"core/types\";\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\nimport { Logger } from \"core/Misc/logger\";\n\nimport { type GeneratorIntermediates } from \"../types\";\nimport { GetRecast } from \"../factory/common\";\n\n// TODO: Enum?\nexport const DebugLayerOption = {\n HEIGHTFIELD_SOLID: \"heightfield solid\",\n HEIGHTFIELD_WALKABLE: \"heightfield walkable\",\n COMPACT_HEIGHTFIELD_SOLID: \"compact heightfield solid\",\n COMPACT_HEIGHTFIELD_REGIONS: \"compact heightfield regions\",\n COMPACT_HEIGHTFIELD_DISTANCE: \"compact heightfield distance\",\n RAW_CONTOURS: \"raw contours\",\n CONTOURS: \"contours\",\n POLY_MESH: \"poly mesh\",\n POLY_MESH_DETAIL: \"poly mesh detail\",\n NAVMESH: \"navmesh\",\n NAVMESH_BV_TREE: \"navmesh bv tree\",\n};\n\nexport type DebugLayerOptions = (typeof DebugLayerOption)[keyof typeof DebugLayerOption];\n\n/**\n * NavigationDebugger is a utility class for visualizing navigation meshes and related data in a Babylon.js scene.\n * It provides methods to draw various navigation-related primitives such as points, lines, triangles, and quads.\n * It also supports drawing heightfields, compact heightfields, contours, poly meshes, and nav meshes.\n */\nexport class NavigationDebugger {\n /**\n * The name of the debug mesh used for navigation debugging.\n * This is used to group all navigation debug meshes under a single name for easier management\n */\n public static NAV_MESH_DEBUG_NAME = \"nav-mesh-debug\";\n\n /**\n * The name of the debug mesh used for visualization of the navigation mesh using points.\n */\n public static NAV_MESH_DEBUG_NAME_POINTS = \"nav-mesh-debug-points\";\n\n /**\n * The name of the debug mesh used for visualization of the navigation mesh using triangles.\n */\n public static NAV_MESH_DEBUG_NAME_TRIS = \"nav-mesh-debug-tris\";\n\n /**\n * The name of the debug mesh used for visualization of the navigation mesh using quads.\n */\n public static NAV_MESH_DEBUG_NAME_QUADS = \"nav-mesh-debug-quads\";\n\n /**\n * The name of the debug mesh used for visualization of the navigation mesh using lines.\n */\n public static NAV_MESH_DEBUG_NAME_LINES = \"nav-mesh-debug-lines\";\n\n /**\n * The material used for rendering triangles in the navigation debug visualization.\n */\n public triMaterial: StandardMaterial;\n /**\n * The material used for rendering points in the navigation debug visualization.\n */\n public pointMaterial: StandardMaterial;\n\n /**\n * The list of line materials used in the navigation debug visualization.\n */\n public lineMaterials: StandardMaterial[] = [];\n\n /**\n * The parent node for the debug drawer.\n */\n public debugDrawerParentNode: TransformNode;\n\n /**\n * * Gets or sets the primitive types to be drawn by the debug drawer.\n * * This allows you to control which types of primitives (points, lines, tris, quads) are rendered in the navigation debug visualization.\n * * The default value is `[\"points\", \"lines\", \"tris\", \"quads\"]`.\n * * You can modify this property to include or exclude specific primitive types based on your debugging needs.\n * @returns An array of primitive types that the debug drawer will render.\n */\n public get primitiveTypes(): DebugDrawerPrimitiveType[] {\n return this._primitiveTypes;\n }\n\n public set primitiveTypes(value: DebugDrawerPrimitiveType[]) {\n this._primitiveTypes = value;\n }\n\n private _lineMaterialOptions: {\n greasedLineMaterialOptions: Partial<GreasedLineMaterialOptions>;\n greasedLineMeshOptions: Partial<GreasedLineMeshOptions>;\n };\n private _pointMesh: Mesh;\n private _debugDrawerUtils: DebugDrawerUtils;\n private _primitiveTypes: DebugDrawerPrimitiveType[];\n\n constructor(\n private _scene: Scene,\n options?: {\n parent?: {\n node?: TransformNode | string;\n };\n primitiveTypes?: DebugDrawerPrimitiveType[];\n materials?: {\n triMaterial?: StandardMaterial;\n pointMaterial?: StandardMaterial;\n lineMaterialOptions: {\n greasedLineMaterialOptions: Partial<GreasedLineMaterialOptions>;\n greasedLineMeshOptions: Partial<GreasedLineMeshOptions>;\n };\n };\n }\n ) {\n this._debugDrawerUtils = new (GetRecast().DebugDrawerUtils)();\n\n this._primitiveTypes = options?.primitiveTypes ?? [\"points\", \"lines\", \"tris\", \"quads\"];\n\n this.debugDrawerParentNode =\n options?.parent?.node instanceof TransformNode ? options.parent.node : new TransformNode((options?.parent?.node as string) ?? \"nav-mesh-debug-parent\", this._scene);\n\n const materials = options?.materials;\n if (materials?.triMaterial) {\n this.triMaterial = materials.triMaterial;\n } else {\n this.triMaterial = new StandardMaterial(\"nav-debug-tris-material\");\n this.triMaterial.backFaceCulling = false;\n this.triMaterial.specularColor = Color3.Black();\n this.triMaterial.alpha = 0.5;\n }\n\n if (materials?.pointMaterial) {\n this.pointMaterial = materials.pointMaterial;\n } else {\n this.pointMaterial = new StandardMaterial(\"nav-debug-points-material\");\n this.pointMaterial.backFaceCulling = false;\n this.pointMaterial.specularColor = Color3.Black();\n }\n\n if (materials?.lineMaterialOptions) {\n this._lineMaterialOptions = materials.lineMaterialOptions;\n } else {\n this._lineMaterialOptions = {\n greasedLineMaterialOptions: {\n width: 2,\n sizeAttenuation: true,\n },\n greasedLineMeshOptions: {},\n };\n }\n\n this._pointMesh = CreateBox(NavigationDebugger.NAV_MESH_DEBUG_NAME_POINTS, { size: 0.02 });\n }\n\n /**\n * Resets the debug drawer by disposing of all child meshes in the debug drawer parent node.\n * This is useful for clearing the debug visualization before drawing new primitives.\n */\n public clear() {\n for (const child of this.debugDrawerParentNode.getChildMeshes()) {\n child.dispose();\n }\n }\n\n /**\n * Disposes of the debug drawer, including all meshes and materials used for rendering.\n * This method should be called when the debug drawer is no longer needed to free up resources.\n */\n public dispose() {\n this.clear();\n this._debugDrawerUtils.dispose();\n this._pointMesh.dispose();\n this.triMaterial.dispose();\n this.pointMaterial.dispose();\n }\n\n /**\n * This method iterates through the provided primitives and draws them based on their type.\n * It supports drawing points, lines, triangles, and quads, depending on the primitive type.\n * @param primitives An array of debug drawer primitives to be drawn.\n * @param options Optional parameters to control the drawing behavior, such as whether to join meshes.\n */\n public drawPrimitives(primitives: DebugDrawerPrimitive[], options?: { joinMeshes?: boolean }) {\n let linesInstance = null;\n\n for (const primitive of primitives) {\n // draw only the primitives that are in the primitiveTypes array\n if (!this._primitiveTypes.includes(primitive.type)) {\n continue;\n }\n\n switch (primitive.type) {\n case \"points\":\n this._drawPoints(primitive);\n break;\n case \"lines\": {\n const line = this._drawLines(primitive, linesInstance);\n if (!linesInstance) {\n linesInstance = line;\n }\n break;\n }\n case \"tris\":\n this._drawTris(primitive);\n break;\n case \"quads\":\n this._drawQuads(primitive);\n break;\n }\n }\n\n linesInstance?.updateLazy();\n\n if (options?.joinMeshes ?? true) {\n // Join the debug meshes into a single mesh for better performance\n this._joinDebugMeshes();\n }\n }\n\n /**\n * Draws a heightfield as solid using the debug drawer utilities.\n * @param hf The heightfield to draw as solid.\n */\n public drawHeightfieldSolid(hf: RecastHeightfield): void {\n const primitives = this._debugDrawerUtils.drawHeightfieldSolid(hf);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a heightfield as walkable using the debug drawer utilities.\n * @param hf The heightfield to draw as walkable.\n */\n public drawHeightfieldWalkable(hf: RecastHeightfield): void {\n const primitives = this._debugDrawerUtils.drawHeightfieldWalkable(hf);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a compact heightfield as solid using the debug drawer utilities.\n * @param chf The compact heightfield to draw as solid.\n */\n public drawCompactHeightfieldSolid(chf: RecastCompactHeightfield): void {\n const primitives = this._debugDrawerUtils.drawCompactHeightfieldSolid(chf);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the regions of a compact heightfield using the debug drawer utilities.\n * @param chf The compact heightfield to draw regions for.\n */\n public drawCompactHeightfieldRegions(chf: RecastCompactHeightfield): void {\n const primitives = this._debugDrawerUtils.drawCompactHeightfieldRegions(chf);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the distance field of a compact heightfield using the debug drawer utilities.\n * @param chf The compact heightfield to draw the distance for.\n */\n public drawCompactHeightfieldDistance(chf: RecastCompactHeightfield): void {\n const primitives = this._debugDrawerUtils.drawCompactHeightfieldDistance(chf);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a heightfield layer using the debug drawer utilities.\n * @param layer The heightfield layer to draw.\n * @param idx The index of the layer to draw.\n */\n public drawHeightfieldLayer(layer: RecastHeightfieldLayer, idx: number): void {\n const primitives = this._debugDrawerUtils.drawHeightfieldLayer(layer, idx);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the layers of a heightfield using the debug drawer utilities.\n * @param lset The heightfield layer set containing the layers to draw.\n */\n public drawHeightfieldLayers(lset: RecastHeightfieldLayerSet): void {\n const primitives = this._debugDrawerUtils.drawHeightfieldLayers(lset);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the region connections of a RecastContourSet using the debug drawer utilities.\n * @param cset RecastContourSet to draw\n * @param alpha The alpha value for the drawn contours, default is 1.\n */\n public drawRegionConnections(cset: RecastContourSet, alpha: number = 1): void {\n const primitives = this._debugDrawerUtils.drawRegionConnections(cset, alpha);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws raw contours from a RecastContourSet using the debug drawer utilities.\n * @param cset RecastContourSet to draw\n * @param alpha The alpha value for the drawn contours, default is 1.\n */\n public drawRawContours(cset: RecastContourSet, alpha: number = 1): void {\n const primitives = this._debugDrawerUtils.drawRawContours(cset, alpha);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws contours from a RecastContourSet using the debug drawer utilities.\n * @param cset RecastContourSet to draw\n * @param alpha The alpha value for the drawn contours, default is 1.\n */\n public drawContours(cset: RecastContourSet, alpha: number = 1): void {\n const primitives = this._debugDrawerUtils.drawContours(cset, alpha);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a poly mesh using the debug drawer utilities.\n * @param mesh RecastPolyMesh to draw\n */\n public drawPolyMesh(mesh: RecastPolyMesh): void {\n const primitives = this._debugDrawerUtils.drawPolyMesh(mesh);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a poly mesh detail using the debug drawer utilities.\n * @param dmesh RecastPolyMeshDetail to draw\n */\n public drawPolyMeshDetail(dmesh: RecastPolyMeshDetail): void {\n const primitives = this._debugDrawerUtils.drawPolyMeshDetail(dmesh);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a NavMesh using the debug drawer utilities.\n * @param mesh NavMesh to draw\n * @param flags Flags to control the drawing behavior, default is 0.\n */\n public drawNavMesh(mesh: NavMesh, flags: number = 0): void {\n const primitives = this._debugDrawerUtils.drawNavMesh(mesh, flags);\n this.drawPrimitives(primitives);\n }\n\n // todo:\n // - drawTileCacheLayerAreas\n // - drawTileCacheLayerRegions\n // - drawTileCacheContours\n // - drawTileCachePolyMesh\n\n /**\n * Draws a NavMesh with closed list using the debug drawer utilities.\n * @param mesh NavMesh to draw\n * @param query NavMeshQuery to use for drawing the closed list.\n * @param flags Flags to control the drawing behavior, default is 0.\n */\n public drawNavMeshWithClosedList(mesh: NavMesh, query: NavMeshQuery, flags: number = 0): void {\n const primitives = this._debugDrawerUtils.drawNavMeshWithClosedList(mesh, query, flags);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the nodes of a NavMesh using the debug drawer utilities.\n * @param query NavMeshQuery to use for drawing the nodes.\n */\n public drawNavMeshNodes(query: NavMeshQuery): void {\n const primitives = this._debugDrawerUtils.drawNavMeshNodes(query);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the bounding volume tree of a NavMesh using the debug drawer utilities.\n * @param mesh NavMesh to draw the bounding volume tree for.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public drawNavMeshBVTree(mesh: NavMesh): void {\n const primitives = this._debugDrawerUtils.drawNavMeshBVTree(mesh);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the portals of a NavMesh using the debug drawer utilities.\n * @param mesh NavMesh to draw the portals for.\n */\n public drawNavMeshPortals(mesh: NavMesh): void {\n const primitives = this._debugDrawerUtils.drawNavMeshPortals(mesh);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws polygons of a NavMesh with specific flags using the debug drawer utilities.\n * @param mesh NavMesh to draw the polygons with specific flags.\n * @param flags The flags to filter the polygons to be drawn.\n * @param col The color to use for the drawn polygons, represented as a number.\n */\n public drawNavMeshPolysWithFlags(mesh: NavMesh, flags: number, col: number): void {\n const primitives = this._debugDrawerUtils.drawNavMeshPolysWithFlags(mesh, flags, col);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws polygons of a NavMesh with specific reference and color using the debug drawer utilities.\n * @param mesh NavMesh to draw the polygons with specific reference and color.\n * @param ref The reference number of the polygons to be drawn.\n * @param col The color to use for the drawn polygons, represented as a number.\n */\n public drawNavMeshPoly(mesh: NavMesh, ref: number, col: number): void {\n const primitives = this._debugDrawerUtils.drawNavMeshPoly(mesh, ref, col);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Get the intermediates from the generator\n * @param intermediates - The generator intermediates\n * @returns An object containing lists of heightfields, compact heightfields, contour sets\n */\n public getIntermediates = (intermediates: GeneratorIntermediates) => {\n const heightfieldList: RecastHeightfield[] = [];\n const compactHeightfieldList: RecastCompactHeightfield[] = [];\n const contourSetList: RecastContourSet[] = [];\n const polyMeshList: RecastPolyMesh[] = [];\n const polyMeshDetailList: RecastPolyMeshDetail[] = [];\n\n if (intermediates) {\n if (intermediates.type === \"solo\") {\n if (intermediates.heightfield) {\n heightfieldList.push(intermediates.heightfield);\n }\n\n if (intermediates.compactHeightfield) {\n compactHeightfieldList.push(intermediates.compactHeightfield);\n }\n\n if (intermediates.contourSet) {\n contourSetList.push(intermediates.contourSet);\n }\n\n if (intermediates.polyMesh) {\n polyMeshList.push(intermediates.polyMesh);\n }\n\n if (intermediates.polyMeshDetail) {\n polyMeshDetailList.push(intermediates.polyMeshDetail);\n }\n } else if (intermediates.type === \"tiled\") {\n for (const tile of intermediates.tileIntermediates) {\n if (tile.heightfield) {\n heightfieldList.push(tile.heightfield);\n }\n\n if (tile.compactHeightfield) {\n compactHeightfieldList.push(tile.compactHeightfield);\n }\n\n if (tile.contourSet) {\n contourSetList.push(tile.contourSet);\n }\n\n if (tile.polyMesh) {\n polyMeshList.push(tile.polyMesh);\n }\n\n if (tile.polyMeshDetail) {\n polyMeshDetailList.push(tile.polyMeshDetail);\n }\n }\n } else if (intermediates.type === \"tilecache\") {\n for (const tile of intermediates.tileIntermediates) {\n if (tile.heightfield) {\n heightfieldList.push(tile.heightfield);\n }\n\n if (tile.compactHeightfield) {\n compactHeightfieldList.push(tile.compactHeightfield);\n }\n }\n }\n }\n\n return {\n heightfieldList,\n compactHeightfieldList,\n contourSetList,\n polyMeshList,\n polyMeshDetailList,\n };\n };\n\n /**\n * Draw debug information based on the selected option\n * @param navMesh - The navigation mesh to draw\n * @param intermediates - The generator intermediates containing the data to draw\n * @param scene - The scene to draw in\n * @param option - The debug drawer option to use\n * @remarks This method will reset the debug drawer before drawing.\n */\n public draw(navMesh: NavMesh, intermediates: GeneratorIntermediates, scene: Scene, option: DebugLayerOptions) {\n this.clear();\n\n const { heightfieldList, compactHeightfieldList, contourSetList, polyMeshList, polyMeshDetailList } = this.getIntermediates(intermediates);\n\n if (option === DebugLayerOption.HEIGHTFIELD_SOLID) {\n for (const heightfield of heightfieldList) {\n this.drawHeightfieldSolid(heightfield);\n }\n } else if (option === DebugLayerOption.HEIGHTFIELD_WALKABLE) {\n for (const heightfield of heightfieldList) {\n this.drawHeightfieldWalkable(heightfield);\n }\n } else if (option === DebugLayerOption.COMPACT_HEIGHTFIELD_SOLID) {\n for (const compactHeightfield of compactHeightfieldList) {\n this.drawCompactHeightfieldSolid(compactHeightfield);\n }\n } else if (option === DebugLayerOption.COMPACT_HEIGHTFIELD_REGIONS) {\n for (const compactHeightfield of compactHeightfieldList) {\n this.drawCompactHeightfieldRegions(compactHeightfield);\n }\n } else if (option === DebugLayerOption.COMPACT_HEIGHTFIELD_DISTANCE) {\n for (const compactHeightfield of compactHeightfieldList) {\n this.drawCompactHeightfieldDistance(compactHeightfield);\n }\n } else if (option === DebugLayerOption.RAW_CONTOURS) {\n for (const contourSet of contourSetList) {\n this.drawRawContours(contourSet);\n }\n } else if (option === DebugLayerOption.CONTOURS) {\n for (const contourSet of contourSetList) {\n this.drawContours(contourSet);\n }\n } else if (option === DebugLayerOption.POLY_MESH) {\n for (const polyMesh of polyMeshList) {\n this.drawPolyMesh(polyMesh);\n }\n } else if (option === DebugLayerOption.POLY_MESH_DETAIL) {\n for (const polyMeshDetail of polyMeshDetailList) {\n this.drawPolyMeshDetail(polyMeshDetail);\n }\n } else if (option === DebugLayerOption.NAVMESH) {\n this.drawNavMesh(navMesh);\n } else if (option === DebugLayerOption.NAVMESH_BV_TREE) {\n this.drawNavMeshBVTree(navMesh);\n }\n }\n\n private _drawPoints(primitive: DebugDrawerPrimitive): void {\n if (primitive.vertices.length === 0) {\n return;\n }\n\n const matricesData = new Float32Array(16 * primitive.vertices.length);\n const colorData = new Float32Array(4 * primitive.vertices.length);\n\n for (let i = 0; i < primitive.vertices.length; i++) {\n const [x, y, z, r, g, b, a] = primitive.vertices[i];\n\n colorData[i * 4] = r;\n colorData[i * 4 + 1] = g;\n colorData[i * 4 + 2] = b;\n colorData[i * 4 + 3] = a;\n\n const matrix = Matrix.Translation(x, y, z);\n matrix.copyToArray(matricesData, i * 16);\n }\n\n this._pointMesh.thinInstanceSetBuffer(\"matrix\", matricesData, 16);\n this._pointMesh.thinInstanceSetBuffer(\"color\", colorData, 4);\n\n this._pointMesh.parent = this.debugDrawerParentNode;\n }\n\n private _drawLines(primitive: DebugDrawerPrimitive, instance: Nullable<GreasedLineBaseMesh>): Nullable<GreasedLineBaseMesh> {\n if (primitive.vertices.length === 0) {\n return null;\n }\n\n const points: number[][] = [];\n const colors: Color3[] = [];\n\n for (let i = 0; i < primitive.vertices.length; i += 2) {\n const [x1, y1, z1, r1, g1, b1] = primitive.vertices[i];\n const [x2, y2, z2, r2, g2, b2] = primitive.vertices[i + 1];\n\n points.push([x1, y1, z1, x2, y2, z2]);\n\n colors.push(new Color3(r1, g1, b1));\n colors.push(new Color3(r2, g2, b2));\n }\n\n const options = { ...this._lineMaterialOptions.greasedLineMeshOptions, points, instance: instance ?? undefined };\n const materialOptions = { ...this._lineMaterialOptions.greasedLineMaterialOptions, colors };\n\n const lines = CreateGreasedLine(NavigationDebugger.NAV_MESH_DEBUG_NAME_LINES, options, materialOptions);\n\n lines.parent = this.debugDrawerParentNode;\n this.lineMaterials.push(lines.material as StandardMaterial);\n\n return lines;\n }\n\n private _drawTris(primitive: DebugDrawerPrimitive): void {\n if (primitive.vertices.length === 0) {\n return;\n }\n\n const positions = new Float32Array(primitive.vertices.length * 3);\n const colors = new Float32Array(primitive.vertices.length * 4);\n\n for (let i = 0; i < primitive.vertices.length; i++) {\n const [x, y, z, r, g, b] = primitive.vertices[i];\n positions[i * 3 + 0] = x;\n positions[i * 3 + 1] = y;\n positions[i * 3 + 2] = z;\n\n colors[i * 4 + 0] = r;\n colors[i * 4 + 1] = g;\n colors[i * 4 + 2] = b;\n colors[i * 4 + 3] = 1;\n }\n\n const vertexData = new VertexData();\n\n vertexData.positions = positions;\n vertexData.colors = colors;\n\n const customMesh = new Mesh(NavigationDebugger.NAV_MESH_DEBUG_NAME_TRIS);\n customMesh.isUnIndexed = true;\n vertexData.applyToMesh(customMesh);\n\n customMesh.material = this.triMaterial;\n customMesh.parent = this.debugDrawerParentNode;\n }\n\n private _drawQuads(primitive: DebugDrawerPrimitive): void {\n if (primitive.vertices.length === 0) {\n return;\n }\n\n const positions: number[] = [];\n const colors: number[] = [];\n for (let i = 0; i < primitive.vertices.length; i += 4) {\n const vertices = [\n primitive.vertices[i],\n primitive.vertices[i + 1],\n primitive.vertices[i + 2],\n primitive.vertices[i],\n primitive.vertices[i + 2],\n primitive.vertices[i + 3],\n ];\n for (const [x, y, z, r, g, b] of vertices) {\n positions.push(x, y, z);\n colors.push(r, g, b, 1);\n }\n }\n\n const vertexData = new VertexData();\n\n vertexData.positions = positions;\n vertexData.colors = colors;\n\n const customMesh = new Mesh(NavigationDebugger.NAV_MESH_DEBUG_NAME_QUADS);\n customMesh.isUnIndexed = true;\n vertexData.applyToMesh(customMesh);\n\n customMesh.material = this.triMaterial;\n customMesh.parent = this.debugDrawerParentNode;\n }\n\n /**\n * Merge the debug meshes for better performance\n */\n private _joinDebugMeshes() {\n const debugMeshes = this._scene.meshes.filter((m) => m.name === NavigationDebugger.NAV_MESH_DEBUG_NAME) as Mesh[];\n\n // only indexed meshes can be merged\n debugMeshes.forEach((m) => {\n this._convertUnindexedToIndexed(m);\n });\n\n const merged = Mesh.MergeMeshes(debugMeshes, true);\n if (merged) {\n merged.name = NavigationDebugger.NAV_MESH_DEBUG_NAME;\n merged.parent = this.debugDrawerParentNode;\n }\n }\n\n private _convertUnindexedToIndexed(mesh: Mesh): void {\n const vertexData = VertexData.ExtractFromMesh(mesh);\n const positions = vertexData.positions;\n\n if (!positions || positions.length % 9 !== 0) {\n Logger.Warn(\"Mesh must be fully unindexed with triangles.\");\n return;\n }\n\n const vertexCount = positions.length / 3;\n const indices = Array.from({ length: vertexCount }, (_, i) => i);\n\n const newVertexData = new VertexData();\n newVertexData.positions = positions;\n newVertexData.indices = indices;\n\n newVertexData.applyToMesh(mesh, true);\n }\n}\n"]}
1
+ {"version":3,"file":"NavigationDebugger.js","sourceRoot":"","sources":["../../../../../dev/addons/src/navigation/debug/NavigationDebugger.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,OAAO,EAAE,SAAS,EA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AI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3C,MAAM,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;YAC5D,OAAO;QACX,CAAC;QAED,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QACzC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QAEjE,MAAM,aAAa,GAAG,IAAI,UAAU,EAAE,CAAC;QACvC,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC;QACpC,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC;QAEhC,aAAa,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;;AA9pBD;;;GAGG;AACW,sCAAmB,GAAG,gBAAgB,AAAnB,CAAoB;AAErD;;GAEG;AACW,6CAA0B,GAAG,uBAAuB,AAA1B,CAA2B;AAEnE;;GAEG;AACW,2CAAwB,GAAG,qBAAqB,AAAxB,CAAyB;AAE/D;;GAEG;AACW,4CAAyB,GAAG,sBAAsB,AAAzB,CAA0B;AAEjE;;GAEG;AACW,4CAAyB,GAAG,sBAAsB,AAAzB,CAA0B","sourcesContent":["import {\n type DebugDrawerPrimitive,\n type DebugDrawerPrimitiveType,\n type NavMesh,\n type NavMeshQuery,\n type RecastCompactHeightfield,\n type RecastContourSet,\n type RecastHeightfield,\n type RecastHeightfieldLayer,\n type RecastHeightfieldLayerSet,\n type RecastPolyMesh,\n type RecastPolyMeshDetail,\n type DebugDrawerUtils,\n} from \"@recast-navigation/core\";\n\nimport { type GreasedLineMaterialOptions } from \"core/Materials/GreasedLine/greasedLineMaterialInterfaces\";\nimport { StandardMaterial } from \"core/Materials/standardMaterial\";\nimport { Color3 } from \"core/Maths/math.color\";\nimport { Matrix } from \"core/Maths/math.vector\";\nimport { CreateGreasedLine } from \"core/Meshes/Builders/greasedLineBuilder\";\nimport { type GreasedLineBaseMesh, type GreasedLineMeshOptions } from \"core/Meshes/GreasedLine/greasedLineBaseMesh\";\nimport { Mesh } from \"core/Meshes/mesh\";\nimport { VertexData } from \"core/Meshes/mesh.vertexData\";\nimport { TransformNode } from \"core/Meshes/transformNode\";\nimport { type Scene } from \"core/scene\";\nimport { type Nullable } from \"core/types\";\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\nimport { Logger } from \"core/Misc/logger\";\n\nimport { type GeneratorIntermediates } from \"../types\";\nimport { GetRecast } from \"../factory/common\";\n\n// TODO: Enum?\nexport const DebugLayerOption = {\n HEIGHTFIELD_SOLID: \"heightfield solid\",\n HEIGHTFIELD_WALKABLE: \"heightfield walkable\",\n COMPACT_HEIGHTFIELD_SOLID: \"compact heightfield solid\",\n COMPACT_HEIGHTFIELD_REGIONS: \"compact heightfield regions\",\n COMPACT_HEIGHTFIELD_DISTANCE: \"compact heightfield distance\",\n RAW_CONTOURS: \"raw contours\",\n CONTOURS: \"contours\",\n POLY_MESH: \"poly mesh\",\n POLY_MESH_DETAIL: \"poly mesh detail\",\n NAVMESH: \"navmesh\",\n NAVMESH_BV_TREE: \"navmesh bv tree\",\n};\n\nexport type DebugLayerOptions = (typeof DebugLayerOption)[keyof typeof DebugLayerOption];\n\n/**\n * NavigationDebugger is a utility class for visualizing navigation meshes and related data in a Babylon.js scene.\n * It provides methods to draw various navigation-related primitives such as points, lines, triangles, and quads.\n * It also supports drawing heightfields, compact heightfields, contours, poly meshes, and nav meshes.\n */\nexport class NavigationDebugger {\n /**\n * The name of the debug mesh used for navigation debugging.\n * This is used to group all navigation debug meshes under a single name for easier management\n */\n public static NAV_MESH_DEBUG_NAME = \"nav-mesh-debug\";\n\n /**\n * The name of the debug mesh used for visualization of the navigation mesh using points.\n */\n public static NAV_MESH_DEBUG_NAME_POINTS = \"nav-mesh-debug-points\";\n\n /**\n * The name of the debug mesh used for visualization of the navigation mesh using triangles.\n */\n public static NAV_MESH_DEBUG_NAME_TRIS = \"nav-mesh-debug-tris\";\n\n /**\n * The name of the debug mesh used for visualization of the navigation mesh using quads.\n */\n public static NAV_MESH_DEBUG_NAME_QUADS = \"nav-mesh-debug-quads\";\n\n /**\n * The name of the debug mesh used for visualization of the navigation mesh using lines.\n */\n public static NAV_MESH_DEBUG_NAME_LINES = \"nav-mesh-debug-lines\";\n\n /**\n * The material used for rendering triangles in the navigation debug visualization.\n */\n public triMaterial: StandardMaterial;\n /**\n * The material used for rendering points in the navigation debug visualization.\n */\n public pointMaterial: StandardMaterial;\n\n /**\n * The list of line materials used in the navigation debug visualization.\n */\n public lineMaterials: StandardMaterial[] = [];\n\n /**\n * The parent node for the debug drawer.\n */\n public debugDrawerParentNode: TransformNode;\n\n /**\n * * Gets or sets the primitive types to be drawn by the debug drawer.\n * * This allows you to control which types of primitives (points, lines, tris, quads) are rendered in the navigation debug visualization.\n * * The default value is `[\"points\", \"lines\", \"tris\", \"quads\"]`.\n * * You can modify this property to include or exclude specific primitive types based on your debugging needs.\n * @returns An array of primitive types that the debug drawer will render.\n */\n public get primitiveTypes(): DebugDrawerPrimitiveType[] {\n return this._primitiveTypes;\n }\n\n public set primitiveTypes(value: DebugDrawerPrimitiveType[]) {\n this._primitiveTypes = value;\n }\n\n private _lineMaterialOptions: {\n greasedLineMaterialOptions: Partial<GreasedLineMaterialOptions>;\n greasedLineMeshOptions: Partial<GreasedLineMeshOptions>;\n };\n private _pointMesh: Mesh;\n private _debugDrawerUtils: DebugDrawerUtils;\n private _primitiveTypes: DebugDrawerPrimitiveType[];\n\n constructor(\n private _scene: Scene,\n options?: {\n parent?: {\n node?: TransformNode | string;\n };\n primitiveTypes?: DebugDrawerPrimitiveType[];\n materials?: {\n triMaterial?: StandardMaterial;\n pointMaterial?: StandardMaterial;\n lineMaterialOptions: {\n greasedLineMaterialOptions: Partial<GreasedLineMaterialOptions>;\n greasedLineMeshOptions: Partial<GreasedLineMeshOptions>;\n };\n };\n }\n ) {\n this._debugDrawerUtils = new (GetRecast().DebugDrawerUtils)();\n\n this._primitiveTypes = options?.primitiveTypes ?? [\"points\", \"lines\", \"tris\", \"quads\"];\n\n this.debugDrawerParentNode =\n options?.parent?.node instanceof TransformNode ? options.parent.node : new TransformNode((options?.parent?.node as string) ?? \"nav-mesh-debug-parent\", this._scene);\n\n const materials = options?.materials;\n if (materials?.triMaterial) {\n this.triMaterial = materials.triMaterial;\n } else {\n this.triMaterial = new StandardMaterial(\"nav-debug-tris-material\", this._scene);\n this.triMaterial.backFaceCulling = false;\n this.triMaterial.specularColor = Color3.Black();\n this.triMaterial.alpha = 0.5;\n }\n\n if (materials?.pointMaterial) {\n this.pointMaterial = materials.pointMaterial;\n } else {\n this.pointMaterial = new StandardMaterial(\"nav-debug-points-material\", this._scene);\n this.pointMaterial.backFaceCulling = false;\n this.pointMaterial.specularColor = Color3.Black();\n }\n\n if (materials?.lineMaterialOptions) {\n this._lineMaterialOptions = materials.lineMaterialOptions;\n } else {\n this._lineMaterialOptions = {\n greasedLineMaterialOptions: {\n width: 2,\n sizeAttenuation: true,\n },\n greasedLineMeshOptions: {},\n };\n }\n\n this._pointMesh = CreateBox(NavigationDebugger.NAV_MESH_DEBUG_NAME_POINTS, { size: 0.02 }, this._scene);\n }\n\n /**\n * Resets the debug drawer by disposing of all child meshes in the debug drawer parent node.\n * This is useful for clearing the debug visualization before drawing new primitives.\n */\n public clear() {\n for (const child of this.debugDrawerParentNode.getChildMeshes()) {\n child.dispose();\n }\n }\n\n /**\n * Disposes of the debug drawer, including all meshes and materials used for rendering.\n * This method should be called when the debug drawer is no longer needed to free up resources.\n */\n public dispose() {\n this.clear();\n this._debugDrawerUtils.dispose();\n this._pointMesh.dispose();\n this.triMaterial.dispose();\n this.pointMaterial.dispose();\n }\n\n /**\n * This method iterates through the provided primitives and draws them based on their type.\n * It supports drawing points, lines, triangles, and quads, depending on the primitive type.\n * @param primitives An array of debug drawer primitives to be drawn.\n * @param options Optional parameters to control the drawing behavior, such as whether to join meshes.\n */\n public drawPrimitives(primitives: DebugDrawerPrimitive[], options?: { joinMeshes?: boolean }) {\n let linesInstance = null;\n\n for (const primitive of primitives) {\n // draw only the primitives that are in the primitiveTypes array\n if (!this._primitiveTypes.includes(primitive.type)) {\n continue;\n }\n\n switch (primitive.type) {\n case \"points\":\n this._drawPoints(primitive);\n break;\n case \"lines\": {\n const line = this._drawLines(primitive, linesInstance);\n if (!linesInstance) {\n linesInstance = line;\n }\n break;\n }\n case \"tris\":\n this._drawTris(primitive);\n break;\n case \"quads\":\n this._drawQuads(primitive);\n break;\n }\n }\n\n linesInstance?.updateLazy();\n\n if (options?.joinMeshes ?? true) {\n // Join the debug meshes into a single mesh for better performance\n this._joinDebugMeshes();\n }\n }\n\n /**\n * Draws a heightfield as solid using the debug drawer utilities.\n * @param hf The heightfield to draw as solid.\n */\n public drawHeightfieldSolid(hf: RecastHeightfield): void {\n const primitives = this._debugDrawerUtils.drawHeightfieldSolid(hf);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a heightfield as walkable using the debug drawer utilities.\n * @param hf The heightfield to draw as walkable.\n */\n public drawHeightfieldWalkable(hf: RecastHeightfield): void {\n const primitives = this._debugDrawerUtils.drawHeightfieldWalkable(hf);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a compact heightfield as solid using the debug drawer utilities.\n * @param chf The compact heightfield to draw as solid.\n */\n public drawCompactHeightfieldSolid(chf: RecastCompactHeightfield): void {\n const primitives = this._debugDrawerUtils.drawCompactHeightfieldSolid(chf);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the regions of a compact heightfield using the debug drawer utilities.\n * @param chf The compact heightfield to draw regions for.\n */\n public drawCompactHeightfieldRegions(chf: RecastCompactHeightfield): void {\n const primitives = this._debugDrawerUtils.drawCompactHeightfieldRegions(chf);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the distance field of a compact heightfield using the debug drawer utilities.\n * @param chf The compact heightfield to draw the distance for.\n */\n public drawCompactHeightfieldDistance(chf: RecastCompactHeightfield): void {\n const primitives = this._debugDrawerUtils.drawCompactHeightfieldDistance(chf);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a heightfield layer using the debug drawer utilities.\n * @param layer The heightfield layer to draw.\n * @param idx The index of the layer to draw.\n */\n public drawHeightfieldLayer(layer: RecastHeightfieldLayer, idx: number): void {\n const primitives = this._debugDrawerUtils.drawHeightfieldLayer(layer, idx);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the layers of a heightfield using the debug drawer utilities.\n * @param lset The heightfield layer set containing the layers to draw.\n */\n public drawHeightfieldLayers(lset: RecastHeightfieldLayerSet): void {\n const primitives = this._debugDrawerUtils.drawHeightfieldLayers(lset);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the region connections of a RecastContourSet using the debug drawer utilities.\n * @param cset RecastContourSet to draw\n * @param alpha The alpha value for the drawn contours, default is 1.\n */\n public drawRegionConnections(cset: RecastContourSet, alpha: number = 1): void {\n const primitives = this._debugDrawerUtils.drawRegionConnections(cset, alpha);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws raw contours from a RecastContourSet using the debug drawer utilities.\n * @param cset RecastContourSet to draw\n * @param alpha The alpha value for the drawn contours, default is 1.\n */\n public drawRawContours(cset: RecastContourSet, alpha: number = 1): void {\n const primitives = this._debugDrawerUtils.drawRawContours(cset, alpha);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws contours from a RecastContourSet using the debug drawer utilities.\n * @param cset RecastContourSet to draw\n * @param alpha The alpha value for the drawn contours, default is 1.\n */\n public drawContours(cset: RecastContourSet, alpha: number = 1): void {\n const primitives = this._debugDrawerUtils.drawContours(cset, alpha);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a poly mesh using the debug drawer utilities.\n * @param mesh RecastPolyMesh to draw\n */\n public drawPolyMesh(mesh: RecastPolyMesh): void {\n const primitives = this._debugDrawerUtils.drawPolyMesh(mesh);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a poly mesh detail using the debug drawer utilities.\n * @param dmesh RecastPolyMeshDetail to draw\n */\n public drawPolyMeshDetail(dmesh: RecastPolyMeshDetail): void {\n const primitives = this._debugDrawerUtils.drawPolyMeshDetail(dmesh);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws a NavMesh using the debug drawer utilities.\n * @param mesh NavMesh to draw\n * @param flags Flags to control the drawing behavior, default is 0.\n */\n public drawNavMesh(mesh: NavMesh, flags: number = 0): void {\n const primitives = this._debugDrawerUtils.drawNavMesh(mesh, flags);\n this.drawPrimitives(primitives);\n }\n\n // todo:\n // - drawTileCacheLayerAreas\n // - drawTileCacheLayerRegions\n // - drawTileCacheContours\n // - drawTileCachePolyMesh\n\n /**\n * Draws a NavMesh with closed list using the debug drawer utilities.\n * @param mesh NavMesh to draw\n * @param query NavMeshQuery to use for drawing the closed list.\n * @param flags Flags to control the drawing behavior, default is 0.\n */\n public drawNavMeshWithClosedList(mesh: NavMesh, query: NavMeshQuery, flags: number = 0): void {\n const primitives = this._debugDrawerUtils.drawNavMeshWithClosedList(mesh, query, flags);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the nodes of a NavMesh using the debug drawer utilities.\n * @param query NavMeshQuery to use for drawing the nodes.\n */\n public drawNavMeshNodes(query: NavMeshQuery): void {\n const primitives = this._debugDrawerUtils.drawNavMeshNodes(query);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the bounding volume tree of a NavMesh using the debug drawer utilities.\n * @param mesh NavMesh to draw the bounding volume tree for.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public drawNavMeshBVTree(mesh: NavMesh): void {\n const primitives = this._debugDrawerUtils.drawNavMeshBVTree(mesh);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws the portals of a NavMesh using the debug drawer utilities.\n * @param mesh NavMesh to draw the portals for.\n */\n public drawNavMeshPortals(mesh: NavMesh): void {\n const primitives = this._debugDrawerUtils.drawNavMeshPortals(mesh);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws polygons of a NavMesh with specific flags using the debug drawer utilities.\n * @param mesh NavMesh to draw the polygons with specific flags.\n * @param flags The flags to filter the polygons to be drawn.\n * @param col The color to use for the drawn polygons, represented as a number.\n */\n public drawNavMeshPolysWithFlags(mesh: NavMesh, flags: number, col: number): void {\n const primitives = this._debugDrawerUtils.drawNavMeshPolysWithFlags(mesh, flags, col);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Draws polygons of a NavMesh with specific reference and color using the debug drawer utilities.\n * @param mesh NavMesh to draw the polygons with specific reference and color.\n * @param ref The reference number of the polygons to be drawn.\n * @param col The color to use for the drawn polygons, represented as a number.\n */\n public drawNavMeshPoly(mesh: NavMesh, ref: number, col: number): void {\n const primitives = this._debugDrawerUtils.drawNavMeshPoly(mesh, ref, col);\n this.drawPrimitives(primitives);\n }\n\n /**\n * Get the intermediates from the generator\n * @param intermediates - The generator intermediates\n * @returns An object containing lists of heightfields, compact heightfields, contour sets\n */\n public getIntermediates = (intermediates: GeneratorIntermediates) => {\n const heightfieldList: RecastHeightfield[] = [];\n const compactHeightfieldList: RecastCompactHeightfield[] = [];\n const contourSetList: RecastContourSet[] = [];\n const polyMeshList: RecastPolyMesh[] = [];\n const polyMeshDetailList: RecastPolyMeshDetail[] = [];\n\n if (intermediates) {\n if (intermediates.type === \"solo\") {\n if (intermediates.heightfield) {\n heightfieldList.push(intermediates.heightfield);\n }\n\n if (intermediates.compactHeightfield) {\n compactHeightfieldList.push(intermediates.compactHeightfield);\n }\n\n if (intermediates.contourSet) {\n contourSetList.push(intermediates.contourSet);\n }\n\n if (intermediates.polyMesh) {\n polyMeshList.push(intermediates.polyMesh);\n }\n\n if (intermediates.polyMeshDetail) {\n polyMeshDetailList.push(intermediates.polyMeshDetail);\n }\n } else if (intermediates.type === \"tiled\") {\n for (const tile of intermediates.tileIntermediates) {\n if (tile.heightfield) {\n heightfieldList.push(tile.heightfield);\n }\n\n if (tile.compactHeightfield) {\n compactHeightfieldList.push(tile.compactHeightfield);\n }\n\n if (tile.contourSet) {\n contourSetList.push(tile.contourSet);\n }\n\n if (tile.polyMesh) {\n polyMeshList.push(tile.polyMesh);\n }\n\n if (tile.polyMeshDetail) {\n polyMeshDetailList.push(tile.polyMeshDetail);\n }\n }\n } else if (intermediates.type === \"tilecache\") {\n for (const tile of intermediates.tileIntermediates) {\n if (tile.heightfield) {\n heightfieldList.push(tile.heightfield);\n }\n\n if (tile.compactHeightfield) {\n compactHeightfieldList.push(tile.compactHeightfield);\n }\n }\n }\n }\n\n return {\n heightfieldList,\n compactHeightfieldList,\n contourSetList,\n polyMeshList,\n polyMeshDetailList,\n };\n };\n\n /**\n * Draw debug information based on the selected option\n * @param navMesh - The navigation mesh to draw\n * @param intermediates - The generator intermediates containing the data to draw\n * @param scene - The scene to draw in\n * @param option - The debug drawer option to use\n * @remarks This method will reset the debug drawer before drawing.\n */\n public draw(navMesh: NavMesh, intermediates: GeneratorIntermediates, scene: Scene, option: DebugLayerOptions) {\n this.clear();\n\n const { heightfieldList, compactHeightfieldList, contourSetList, polyMeshList, polyMeshDetailList } = this.getIntermediates(intermediates);\n\n if (option === DebugLayerOption.HEIGHTFIELD_SOLID) {\n for (const heightfield of heightfieldList) {\n this.drawHeightfieldSolid(heightfield);\n }\n } else if (option === DebugLayerOption.HEIGHTFIELD_WALKABLE) {\n for (const heightfield of heightfieldList) {\n this.drawHeightfieldWalkable(heightfield);\n }\n } else if (option === DebugLayerOption.COMPACT_HEIGHTFIELD_SOLID) {\n for (const compactHeightfield of compactHeightfieldList) {\n this.drawCompactHeightfieldSolid(compactHeightfield);\n }\n } else if (option === DebugLayerOption.COMPACT_HEIGHTFIELD_REGIONS) {\n for (const compactHeightfield of compactHeightfieldList) {\n this.drawCompactHeightfieldRegions(compactHeightfield);\n }\n } else if (option === DebugLayerOption.COMPACT_HEIGHTFIELD_DISTANCE) {\n for (const compactHeightfield of compactHeightfieldList) {\n this.drawCompactHeightfieldDistance(compactHeightfield);\n }\n } else if (option === DebugLayerOption.RAW_CONTOURS) {\n for (const contourSet of contourSetList) {\n this.drawRawContours(contourSet);\n }\n } else if (option === DebugLayerOption.CONTOURS) {\n for (const contourSet of contourSetList) {\n this.drawContours(contourSet);\n }\n } else if (option === DebugLayerOption.POLY_MESH) {\n for (const polyMesh of polyMeshList) {\n this.drawPolyMesh(polyMesh);\n }\n } else if (option === DebugLayerOption.POLY_MESH_DETAIL) {\n for (const polyMeshDetail of polyMeshDetailList) {\n this.drawPolyMeshDetail(polyMeshDetail);\n }\n } else if (option === DebugLayerOption.NAVMESH) {\n this.drawNavMesh(navMesh);\n } else if (option === DebugLayerOption.NAVMESH_BV_TREE) {\n this.drawNavMeshBVTree(navMesh);\n }\n }\n\n private _drawPoints(primitive: DebugDrawerPrimitive): void {\n if (primitive.vertices.length === 0) {\n return;\n }\n\n const matricesData = new Float32Array(16 * primitive.vertices.length);\n const colorData = new Float32Array(4 * primitive.vertices.length);\n\n for (let i = 0; i < primitive.vertices.length; i++) {\n const [x, y, z, r, g, b, a] = primitive.vertices[i];\n\n colorData[i * 4] = r;\n colorData[i * 4 + 1] = g;\n colorData[i * 4 + 2] = b;\n colorData[i * 4 + 3] = a;\n\n const matrix = Matrix.Translation(x, y, z);\n matrix.copyToArray(matricesData, i * 16);\n }\n\n this._pointMesh.thinInstanceSetBuffer(\"matrix\", matricesData, 16);\n this._pointMesh.thinInstanceSetBuffer(\"color\", colorData, 4);\n\n this._pointMesh.parent = this.debugDrawerParentNode;\n }\n\n private _drawLines(primitive: DebugDrawerPrimitive, instance: Nullable<GreasedLineBaseMesh>): Nullable<GreasedLineBaseMesh> {\n if (primitive.vertices.length === 0) {\n return null;\n }\n\n const points: number[][] = [];\n const colors: Color3[] = [];\n\n for (let i = 0; i < primitive.vertices.length; i += 2) {\n const [x1, y1, z1, r1, g1, b1] = primitive.vertices[i];\n const [x2, y2, z2, r2, g2, b2] = primitive.vertices[i + 1];\n\n points.push([x1, y1, z1, x2, y2, z2]);\n\n colors.push(new Color3(r1, g1, b1));\n colors.push(new Color3(r2, g2, b2));\n }\n\n const options = { ...this._lineMaterialOptions.greasedLineMeshOptions, points, instance: instance ?? undefined };\n const materialOptions = { ...this._lineMaterialOptions.greasedLineMaterialOptions, colors };\n\n const lines = CreateGreasedLine(NavigationDebugger.NAV_MESH_DEBUG_NAME_LINES, options, materialOptions, this._scene);\n\n lines.parent = this.debugDrawerParentNode;\n this.lineMaterials.push(lines.material as StandardMaterial);\n\n return lines;\n }\n\n private _drawTris(primitive: DebugDrawerPrimitive): void {\n if (primitive.vertices.length === 0) {\n return;\n }\n\n const positions = new Float32Array(primitive.vertices.length * 3);\n const colors = new Float32Array(primitive.vertices.length * 4);\n\n for (let i = 0; i < primitive.vertices.length; i++) {\n const [x, y, z, r, g, b] = primitive.vertices[i];\n positions[i * 3 + 0] = x;\n positions[i * 3 + 1] = y;\n positions[i * 3 + 2] = z;\n\n colors[i * 4 + 0] = r;\n colors[i * 4 + 1] = g;\n colors[i * 4 + 2] = b;\n colors[i * 4 + 3] = 1;\n }\n\n const vertexData = new VertexData();\n\n vertexData.positions = positions;\n vertexData.colors = colors;\n\n const customMesh = new Mesh(NavigationDebugger.NAV_MESH_DEBUG_NAME_TRIS, this._scene);\n customMesh.isUnIndexed = true;\n vertexData.applyToMesh(customMesh);\n\n customMesh.material = this.triMaterial;\n customMesh.parent = this.debugDrawerParentNode;\n }\n\n private _drawQuads(primitive: DebugDrawerPrimitive): void {\n if (primitive.vertices.length === 0) {\n return;\n }\n\n const positions: number[] = [];\n const colors: number[] = [];\n for (let i = 0; i < primitive.vertices.length; i += 4) {\n const vertices = [\n primitive.vertices[i],\n primitive.vertices[i + 1],\n primitive.vertices[i + 2],\n primitive.vertices[i],\n primitive.vertices[i + 2],\n primitive.vertices[i + 3],\n ];\n for (const [x, y, z, r, g, b] of vertices) {\n positions.push(x, y, z);\n colors.push(r, g, b, 1);\n }\n }\n\n const vertexData = new VertexData();\n\n vertexData.positions = positions;\n vertexData.colors = colors;\n\n const customMesh = new Mesh(NavigationDebugger.NAV_MESH_DEBUG_NAME_QUADS, this._scene);\n customMesh.isUnIndexed = true;\n vertexData.applyToMesh(customMesh);\n\n customMesh.material = this.triMaterial;\n customMesh.parent = this.debugDrawerParentNode;\n }\n\n /**\n * Merge the debug meshes for better performance\n */\n private _joinDebugMeshes() {\n const debugMeshes = this._scene.meshes.filter((m) => m.name === NavigationDebugger.NAV_MESH_DEBUG_NAME) as Mesh[];\n\n // only indexed meshes can be merged\n debugMeshes.forEach((m) => {\n this._convertUnindexedToIndexed(m);\n });\n\n const merged = Mesh.MergeMeshes(debugMeshes, true);\n if (merged) {\n merged.name = NavigationDebugger.NAV_MESH_DEBUG_NAME;\n merged.parent = this.debugDrawerParentNode;\n }\n }\n\n private _convertUnindexedToIndexed(mesh: Mesh): void {\n const vertexData = VertexData.ExtractFromMesh(mesh);\n const positions = vertexData.positions;\n\n if (!positions || positions.length % 9 !== 0) {\n Logger.Warn(\"Mesh must be fully unindexed with triangles.\");\n return;\n }\n\n const vertexCount = positions.length / 3;\n const indices = Array.from({ length: vertexCount }, (_, i) => i);\n\n const newVertexData = new VertexData();\n newVertexData.positions = positions;\n newVertexData.indices = indices;\n\n newVertexData.applyToMesh(mesh, true);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onerjs/addons",
3
- "version": "8.51.2",
3
+ "version": "8.51.3",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "postcompile": "build-tools -c add-js-to-es6"
19
19
  },
20
20
  "devDependencies": {
21
- "@onerjs/core": "8.51.2",
21
+ "@onerjs/core": "8.51.3",
22
22
  "@dev/addons": "^1.0.0",
23
23
  "@dev/build-tools": "^1.0.0"
24
24
  },