@onerjs/addons 8.27.1 → 8.27.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.
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/msdfText/paragraphOptions.d.ts +15 -0
- package/msdfText/paragraphOptions.js.map +1 -1
- package/msdfText/sdf/paragraph.js +1 -1
- package/msdfText/sdf/paragraph.js.map +1 -1
- package/navigation/common/config.d.ts +35 -0
- package/navigation/common/config.js +61 -0
- package/navigation/common/config.js.map +1 -0
- package/navigation/common/convert.d.ts +8 -0
- package/navigation/common/convert.js +22 -0
- package/navigation/common/convert.js.map +1 -0
- package/navigation/common/getters.d.ts +15 -0
- package/navigation/common/getters.js +76 -0
- package/navigation/common/getters.js.map +1 -0
- package/navigation/common/index.d.ts +6 -0
- package/navigation/common/index.js +7 -0
- package/navigation/common/index.js.map +1 -0
- package/navigation/common/smooth-path.d.ts +32 -0
- package/navigation/common/smooth-path.js +340 -0
- package/navigation/common/smooth-path.js.map +1 -0
- package/navigation/common/tile-cache.d.ts +15 -0
- package/navigation/common/tile-cache.js +32 -0
- package/navigation/common/tile-cache.js.map +1 -0
- package/navigation/common/utils.d.ts +17 -0
- package/navigation/common/utils.js +66 -0
- package/navigation/common/utils.js.map +1 -0
- package/navigation/debug/NavigationDebugger.d.ts +248 -0
- package/navigation/debug/NavigationDebugger.js +587 -0
- package/navigation/debug/NavigationDebugger.js.map +1 -0
- package/navigation/debug/index.d.ts +2 -0
- package/navigation/debug/index.js +3 -0
- package/navigation/debug/index.js.map +1 -0
- package/navigation/debug/simple-debug.d.ts +13 -0
- package/navigation/debug/simple-debug.js +23 -0
- package/navigation/debug/simple-debug.js.map +1 -0
- package/navigation/factory/common.d.ts +20 -0
- package/navigation/factory/common.js +80 -0
- package/navigation/factory/common.js.map +1 -0
- package/navigation/factory/factory.single-thread.d.ts +7 -0
- package/navigation/factory/factory.single-thread.js +15 -0
- package/navigation/factory/factory.single-thread.js.map +1 -0
- package/navigation/factory/factory.worker.d.ts +9 -0
- package/navigation/factory/factory.worker.js +40 -0
- package/navigation/factory/factory.worker.js.map +1 -0
- package/navigation/factory/index.d.ts +1 -0
- package/navigation/factory/index.js +3 -0
- package/navigation/factory/index.js.map +1 -0
- package/navigation/generator/generator.common.d.ts +25 -0
- package/navigation/generator/generator.common.js +40 -0
- package/navigation/generator/generator.common.js.map +1 -0
- package/navigation/generator/generator.single-thread.d.ts +20 -0
- package/navigation/generator/generator.single-thread.js +57 -0
- package/navigation/generator/generator.single-thread.js.map +1 -0
- package/navigation/generator/generator.worker.d.ts +29 -0
- package/navigation/generator/generator.worker.js +47 -0
- package/navigation/generator/generator.worker.js.map +1 -0
- package/navigation/generator/index.d.ts +3 -0
- package/navigation/generator/index.js +5 -0
- package/navigation/generator/index.js.map +1 -0
- package/navigation/generator/injection.d.ts +6 -0
- package/navigation/generator/injection.js +16 -0
- package/navigation/generator/injection.js.map +1 -0
- package/navigation/index.d.ts +5 -0
- package/navigation/index.js +7 -0
- package/navigation/index.js.map +1 -0
- package/navigation/plugin/RecastJSCrowd.d.ts +198 -0
- package/navigation/plugin/RecastJSCrowd.js +359 -0
- package/navigation/plugin/RecastJSCrowd.js.map +1 -0
- package/navigation/plugin/RecastNavigationJSPlugin.d.ts +419 -0
- package/navigation/plugin/RecastNavigationJSPlugin.js +482 -0
- package/navigation/plugin/RecastNavigationJSPlugin.js.map +1 -0
- package/navigation/plugin/index.d.ts +1 -0
- package/navigation/plugin/index.js +2 -0
- package/navigation/plugin/index.js.map +1 -0
- package/navigation/types.d.ts +199 -0
- package/navigation/types.js +11 -0
- package/navigation/types.js.map +1 -0
- package/navigation/worker/navmesh-worker.d.ts +4 -0
- package/navigation/worker/navmesh-worker.js +63 -0
- package/navigation/worker/navmesh-worker.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import type { DebugDrawerPrimitive, DebugDrawerPrimitiveType, NavMesh, NavMeshQuery, RecastCompactHeightfield, RecastContourSet, RecastHeightfield, RecastHeightfieldLayer, RecastHeightfieldLayerSet, RecastPolyMesh, RecastPolyMeshDetail } from "@recast-navigation/core";
|
|
2
|
+
import type { GreasedLineMaterialOptions } from "@onerjs/core/Materials/GreasedLine/greasedLineMaterialInterfaces.js";
|
|
3
|
+
import { StandardMaterial } from "@onerjs/core/Materials/standardMaterial.js";
|
|
4
|
+
import type { GreasedLineMeshOptions } from "@onerjs/core/Meshes/GreasedLine/greasedLineBaseMesh.js";
|
|
5
|
+
import { TransformNode } from "@onerjs/core/Meshes/transformNode.js";
|
|
6
|
+
import type { Scene } from "@onerjs/core/scene.js";
|
|
7
|
+
import type { GeneratorIntermediates } from "../types.js";
|
|
8
|
+
export declare const DebugLayerOption: {
|
|
9
|
+
HEIGHTFIELD_SOLID: string;
|
|
10
|
+
HEIGHTFIELD_WALKABLE: string;
|
|
11
|
+
COMPACT_HEIGHTFIELD_SOLID: string;
|
|
12
|
+
COMPACT_HEIGHTFIELD_REGIONS: string;
|
|
13
|
+
COMPACT_HEIGHTFIELD_DISTANCE: string;
|
|
14
|
+
RAW_CONTOURS: string;
|
|
15
|
+
CONTOURS: string;
|
|
16
|
+
POLY_MESH: string;
|
|
17
|
+
POLY_MESH_DETAIL: string;
|
|
18
|
+
NAVMESH: string;
|
|
19
|
+
NAVMESH_BV_TREE: string;
|
|
20
|
+
};
|
|
21
|
+
export type DebugLayerOptions = (typeof DebugLayerOption)[keyof typeof DebugLayerOption];
|
|
22
|
+
/**
|
|
23
|
+
* NavigationDebugger is a utility class for visualizing navigation meshes and related data in a Babylon.js scene.
|
|
24
|
+
* It provides methods to draw various navigation-related primitives such as points, lines, triangles, and quads.
|
|
25
|
+
* It also supports drawing heightfields, compact heightfields, contours, poly meshes, and nav meshes.
|
|
26
|
+
*/
|
|
27
|
+
export declare class NavigationDebugger {
|
|
28
|
+
private _scene;
|
|
29
|
+
/**
|
|
30
|
+
* The name of the debug mesh used for navigation debugging.
|
|
31
|
+
* This is used to group all navigation debug meshes under a single name for easier management
|
|
32
|
+
*/
|
|
33
|
+
static NAV_MESH_DEBUG_NAME: string;
|
|
34
|
+
/**
|
|
35
|
+
* The name of the debug mesh used for visualization of the navigation mesh using points.
|
|
36
|
+
*/
|
|
37
|
+
static NAV_MESH_DEBUG_NAME_POINTS: string;
|
|
38
|
+
/**
|
|
39
|
+
* The name of the debug mesh used for visualization of the navigation mesh using triangles.
|
|
40
|
+
*/
|
|
41
|
+
static NAV_MESH_DEBUG_NAME_TRIS: string;
|
|
42
|
+
/**
|
|
43
|
+
* The name of the debug mesh used for visualization of the navigation mesh using quads.
|
|
44
|
+
*/
|
|
45
|
+
static NAV_MESH_DEBUG_NAME_QUADS: string;
|
|
46
|
+
/**
|
|
47
|
+
* The name of the debug mesh used for visualization of the navigation mesh using lines.
|
|
48
|
+
*/
|
|
49
|
+
static NAV_MESH_DEBUG_NAME_LINES: string;
|
|
50
|
+
/**
|
|
51
|
+
* The material used for rendering triangles in the navigation debug visualization.
|
|
52
|
+
*/
|
|
53
|
+
triMaterial: StandardMaterial;
|
|
54
|
+
/**
|
|
55
|
+
* The material used for rendering points in the navigation debug visualization.
|
|
56
|
+
*/
|
|
57
|
+
pointMaterial: StandardMaterial;
|
|
58
|
+
/**
|
|
59
|
+
* The list of line materials used in the navigation debug visualization.
|
|
60
|
+
*/
|
|
61
|
+
lineMaterials: StandardMaterial[];
|
|
62
|
+
/**
|
|
63
|
+
* The parent node for the debug drawer.
|
|
64
|
+
*/
|
|
65
|
+
debugDrawerParentNode: TransformNode;
|
|
66
|
+
/**
|
|
67
|
+
* * Gets or sets the primitive types to be drawn by the debug drawer.
|
|
68
|
+
* * This allows you to control which types of primitives (points, lines, tris, quads) are rendered in the navigation debug visualization.
|
|
69
|
+
* * The default value is `["points", "lines", "tris", "quads"]`.
|
|
70
|
+
* * You can modify this property to include or exclude specific primitive types based on your debugging needs.
|
|
71
|
+
* @returns An array of primitive types that the debug drawer will render.
|
|
72
|
+
*/
|
|
73
|
+
get primitiveTypes(): DebugDrawerPrimitiveType[];
|
|
74
|
+
set primitiveTypes(value: DebugDrawerPrimitiveType[]);
|
|
75
|
+
private _lineMaterialOptions;
|
|
76
|
+
private _pointMesh;
|
|
77
|
+
private _debugDrawerUtils;
|
|
78
|
+
private _primitiveTypes;
|
|
79
|
+
constructor(_scene: Scene, options?: {
|
|
80
|
+
parent?: {
|
|
81
|
+
node?: TransformNode | string;
|
|
82
|
+
};
|
|
83
|
+
primitiveTypes?: DebugDrawerPrimitiveType[];
|
|
84
|
+
materials?: {
|
|
85
|
+
triMaterial?: StandardMaterial;
|
|
86
|
+
pointMaterial?: StandardMaterial;
|
|
87
|
+
lineMaterialOptions: {
|
|
88
|
+
greasedLineMaterialOptions: Partial<GreasedLineMaterialOptions>;
|
|
89
|
+
greasedLineMeshOptions: Partial<GreasedLineMeshOptions>;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* Resets the debug drawer by disposing of all child meshes in the debug drawer parent node.
|
|
95
|
+
* This is useful for clearing the debug visualization before drawing new primitives.
|
|
96
|
+
*/
|
|
97
|
+
clear(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Disposes of the debug drawer, including all meshes and materials used for rendering.
|
|
100
|
+
* This method should be called when the debug drawer is no longer needed to free up resources.
|
|
101
|
+
*/
|
|
102
|
+
dispose(): void;
|
|
103
|
+
/**
|
|
104
|
+
* This method iterates through the provided primitives and draws them based on their type.
|
|
105
|
+
* It supports drawing points, lines, triangles, and quads, depending on the primitive type.
|
|
106
|
+
* @param primitives An array of debug drawer primitives to be drawn.
|
|
107
|
+
* @param options Optional parameters to control the drawing behavior, such as whether to join meshes.
|
|
108
|
+
*/
|
|
109
|
+
drawPrimitives(primitives: DebugDrawerPrimitive[], options?: {
|
|
110
|
+
joinMeshes?: boolean;
|
|
111
|
+
}): void;
|
|
112
|
+
/**
|
|
113
|
+
* Draws a heightfield as solid using the debug drawer utilities.
|
|
114
|
+
* @param hf The heightfield to draw as solid.
|
|
115
|
+
*/
|
|
116
|
+
drawHeightfieldSolid(hf: RecastHeightfield): void;
|
|
117
|
+
/**
|
|
118
|
+
* Draws a heightfield as walkable using the debug drawer utilities.
|
|
119
|
+
* @param hf The heightfield to draw as walkable.
|
|
120
|
+
*/
|
|
121
|
+
drawHeightfieldWalkable(hf: RecastHeightfield): void;
|
|
122
|
+
/**
|
|
123
|
+
* Draws a compact heightfield as solid using the debug drawer utilities.
|
|
124
|
+
* @param chf The compact heightfield to draw as solid.
|
|
125
|
+
*/
|
|
126
|
+
drawCompactHeightfieldSolid(chf: RecastCompactHeightfield): void;
|
|
127
|
+
/**
|
|
128
|
+
* Draws the regions of a compact heightfield using the debug drawer utilities.
|
|
129
|
+
* @param chf The compact heightfield to draw regions for.
|
|
130
|
+
*/
|
|
131
|
+
drawCompactHeightfieldRegions(chf: RecastCompactHeightfield): void;
|
|
132
|
+
/**
|
|
133
|
+
* Draws the distance field of a compact heightfield using the debug drawer utilities.
|
|
134
|
+
* @param chf The compact heightfield to draw the distance for.
|
|
135
|
+
*/
|
|
136
|
+
drawCompactHeightfieldDistance(chf: RecastCompactHeightfield): void;
|
|
137
|
+
/**
|
|
138
|
+
* Draws a heightfield layer using the debug drawer utilities.
|
|
139
|
+
* @param layer The heightfield layer to draw.
|
|
140
|
+
* @param idx The index of the layer to draw.
|
|
141
|
+
*/
|
|
142
|
+
drawHeightfieldLayer(layer: RecastHeightfieldLayer, idx: number): void;
|
|
143
|
+
/**
|
|
144
|
+
* Draws the layers of a heightfield using the debug drawer utilities.
|
|
145
|
+
* @param lset The heightfield layer set containing the layers to draw.
|
|
146
|
+
*/
|
|
147
|
+
drawHeightfieldLayers(lset: RecastHeightfieldLayerSet): void;
|
|
148
|
+
/**
|
|
149
|
+
* Draws the region connections of a RecastContourSet using the debug drawer utilities.
|
|
150
|
+
* @param cset RecastContourSet to draw
|
|
151
|
+
* @param alpha The alpha value for the drawn contours, default is 1.
|
|
152
|
+
*/
|
|
153
|
+
drawRegionConnections(cset: RecastContourSet, alpha?: number): void;
|
|
154
|
+
/**
|
|
155
|
+
* Draws raw contours from a RecastContourSet using the debug drawer utilities.
|
|
156
|
+
* @param cset RecastContourSet to draw
|
|
157
|
+
* @param alpha The alpha value for the drawn contours, default is 1.
|
|
158
|
+
*/
|
|
159
|
+
drawRawContours(cset: RecastContourSet, alpha?: number): void;
|
|
160
|
+
/**
|
|
161
|
+
* Draws contours from a RecastContourSet using the debug drawer utilities.
|
|
162
|
+
* @param cset RecastContourSet to draw
|
|
163
|
+
* @param alpha The alpha value for the drawn contours, default is 1.
|
|
164
|
+
*/
|
|
165
|
+
drawContours(cset: RecastContourSet, alpha?: number): void;
|
|
166
|
+
/**
|
|
167
|
+
* Draws a poly mesh using the debug drawer utilities.
|
|
168
|
+
* @param mesh RecastPolyMesh to draw
|
|
169
|
+
*/
|
|
170
|
+
drawPolyMesh(mesh: RecastPolyMesh): void;
|
|
171
|
+
/**
|
|
172
|
+
* Draws a poly mesh detail using the debug drawer utilities.
|
|
173
|
+
* @param dmesh RecastPolyMeshDetail to draw
|
|
174
|
+
*/
|
|
175
|
+
drawPolyMeshDetail(dmesh: RecastPolyMeshDetail): void;
|
|
176
|
+
/**
|
|
177
|
+
* Draws a NavMesh using the debug drawer utilities.
|
|
178
|
+
* @param mesh NavMesh to draw
|
|
179
|
+
* @param flags Flags to control the drawing behavior, default is 0.
|
|
180
|
+
*/
|
|
181
|
+
drawNavMesh(mesh: NavMesh, flags?: number): void;
|
|
182
|
+
/**
|
|
183
|
+
* Draws a NavMesh with closed list using the debug drawer utilities.
|
|
184
|
+
* @param mesh NavMesh to draw
|
|
185
|
+
* @param query NavMeshQuery to use for drawing the closed list.
|
|
186
|
+
* @param flags Flags to control the drawing behavior, default is 0.
|
|
187
|
+
*/
|
|
188
|
+
drawNavMeshWithClosedList(mesh: NavMesh, query: NavMeshQuery, flags?: number): void;
|
|
189
|
+
/**
|
|
190
|
+
* Draws the nodes of a NavMesh using the debug drawer utilities.
|
|
191
|
+
* @param query NavMeshQuery to use for drawing the nodes.
|
|
192
|
+
*/
|
|
193
|
+
drawNavMeshNodes(query: NavMeshQuery): void;
|
|
194
|
+
/**
|
|
195
|
+
* Draws the bounding volume tree of a NavMesh using the debug drawer utilities.
|
|
196
|
+
* @param mesh NavMesh to draw the bounding volume tree for.
|
|
197
|
+
*/
|
|
198
|
+
drawNavMeshBVTree(mesh: NavMesh): void;
|
|
199
|
+
/**
|
|
200
|
+
* Draws the portals of a NavMesh using the debug drawer utilities.
|
|
201
|
+
* @param mesh NavMesh to draw the portals for.
|
|
202
|
+
*/
|
|
203
|
+
drawNavMeshPortals(mesh: NavMesh): void;
|
|
204
|
+
/**
|
|
205
|
+
* Draws polygons of a NavMesh with specific flags using the debug drawer utilities.
|
|
206
|
+
* @param mesh NavMesh to draw the polygons with specific flags.
|
|
207
|
+
* @param flags The flags to filter the polygons to be drawn.
|
|
208
|
+
* @param col The color to use for the drawn polygons, represented as a number.
|
|
209
|
+
*/
|
|
210
|
+
drawNavMeshPolysWithFlags(mesh: NavMesh, flags: number, col: number): void;
|
|
211
|
+
/**
|
|
212
|
+
* Draws polygons of a NavMesh with specific reference and color using the debug drawer utilities.
|
|
213
|
+
* @param mesh NavMesh to draw the polygons with specific reference and color.
|
|
214
|
+
* @param ref The reference number of the polygons to be drawn.
|
|
215
|
+
* @param col The color to use for the drawn polygons, represented as a number.
|
|
216
|
+
*/
|
|
217
|
+
drawNavMeshPoly(mesh: NavMesh, ref: number, col: number): void;
|
|
218
|
+
/**
|
|
219
|
+
* Get the intermediates from the generator
|
|
220
|
+
* @param intermediates - The generator intermediates
|
|
221
|
+
* @returns An object containing lists of heightfields, compact heightfields, contour sets
|
|
222
|
+
*/
|
|
223
|
+
getIntermediates: (intermediates: GeneratorIntermediates) => {
|
|
224
|
+
heightfieldList: RecastHeightfield[];
|
|
225
|
+
compactHeightfieldList: RecastCompactHeightfield[];
|
|
226
|
+
contourSetList: RecastContourSet[];
|
|
227
|
+
polyMeshList: RecastPolyMesh[];
|
|
228
|
+
polyMeshDetailList: RecastPolyMeshDetail[];
|
|
229
|
+
};
|
|
230
|
+
/**
|
|
231
|
+
* Draw debug information based on the selected option
|
|
232
|
+
* @param navMesh - The navigation mesh to draw
|
|
233
|
+
* @param intermediates - The generator intermediates containing the data to draw
|
|
234
|
+
* @param scene - The scene to draw in
|
|
235
|
+
* @param option - The debug drawer option to use
|
|
236
|
+
* @remarks This method will reset the debug drawer before drawing.
|
|
237
|
+
*/
|
|
238
|
+
draw(navMesh: NavMesh, intermediates: GeneratorIntermediates, scene: Scene, option: DebugLayerOptions): void;
|
|
239
|
+
private _drawPoints;
|
|
240
|
+
private _drawLines;
|
|
241
|
+
private _drawTris;
|
|
242
|
+
private _drawQuads;
|
|
243
|
+
/**
|
|
244
|
+
* Merge the debug meshes for better performance
|
|
245
|
+
*/
|
|
246
|
+
private _joinDebugMeshes;
|
|
247
|
+
private _convertUnindexedToIndexed;
|
|
248
|
+
}
|