babylonjs-addons 8.29.0 → 8.29.2

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.
@@ -3,272 +3,1700 @@ declare module "babylonjs-addons/index" {
3
3
  export * from "babylonjs-addons/atmosphere/index";
4
4
  export * from "babylonjs-addons/htmlMesh/index";
5
5
  export * from "babylonjs-addons/msdfText/index";
6
+ export * from "babylonjs-addons/navigation/index";
6
7
 
7
8
  }
8
- declare module "babylonjs-addons/msdfText/textRenderer" {
9
- import { AbstractEngine } from "babylonjs/Engines/abstractEngine";
10
- import { IDisposable } from "babylonjs/scene";
9
+ declare module "babylonjs-addons/navigation/types" {
10
+
11
+
12
+ import { IVector3Like } from "babylonjs/Maths/math.like";
13
+ import { Vector3 } from "babylonjs/Maths/math.vector";
14
+ import { IAgentParameters, INavMeshParameters } from "babylonjs/Navigation/INavigationEngine";
11
15
  import { Nullable } from "babylonjs/types";
12
- import { FontAsset } from "babylonjs-addons/msdfText/fontAsset";
13
- import { ParagraphOptions } from "babylonjs-addons/msdfText/paragraphOptions";
14
- import { IColor4Like, IMatrixLike } from "babylonjs/Maths/math.like";
15
16
  /**
16
- * Abstract Node class from Babylon.js
17
+ * Recast injection type
17
18
  */
18
- export interface INodeLike {
19
- getWorldMatrix(): IMatrixLike;
20
- }
19
+ export type RecastInjection = any;
21
20
  /**
22
- * Class used to render text using MSDF (Multi-channel Signed Distance Field) technique
23
- * Thanks a lot to the work of Bhushan_Wagh and zb_sj for their amazing work on MSDF for Babylon.js
24
- * #6RLCWP#16
25
- * Star wars scroller: #6RLCWP#29
26
- * With metrics: #6RLCWP#35
27
- * Thickness: #IABMEZ#3
28
- * Solar system: #9YCDYC#9
29
- * Stroke: #6RLCWP#37
21
+ * Off-mesh connection data
30
22
  */
31
- export class TextRenderer implements IDisposable {
32
- private readonly _useVAO;
33
- private _engine;
34
- private _shaderLanguage;
35
- private _vertexBuffers;
36
- private _spriteBuffer;
37
- private _worldBuffer;
38
- private _uvBuffer;
39
- private _drawWrapperBase;
40
- private _vertexArrayObject;
41
- private _font;
42
- private _charMatrices;
43
- private _charUvs;
44
- private _isDirty;
45
- private _baseLine;
46
- private _scalingMatrix;
47
- private _fontScaleMatrix;
48
- private _offsetMatrix;
49
- private _translationMatrix;
50
- private _baseMatrix;
51
- private _scaledMatrix;
52
- private _localMatrix;
53
- private _finalMatrix;
54
- private _lineMatrix;
55
- private _parentWorldMatrix;
23
+ export interface IOffMeshConnection {
56
24
  /**
57
- * Gets or sets the color of the text
25
+ * The start position of the off-mesh connection.
58
26
  */
59
- color: IColor4Like;
27
+ startPosition: IVector3Like;
60
28
  /**
61
- * Gets or sets the color of the stroke around the text
29
+ * The end position of the off-mesh connection.
62
30
  */
63
- strokeColor: IColor4Like;
31
+ endPosition: IVector3Like;
64
32
  /**
65
- * Gets or sets the width of the stroke around the text (inset)
33
+ * The radius of the off-mesh connection.
66
34
  */
67
- strokeInsetWidth: number;
35
+ radius: number;
68
36
  /**
69
- * Gets or sets the width of the stroke around the text (outset)
37
+ * The type of the off-mesh connection.
70
38
  */
71
- strokeOutsetWidth: number;
39
+ bidirectional: boolean;
72
40
  /**
73
- * Gets or sets the thickness of the text (0 means as defined in the font)
74
- * Value must be between -0.5 and 0.5
41
+ * The area type of the off-mesh connection.
75
42
  */
76
- thicknessControl: number;
77
- private _parent;
43
+ area: number;
78
44
  /**
79
- * Gets or sets the parent of the text renderer
45
+ * The flags of the off-mesh connection.
80
46
  */
81
- get parent(): Nullable<INodeLike>;
82
- set parent(value: Nullable<INodeLike>);
83
- private _transformMatrix;
47
+ flags: number;
84
48
  /**
85
- * Gets or sets the transform matrix of the text renderer
86
- * It will be applied in that order:
87
- * parent x transform x paragraph world
49
+ * The user ID of the off-mesh connection.
50
+ * @remarks This can be used to associate the off-mesh connection with a specific user
88
51
  */
89
- get transformMatrix(): IMatrixLike;
90
- set transformMatrix(value: IMatrixLike);
52
+ userId?: number;
53
+ }
54
+ /**
55
+ * Result of a navigation mesh creation.
56
+ */
57
+ export type CreateNavMeshResult = Nullable<{
91
58
  /**
92
- * Gets or sets if the text is billboarded
59
+ * Navigation mesh
93
60
  */
94
- isBillboard: boolean;
61
+ navMesh: any;
95
62
  /**
96
- * Gets or sets if the text is screen projected
97
- * This will work only if the text is billboarded
63
+ * Navigation mesh query
98
64
  */
99
- isBillboardScreenProjected: boolean;
65
+ navMeshQuery: any;
100
66
  /**
101
- * Gets the number of characters in the text renderer
67
+ * Intermediates generated during the any creation process.
68
+ * @remarks This is only available if the `keepIntermediates` parameter is set to true in the `INavMeshParametersV2`.
69
+ * It can be used for debugging or visualization purposes.
102
70
  */
103
- get characterCount(): number;
71
+ intermediates?: GeneratorIntermediates;
104
72
  /**
105
- * Gets or sets if the text renderer should ignore the depth buffer
106
- * Default is false
73
+ * Tile cache generated during the any creation process.
74
+ * @remarks This is only available if the `maxObstacles` parameter is set to a value greater than 0 in the `INavMeshParametersV2`. Defaults `maxObstacles` to 128.
75
+ * It can be used for obstacle avoidance and dynamic navigation mesh updates.
76
+ * @see {@link INavMeshParametersV2}
107
77
  */
108
- ignoreDepthBuffer: boolean;
109
- private constructor();
110
- private _resizeBuffers;
111
- private _setShaders;
78
+ tileCache?: any;
79
+ }>;
80
+ /**
81
+ * Agent parameters
82
+ * For actual limits and default values check the recast-navigation-js docs.
83
+ * @see https://docs.recast-navigation-js.isaacmason.com/types/index.CrowdAgentParams.html
84
+ */
85
+ export interface IAgentParametersV2 extends IAgentParameters {
112
86
  /**
113
- * Add a paragraph of text to the renderer
114
- * @param text define the text to add
115
- * @param options define the options to use for the paragraph (optional)
116
- * @param worldMatrix define the world matrix to use for the paragraph (optional)
87
+ * Flags that impact steering behavior.
117
88
  */
118
- addParagraph(text: string, options?: Partial<ParagraphOptions>, worldMatrix?: IMatrixLike): void;
89
+ updateFlags: number;
119
90
  /**
120
- * Render the text using the provided view and projection matrices
121
- * @param viewMatrix define the view matrix to use
122
- * @param projectionMatrix define the projection matrix to use
91
+ * The index of the avoidance configuration to use for the agent. [Limits: 0 to #DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS inclusive]
123
92
  */
124
- render(viewMatrix: IMatrixLike, projectionMatrix: IMatrixLike): void;
93
+ obstacleAvoidanceType: number;
125
94
  /**
126
- * Release associated resources
95
+ * The index of the query filter used by this agent.
127
96
  */
128
- dispose(): void;
97
+ queryFilterType: number;
129
98
  /**
130
- * Creates a new TextRenderer instance asynchronously
131
- * @param font define the font asset to use
132
- * @param engine define the engine to use
133
- * @returns a promise that resolves to the created TextRenderer instance
99
+ * User defined data attached to the agent.
134
100
  */
135
- static CreateTextRendererAsync(font: FontAsset, engine: AbstractEngine): Promise<TextRenderer>;
101
+ userData: unknown;
136
102
  }
137
-
103
+ /**
104
+ * any parameters
105
+ * For actual limits and default values check the recast-navigation-js docs.
106
+ * @see https://docs.recast-navigation-js.isaacmason.com/types/index.RecastConfig.html
107
+ */
108
+ export interface INavMeshParametersV2 extends INavMeshParameters {
109
+ /**
110
+ * OffMeshConnections - Teleports
111
+ */
112
+ offMeshConnections?: IOffMeshConnection[];
113
+ /**
114
+ * Whether to keep intermediate navigation mesh data for debug visualization. Default is false.
115
+ */
116
+ keepIntermediates?: boolean;
117
+ /**
118
+ * The maximum number of obstacles that can be added to the navigation mesh. Default is 32.
119
+ * If this value is greater then 0, the navigation mesh will be generated with a tile cache.
120
+ */
121
+ maxObstacles?: number;
122
+ /**
123
+ * The size of each tile in the tiled navigation mesh. Default is 32.
124
+ */
125
+ expectedLayersPerTile?: number;
126
+ /**
127
+ * Function which is sets the polyAreas and polyFlags for the tile cache mesh. Defaults to a function that sets all areas to 0 and flags to 1.
128
+ */
129
+ tileCacheMeshProcess?: any;
138
130
  }
139
- declare module "babylonjs-addons/msdfText/paragraphOptions" {
140
- import { IVector2Like } from "babylonjs/Maths/math.like";
141
- /** @internal */
142
- export type ParagraphOptions = {
143
- maxWidth: number;
144
- lineHeight: number;
145
- letterSpacing: number;
146
- tabSize: number;
147
- whiteSpace: "pre-line";
148
- textAlign: "left" | "right" | "center";
149
- translate: IVector2Like | undefined;
131
+ /**
132
+ * Result of a steer target computation.
133
+ */
134
+ export type SteerTargetResult = {
135
+ /**
136
+ * Indicates whether the steering target computation was successful.
137
+ */
138
+ success: false;
139
+ } | {
140
+ /**
141
+ * Indicates whether the steering target computation was successful.
142
+ */
143
+ success: true;
144
+ /**
145
+ * The position to steer towards.
146
+ */
147
+ steerPos: Vector3;
148
+ /**
149
+ * The flag indicating the type of steering position.
150
+ */
151
+ steerPosFlag: number;
152
+ /**
153
+ * The reference to the polygon that the steering position is associated with.
154
+ */
155
+ steerPosRef: number;
156
+ /**
157
+ * The points that make up the path to the steering position.
158
+ */
159
+ points: Vector3[];
150
160
  };
151
- /** @internal */
152
- export const DefaultParagraphOptions: ParagraphOptions;
153
-
154
- }
155
- declare module "babylonjs-addons/msdfText/index" {
156
- export * from "babylonjs-addons/msdfText/fontAsset";
157
- export * from "babylonjs-addons/msdfText/paragraphOptions";
158
- export * from "babylonjs-addons/msdfText/textRenderer";
159
- export * from "babylonjs-addons/msdfText/sdf/index";
160
- export * from "babylonjs-addons/msdfText/shaders/msdf.vertex";
161
- export * from "babylonjs-addons/msdfText/shaders/msdf.fragment";
162
- export * from "babylonjs-addons/msdfText/shadersWGSL/msdf.vertex";
163
- export * from "babylonjs-addons/msdfText/shadersWGSL/msdf.fragment";
164
-
165
- }
166
- declare module "babylonjs-addons/msdfText/fontAsset" {
167
- import { IDisposable, Scene } from "babylonjs/scene";
168
- import { BMFontChar } from "babylonjs-addons/msdfText/sdf/bmFont";
169
- import { SdfFont } from "babylonjs-addons/msdfText/sdf/font";
170
- import { Texture } from "babylonjs/Materials/Textures/texture";
171
161
  /**
172
- * Class representing a font asset for SDF (Signed Distance Field) rendering.
162
+ * Error types for path computation.
173
163
  */
174
- export class FontAsset implements IDisposable {
175
- private readonly _chars;
176
- private readonly _charsRegex;
177
- private readonly _kernings;
178
- /** @internal */
179
- readonly _font: SdfFont;
164
+ export const ComputePathError: {
165
+ START_NEAREST_POLY_FAILED: string;
166
+ END_NEAREST_POLY_FAILED: string;
167
+ FIND_PATH_FAILED: string;
168
+ NO_POLYGON_PATH_FOUND: string;
169
+ NO_CLOSEST_POINT_ON_LAST_POLYGON_FOUND: string;
170
+ };
171
+ export type ComputePathErrorType = (typeof ComputePathError)[keyof typeof ComputePathError];
172
+ /**
173
+ * Result of a path computation.
174
+ */
175
+ export type ComputePathResult = {
180
176
  /**
181
- * Gets the font scale value
177
+ * Indicates whether the path computation was successful.
182
178
  */
183
- readonly scale: number;
179
+ success: boolean;
184
180
  /**
185
- * Gets the list of used textures
181
+ * The error message if the path computation failed.
186
182
  */
187
- readonly textures: Texture[];
183
+ error?: {
184
+ /**
185
+ * A descriptive error message.
186
+ */
187
+ name?: string;
188
+ /**
189
+ * The type of error that occurred during path computation.
190
+ * @remarks This will be one of the values from `ComputePathError`
191
+ */
192
+ type?: ComputePathErrorType;
193
+ /**
194
+ * Statusring describing the error.
195
+ */
196
+ status?: number;
197
+ };
188
198
  /**
189
- * Creates a new FontAsset instance.
190
- * @param definitionData defines the font data in JSON format.
191
- * @param textureUrl defines the url of the texture to use for the font.
192
- * @param scene defines the hosting scene.
199
+ * The computed path as an array of Vector3 points.
193
200
  */
194
- constructor(definitionData: string, textureUrl: string, scene?: Scene);
195
- dispose(): void;
196
- private _updateFallbacks;
197
- /** @internal */
198
- _getChar(charCode: number): BMFontChar;
199
- /** @internal */
200
- _getKerning(first: number, second: number): number;
201
- /** @internal */
202
- _unsupportedChars(text: string): string;
203
- }
204
-
205
- }
206
- declare module "babylonjs-addons/msdfText/shadersWGSL/msdf.vertex" {
207
- /** @internal */
208
- export const msdfVertexShaderWGSL: {
209
- name: string;
210
- shader: string;
201
+ path: IVector3Like[];
211
202
  };
203
+ /**
204
+ * Intermediates generated during the any creation process.
205
+ * @remarks This is only available if the `keepIntermediates` parameter is set to true in the `INavMeshParametersV2`.
206
+ * It can be used for debugging or visualization purposes.
207
+ */
208
+ export type GeneratorIntermediates = any | any | any | null;
212
209
 
213
210
  }
214
- declare module "babylonjs-addons/msdfText/shadersWGSL/msdf.fragment" {
215
- /** @internal */
216
- export const msdfPixelShaderWGSL: {
217
- name: string;
218
- shader: string;
219
- };
211
+ declare module "babylonjs-addons/navigation/index" {
212
+ export * from "babylonjs-addons/navigation/plugin/index";
213
+ export * from "babylonjs-addons/navigation/factory/index";
214
+ export * from "babylonjs-addons/navigation/common/index";
215
+ export * from "babylonjs-addons/navigation/generator/index";
216
+ export * from "babylonjs-addons/navigation/debug/index";
220
217
 
221
218
  }
222
- declare module "babylonjs-addons/msdfText/shaders/msdf.vertex" {
223
- /** @internal */
224
- export const msdfVertexShader: {
225
- name: string;
226
- shader: string;
227
- };
219
+ declare module "babylonjs-addons/navigation/worker/navmesh-worker" {
220
+ /**
221
+ * Generates a navigation mesh in a web worker.
222
+ */
223
+ export function GenerateNavMeshWorker(): void;
228
224
 
229
225
  }
230
- declare module "babylonjs-addons/msdfText/shaders/msdf.fragment" {
231
- /** @internal */
232
- export const msdfPixelShader: {
233
- name: string;
234
- shader: string;
235
- };
226
+ declare module "babylonjs-addons/navigation/plugin/index" {
227
+ export * from "babylonjs-addons/navigation/plugin/RecastNavigationJSPlugin";
236
228
 
237
229
  }
238
- declare module "babylonjs-addons/msdfText/sdf/paragraph" {
239
- import { FontAsset } from "babylonjs-addons/msdfText/fontAsset";
240
- import { type ParagraphOptions } from "babylonjs-addons/msdfText/paragraphOptions";
241
- import { SdfGlyph } from "babylonjs-addons/msdfText/sdf/glyph";
242
- import { SdfTextLine } from "babylonjs-addons/msdfText/sdf/line";
243
- /** @internal */
244
- export class SdfTextParagraph {
245
- readonly text: string;
246
- readonly fontAsset: FontAsset;
247
- readonly options: ParagraphOptions;
248
- get lineHeight(): number;
249
- readonly paragraph: string;
250
- readonly lines: SdfTextLine[];
251
- readonly width: number;
252
- readonly height: number;
253
- readonly glyphs: SdfGlyph[];
254
- constructor(text: string, fontAsset: FontAsset, options?: Partial<ParagraphOptions>);
255
- private _computeMetrics;
256
- private _breakLines;
257
- private _collapse;
258
- private _wrap;
259
- }
230
+ declare module "babylonjs-addons/navigation/plugin/RecastNavigationJSPlugin" {
260
231
 
261
- }
262
- declare module "babylonjs-addons/msdfText/sdf/line" {
263
- import { SdfGlyph } from "babylonjs-addons/msdfText/sdf/glyph";
264
- /** @internal */
265
- export type SdfTextLine = {
266
- text: string;
267
- glyphs: SdfGlyph[];
268
- start: number;
269
- end: number;
270
- width: number;
271
- };
232
+ import { ICrowd, INavigationEnginePlugin, IObstacle } from "babylonjs/Navigation/INavigationEngine";
233
+ import { Mesh } from "babylonjs/Meshes/mesh";
234
+ import { Scene } from "babylonjs/scene";
235
+ import { Vector3 } from "babylonjs/Maths/math";
236
+ import { IVector3Like } from "babylonjs/Maths/math.like";
237
+ import { Nullable } from "babylonjs/types";
238
+ import { CreateNavMeshResult, GeneratorIntermediates, INavMeshParametersV2, RecastInjection } from "babylonjs-addons/navigation/types";
239
+ /**
240
+ * Navigation plugin for Babylon.js. It is a simple wrapper around the recast-navigation-js library. Not all features are implemented.
241
+ * @remarks This plugin provides navigation mesh generation and pathfinding capabilities using the recast-navigation-js library
242
+ * @remarks It supports both single-threaded and multi-threaded generation of navigation meshes.
243
+ * @remarks The plugin can be used to create navigation meshes from meshes in a scene, compute paths, and manage crowd agents, etc.
244
+ * @remarks It also provides methods for creating obstacles and querying the navigation mesh.
245
+ * @see https://github.com/isaac-mason/recast-navigation-js
246
+ */
247
+ export class RecastNavigationJSPluginV2 implements INavigationEnginePlugin {
248
+ /**
249
+ * Creates a navigation mesh - will be injected by the factory
250
+ * @param meshes array of all the geometry used to compute the navigation mesh
251
+ * @param parameters bunch of parameters used to filter geometry
252
+ * @returns the created navmesh and navmesh query
253
+ */
254
+ createNavMeshImpl: (meshes: Array<Mesh>, parameters: INavMeshParametersV2) => CreateNavMeshResult;
255
+ /**
256
+ * Creates a navigation mesh - will be injected by the factory
257
+ * @param meshes array of all the geometry used to compute the navigation mesh
258
+ * @param parameters bunch of parameters used to filter geometry
259
+ * @returns the created navmesh and navmesh query
260
+ */
261
+ createNavMeshAsyncImpl: (meshes: Array<Mesh>, parameters: INavMeshParametersV2) => Promise<CreateNavMeshResult>;
262
+ /**
263
+ * recast-navigation-js injection
264
+ */
265
+ bjsRECAST: RecastInjection;
266
+ /**
267
+ * plugin name
268
+ */
269
+ name: string;
270
+ /**
271
+ * the navmesh created
272
+ */
273
+ navMesh?: any;
274
+ /**
275
+ * The navmesh query created from the navmesh
276
+ * @remarks This is used to query the navmesh for pathfinding and other navigation tasks
277
+ */
278
+ get navMeshQuery(): any;
279
+ private _navMeshQuery;
280
+ /**
281
+ * Intermediates generated during the navmesh creation
282
+ * @remarks This is used for debugging and visualization purposes.
283
+ * @remarks You have access to vertices, indices and vertex colors to visusalize the navmesh creation process.
284
+ * @remarks This is only available if the `keepIntermediates` parameter is set
285
+ * @remarks to true during navmesh generation.
286
+ */
287
+ private _intermediates?;
288
+ /**
289
+ * Gets the intermediates generated during the navmesh creation
290
+ * @returns The generator intermediates, or undefined if not available
291
+ */
292
+ get intermediates(): GeneratorIntermediates | undefined;
293
+ /**
294
+ * Tile cache used for tiled navigation meshes
295
+ * @remarks This is used to store and manage tiles of the navigation mesh for efficient path and when obstacles are used.
296
+ */
297
+ private _tileCache?;
298
+ /**
299
+ * Gets the tile cache used for tiled navigation meshes
300
+ * @returns The tile cache instance, or undefined if not available
301
+ */
302
+ get tileCache(): any | undefined;
303
+ private _maximumSubStepCount;
304
+ private _timeStep;
305
+ private _timeFactor;
306
+ private _crowd?;
307
+ /**
308
+ * Creates a RecastNavigationJSPluginV2 instance
309
+ * @param recastInjection The recast-navigation-js injection containing core and generators
310
+ */
311
+ constructor(recastInjection?: RecastInjection);
312
+ /**
313
+ * Set the time step of the navigation tick update.
314
+ * Default is 1/60.
315
+ * A value of 0 will disable fixed time update
316
+ * @param newTimeStep the new timestep to apply to this world.
317
+ */
318
+ setTimeStep(newTimeStep?: number): void;
319
+ /**
320
+ * Get the time step of the navigation tick update.
321
+ * @returns the current time step
322
+ */
323
+ getTimeStep(): number;
324
+ /**
325
+ * If delta time in navigation tick update is greater than the time step
326
+ * a number of sub iterations are done. If more iterations are need to reach deltatime
327
+ * they will be discarded.
328
+ * A value of 0 will set to no maximum and update will use as many substeps as needed
329
+ * @param newStepCount the maximum number of iterations
330
+ */
331
+ setMaximumSubStepCount(newStepCount?: number): void;
332
+ /**
333
+ * Get the maximum number of iterations per navigation tick update
334
+ * @returns the maximum number of iterations
335
+ */
336
+ getMaximumSubStepCount(): number;
337
+ /**
338
+ * Time factor applied when updating crowd agents (default 1). A value of 0 will pause crowd updates.
339
+ * @param value the time factor applied at update
340
+ */
341
+ set timeFactor(value: number);
342
+ /**
343
+ * Get the time factor used for crowd agent update
344
+ * @returns the time factor
345
+ */
346
+ get timeFactor(): number;
347
+ /**
348
+ * Creates a navigation mesh - will be injected by the factory
349
+ * @param meshes array of all the geometry used to compute the navigation mesh
350
+ * @param parameters bunch of parameters used to filter geometry
351
+ * @returns the created navmesh and navmesh query
352
+ * @throws Error if the function is not injected yet or if the navmesh is not created
353
+ */
354
+ createNavMesh(meshes: Array<Mesh>, parameters: INavMeshParametersV2): CreateNavMeshResult;
355
+ /**
356
+ * Creates a navigation mesh asynchronously - will be injected by the factory
357
+ * @param meshes array of all the geometry used to compute the navigation mesh
358
+ * @param parameters bunch of parameters used to filter geometry
359
+ * @returns the created navmesh and navmesh query
360
+ * @throws Error if the function is not injected yet or if the navmesh is not created
361
+ */
362
+ createNavMeshAsync(meshes: Array<Mesh>, parameters: INavMeshParametersV2): Promise<CreateNavMeshResult>;
363
+ /**
364
+ * Create a navigation mesh debug mesh
365
+ * @param scene is where the mesh will be added
366
+ * @returns debug display mesh
367
+ */
368
+ createDebugNavMesh(scene: Scene): Mesh;
369
+ /**
370
+ * Get a navigation mesh constrained position, closest to the parameter position
371
+ * @param position world position
372
+ * @returns the closest point to position constrained by the navigation mesh
373
+ */
374
+ getClosestPoint(position: IVector3Like, options?: {
375
+ /**
376
+ * The polygon filter to apply to the query.
377
+ */
378
+ filter?: any;
379
+ /**
380
+ * Half extents for the search box
381
+ */
382
+ halfExtents?: IVector3Like;
383
+ }): Vector3;
384
+ /**
385
+ * Get a navigation mesh constrained position, closest to the parameter position
386
+ * @param position world position
387
+ * @param result output the closest point to position constrained by the navigation mesh
388
+ */
389
+ getClosestPointToRef(position: IVector3Like, result: Vector3, options?: {
390
+ /**
391
+ * The polygon filter to apply to the query.
392
+ */
393
+ filter?: any;
394
+ /**
395
+ * Half extents for the search box
396
+ */
397
+ halfExtents?: IVector3Like;
398
+ }): void;
399
+ /**
400
+ * Get a navigation mesh constrained position, within a particular radius
401
+ * @param position world position
402
+ * @param maxRadius the maximum distance to the constrained world position
403
+ * @returns the closest point to position constrained by the navigation mesh
404
+ */
405
+ getRandomPointAround(position: IVector3Like, maxRadius: number, options?: {
406
+ startRef?: number;
407
+ /**
408
+ * The polygon filter to apply to the query.
409
+ */
410
+ filter?: any;
411
+ /**
412
+ * Half extents for the search box
413
+ */
414
+ halfExtents?: IVector3Like;
415
+ }): Vector3;
416
+ /**
417
+ * Get a navigation mesh constrained position, within a particular radius
418
+ * @param position world position
419
+ * @param maxRadius the maximum distance to the constrained world position
420
+ * @param result output the closest point to position constrained by the navigation mesh
421
+ */
422
+ getRandomPointAroundToRef(position: IVector3Like, maxRadius: number, result: Vector3, options?: {
423
+ startRef?: number;
424
+ /**
425
+ * The polygon filter to apply to the query.
426
+ */
427
+ filter?: any;
428
+ /**
429
+ * Half extents for the search box
430
+ */
431
+ halfExtents?: IVector3Like;
432
+ }): void;
433
+ /**
434
+ * Compute the final position from a segment made of destination-position
435
+ * @param position position to start from
436
+ * @param destination position to go to
437
+ * @param startRef the reference id of the start polygon
438
+ * @param options options for the function
439
+ * @returns the resulting point along the navmesh
440
+ */
441
+ moveAlong(position: IVector3Like, destination: IVector3Like, startRef?: number, options?: {
442
+ /**
443
+ * The polygon filter to apply to the query.
444
+ */
445
+ filter?: any;
446
+ /**
447
+ * The maximum number of polygons the output visited array can hold.
448
+ */
449
+ maxVisitedSize?: number;
450
+ }): Vector3;
451
+ /**
452
+ * Compute the final position from a segment made of destination-position
453
+ * @param position world position
454
+ * @param destination world position
455
+ * @param result output the resulting point along the navmesh
456
+ * @param startRef the reference id of the start polygon.
457
+ * @param options options for the function
458
+ */
459
+ moveAlongToRef(position: IVector3Like, destination: IVector3Like, result: Vector3, startRef?: number, options?: {
460
+ /**
461
+ * The polygon filter to apply to the query.
462
+ */
463
+ filter?: any;
464
+ maxVisitedSize?: number;
465
+ }): void;
466
+ /**
467
+ * Compute a navigation path from start to end. Returns an empty array if no path can be computed
468
+ * Path is straight.
469
+ * @param start world position
470
+ * @param end world position
471
+ * @param options options for the function
472
+ * @returns array containing world position composing the path
473
+ */
474
+ computePath(start: IVector3Like, end: IVector3Like, options?: {
475
+ /**
476
+ * The polygon filter to apply to the query.
477
+ */
478
+ filter?: any;
479
+ /**
480
+ * Half extents for the search box
481
+ */
482
+ halfExtents?: IVector3Like;
483
+ maxPathPolys?: number;
484
+ maxStraightPathPoints?: number;
485
+ }): Vector3[];
486
+ /**
487
+ * Creates a navigation mesh - will be injected by the factory
488
+ * @param start the start position of the navmesh
489
+ * @param end the end position of the navmesh
490
+ * @param options options to configure the path computation
491
+ * @returns array containing world position composing the path
492
+ */
493
+ computePathSmooth(start: Vector3, end: Vector3, options?: {
494
+ /**
495
+ * The polygon filter to apply to the query.
496
+ */
497
+ filter?: any;
498
+ /**
499
+ * Half extents for the search box
500
+ */
501
+ halfExtents?: IVector3Like;
502
+ maxPathPolys?: number;
503
+ maxSmoothPathPoints?: number;
504
+ stepSize?: number;
505
+ slop?: number;
506
+ }): Vector3[];
507
+ /**
508
+ * Create a new Crowd so you can add agents
509
+ * @param maxAgents the maximum agent count in the crowd
510
+ * @param maxAgentRadius the maximum radius an agent can have
511
+ * @param scene to attach the crowd to
512
+ * @returns the crowd you can add agents to
513
+ */
514
+ createCrowd(maxAgents: number, maxAgentRadius: number, scene: Scene): ICrowd;
515
+ /**
516
+ * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)
517
+ * The queries will try to find a solution within those bounds
518
+ * default is (1,1,1)
519
+ * @param extent x,y,z value that define the extent around the queries point of reference
520
+ */
521
+ setDefaultQueryExtent(extent: IVector3Like): void;
522
+ /**
523
+ * Get the Bounding box extent specified by setDefaultQueryExtent
524
+ * @returns the box extent values
525
+ */
526
+ getDefaultQueryExtent(): Vector3;
527
+ /**
528
+ * Get the Bounding box extent result specified by setDefaultQueryExtent
529
+ * @param result output the box extent values
530
+ */
531
+ getDefaultQueryExtentToRef(result: Vector3): void;
532
+ /**
533
+ * build the navmesh from a previously saved state using getNavmeshData
534
+ * @param data the Uint8Array returned by getNavmeshData
535
+ */
536
+ buildFromNavmeshData(data: Uint8Array): void;
537
+ /**
538
+ * returns the navmesh data that can be used later. The navmesh must be built before retrieving the data
539
+ * @returns data the Uint8Array that can be saved and reused
540
+ */
541
+ getNavmeshData(): Uint8Array;
542
+ /**
543
+ * build the tile cache from a previously saved state using getTileCacheData
544
+ * @param tileCacheData the data returned by getTileCacheData
545
+ * @param tileCacheMeshProcess optional process to apply to each tile created
546
+ */
547
+ buildFromTileCacheData(tileCacheData: Uint8Array, tileCacheMeshProcess?: any): void;
548
+ /**
549
+ * returns the tile cache data that can be used later. The tile cache must be built before retrieving the data
550
+ * @returns the tile cache data that can be used later. The tile cache must be built before retrieving the data
551
+ * @throws Error if there is no any generated
552
+ * @remarks The returned data can be used to rebuild the tile cache later using buildFromTileCacheData
553
+ */
554
+ getTileCacheData(): Uint8Array;
555
+ /**
556
+ * Disposes
557
+ */
558
+ dispose(): void;
559
+ /**
560
+ * Creates a cylinder obstacle and add it to the navigation
561
+ * @param position world position
562
+ * @param radius cylinder radius
563
+ * @param height cylinder height
564
+ * @param doNotWaitForCacheUpdate if true the function will not wait for the tile cache to be fully updated before returning
565
+ * @returns the obstacle freshly created
566
+ */
567
+ addCylinderObstacle(position: IVector3Like, radius: number, height: number, doNotWaitForCacheUpdate?: boolean): Nullable<IObstacle>;
568
+ /**
569
+ * Creates an oriented box obstacle and add it to the navigation
570
+ * @param position world position
571
+ * @param extent box size
572
+ * @param angle angle in radians of the box orientation on Y axis
573
+ * @param doNotWaitForCacheUpdate if true the function will not wait for the tile cache to be fully updated before returning
574
+ * @returns the obstacle freshly created
575
+ */
576
+ addBoxObstacle(position: IVector3Like, extent: IVector3Like, angle: number, doNotWaitForCacheUpdate?: boolean): Nullable<IObstacle>;
577
+ /**
578
+ * Removes an obstacle created by addCylinderObstacle or addBoxObstacle
579
+ * @param obstacle obstacle to remove from the navigation
580
+ * @param doNotWaitForCacheUpdate if true the function will not wait for the tile cache to be fully updated before returning
581
+ *
582
+ */
583
+ removeObstacle(obstacle: IObstacle, doNotWaitForCacheUpdate?: boolean): void;
584
+ /**
585
+ * If this plugin is supported
586
+ * @returns true if plugin is supported
587
+ */
588
+ isSupported(): boolean;
589
+ /**
590
+ * Returns the seed used for randomized functions like `getRandomPointAround`
591
+ * @returns seed number
592
+ */
593
+ getRandomSeed(): number;
594
+ /**
595
+ * Set the seed used for randomized functions like `getRandomPointAround`
596
+ * @param seed number used as seed for random functions
597
+ */
598
+ setRandomSeed(seed: number): void;
599
+ /**
600
+ * Perform a raycast on the navmesh
601
+ * @param start start position
602
+ * @param end end position
603
+ * @returns if a direct path exists between start and end, and the hit point if any
604
+ */
605
+ raycast(start: IVector3Like, end: IVector3Like): {
606
+ hit: boolean;
607
+ hitPoint?: undefined;
608
+ } | {
609
+ hit: boolean;
610
+ hitPoint: Vector3;
611
+ };
612
+ /**
613
+ * Compute the final position from a segment made of destination-position, and return the height of the polygon
614
+ * This is a more sophisiticated version of moveAlong that will use the height of the polygon at the end position
615
+ * @param position world position to start from
616
+ * @param velocity wvelocity of the movement
617
+ * @param options options for the function
618
+ * @returns the resulting point along the navmesh, the polygon reference id and the height of the polygon
619
+ */
620
+ moveAlongWithVelocity(position: IVector3Like, velocity: IVector3Like, options?: {
621
+ /**
622
+ * The polygon filter to apply to the query.
623
+ */
624
+ filter?: any;
625
+ /**
626
+ * Half extents for the search box
627
+ */
628
+ halfExtents?: IVector3Like;
629
+ /**
630
+ * The maximum number of polygons the output visited array can hold.
631
+ */
632
+ maxVisitedSize?: number;
633
+ }): {
634
+ position: {
635
+ x: number;
636
+ y: number;
637
+ z: number;
638
+ };
639
+ polyRef: number;
640
+ height: number;
641
+ };
642
+ /**
643
+ * Handles common post-processing and validation of navmesh creation results
644
+ * @param result The partial result from navmesh creation
645
+ * @returns The validated and complete CreateNavMeshresult
646
+ */
647
+ private _processNavMeshResult;
648
+ private _preprocessParameters;
649
+ }
650
+
651
+ }
652
+ declare module "babylonjs-addons/navigation/plugin/RecastJSCrowd" {
653
+
654
+ import { IVector3Like } from "babylonjs/Maths/math.like";
655
+ import { TransformNode } from "babylonjs/Meshes/transformNode";
656
+ import { ICrowd } from "babylonjs/Navigation/INavigationEngine";
657
+ import { Vector3 } from "babylonjs/Maths/math.vector";
658
+ import { Observable } from "babylonjs/Misc/observable";
659
+ import { Scene } from "babylonjs/scene";
660
+ import { RecastNavigationJSPluginV2 } from "babylonjs-addons/navigation/plugin/RecastNavigationJSPlugin";
661
+ import { IAgentParametersV2 } from "babylonjs-addons/navigation/types";
662
+ /**
663
+ * Recast Detour crowd implementation
664
+ * This class provides methods to manage a crowd of agents, allowing them to navigate a navigation mesh.
665
+ * It supports adding agents, updating their parameters, moving them to destinations, and checking their states.
666
+ * The crowd is updated in the scene's animation loop, and it notifies observers when agents reach their destinations.
667
+ */
668
+ export class RecastJSCrowd implements ICrowd {
669
+ /**
670
+ * Recast plugin
671
+ */
672
+ get navigationPlugin(): RecastNavigationJSPluginV2;
673
+ /**
674
+ * Link to the detour crowd
675
+ */
676
+ get recastCrowd(): any;
677
+ /**
678
+ * One transform per agent
679
+ */
680
+ get transforms(): TransformNode[];
681
+ /**
682
+ * All agents created
683
+ */
684
+ get agents(): readonly number[];
685
+ /**
686
+ * Agents reach radius
687
+ */
688
+ get reachRadii(): readonly number[];
689
+ private _navigationPlugin;
690
+ private _recastCrowd;
691
+ private _transforms;
692
+ private _agents;
693
+ private _reachRadii;
694
+ /**
695
+ * true when a destination is active for an agent and notifier hasn't been notified of reach
696
+ */
697
+ private _agentDestinationArmed;
698
+ /**
699
+ * agent current target
700
+ */
701
+ private _agentDestination;
702
+ /**
703
+ * Link to the scene is kept to unregister the crowd from the scene
704
+ */
705
+ private _scene;
706
+ private _engine;
707
+ /**
708
+ * Observer for crowd updates
709
+ */
710
+ private _onBeforeAnimationsObserver;
711
+ /**
712
+ * Fires each time an agent is in reach radius of its destination
713
+ */
714
+ onReachTargetObservable: Observable<{
715
+ /**
716
+ *
717
+ */
718
+ agentIndex: number;
719
+ /**
720
+ *
721
+ */
722
+ destination: Vector3;
723
+ }>;
724
+ /**
725
+ * Constructor
726
+ * @param plugin recastJS plugin
727
+ * @param maxAgents the maximum agent count in the crowd
728
+ * @param maxAgentRadius the maximum radius an agent can have
729
+ * @param scene to attach the crowd to
730
+ * @returns the crowd you can add agents to
731
+ */
732
+ constructor(plugin: RecastNavigationJSPluginV2, maxAgents: number, maxAgentRadius: number, scene: Scene);
733
+ /**
734
+ * Add a new agent to the crowd with the specified parameter a corresponding transformNode.
735
+ * You can attach anything to that node. The node position is updated in the scene update tick.
736
+ * @param pos world position that will be constrained by the navigation mesh
737
+ * @param parameters agent parameters
738
+ * @param transform hooked to the agent that will be update by the scene
739
+ * @returns agent index
740
+ */
741
+ addAgent(pos: IVector3Like, parameters: IAgentParametersV2, transform: TransformNode): number;
742
+ /**
743
+ * Returns the agent position in world space
744
+ * @param index agent index returned by addAgent
745
+ * @returns world space position
746
+ */
747
+ getAgentPosition(index: number): Vector3;
748
+ /**
749
+ * Returns the agent position result in world space
750
+ * @param index agent index returned by addAgent
751
+ * @param result output world space position
752
+ */
753
+ getAgentPositionToRef(index: number, result: Vector3): void;
754
+ /**
755
+ * Returns the agent velocity in world space
756
+ * @param index agent index returned by addAgent
757
+ * @returns world space velocity
758
+ */
759
+ getAgentVelocity(index: number): Vector3;
760
+ /**
761
+ * Returns the agent velocity result in world space
762
+ * @param index agent index returned by addAgent
763
+ * @param result output world space velocity
764
+ */
765
+ getAgentVelocityToRef(index: number, result: Vector3): void;
766
+ /**
767
+ * Returns the agent next target point on the path
768
+ * @param index agent index returned by addAgent
769
+ * @returns world space position
770
+ */
771
+ getAgentNextTargetPath(index: number): Vector3;
772
+ /**
773
+ * Returns the agent next target point on the path
774
+ * @param index agent index returned by addAgent
775
+ * @param result output world space position
776
+ */
777
+ getAgentNextTargetPathToRef(index: number, result: Vector3): void;
778
+ /**
779
+ * Gets the agent state
780
+ * @param index agent index returned by addAgent
781
+ * @returns agent state, 0 = DT_CROWDAGENT_STATE_INVALID, 1 = DT_CROWDAGENT_STATE_WALKING, 2 = DT_CROWDAGENT_STATE_OFFMESH
782
+ */
783
+ getAgentState(index: number): number;
784
+ /**
785
+ * returns true if the agent in over an off mesh link connection
786
+ * @param index agent index returned by addAgent
787
+ * @returns true if over an off mesh link connection
788
+ */
789
+ overOffmeshConnection(index: number): boolean;
790
+ /**
791
+ * Asks a particular agent to go to a destination. That destination is constrained by the navigation mesh
792
+ * @param index agent index returned by addAgent
793
+ * @param destination targeted world position
794
+ */
795
+ agentGoto(index: number, destination: IVector3Like): void;
796
+ /**
797
+ * Teleport the agent to a new position
798
+ * @param index agent index returned by addAgent
799
+ * @param destination targeted world position
800
+ */
801
+ agentTeleport(index: number, destination: IVector3Like): void;
802
+ /**
803
+ * Update agent parameters
804
+ * @param index agent index returned by addAgent
805
+ * @param parameters agent parameters
806
+ */
807
+ updateAgentParameters(index: number, parameters: IAgentParametersV2): void;
808
+ /**
809
+ * remove a particular agent previously created
810
+ * @param index agent index returned by addAgent
811
+ */
812
+ removeAgent(index: number): void;
813
+ /**
814
+ * get the list of all agents attached to this crowd
815
+ * @returns list of agent indices
816
+ */
817
+ getAgents(): number[];
818
+ /**
819
+ * Tick update done by the Scene. Agent position/velocity/acceleration is updated by this function
820
+ * @param deltaTime in seconds
821
+ */
822
+ update(deltaTime: number): void;
823
+ /**
824
+ * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)
825
+ * The queries will try to find a solution within those bounds
826
+ * default is (1,1,1)
827
+ * @param extent x,y,z value that define the extent around the queries point of reference
828
+ */
829
+ setDefaultQueryExtent(extent: IVector3Like): void;
830
+ /**
831
+ * Get the Bounding box extent specified by setDefaultQueryExtent
832
+ * @returns the box extent values
833
+ */
834
+ getDefaultQueryExtent(): Vector3;
835
+ /**
836
+ * Get the Bounding box extent result specified by setDefaultQueryExtent
837
+ * @param result output the box extent values
838
+ */
839
+ getDefaultQueryExtentToRef(result: Vector3): void;
840
+ /**
841
+ * Get the next corner points composing the path (max 4 points)
842
+ * @param index agent index returned by addAgent
843
+ * @returns array containing world position composing the path
844
+ */
845
+ getCorners(index: number): Vector3[];
846
+ /**
847
+ * Release all resources
848
+ */
849
+ dispose(): void;
850
+ }
851
+
852
+ }
853
+ declare module "babylonjs-addons/navigation/generator/injection" {
854
+ import { RecastNavigationJSPluginV2 } from "babylonjs-addons/navigation/plugin/RecastNavigationJSPlugin";
855
+ /**
856
+ * Injects the navigation mesh generation methods into the navigation plugin.
857
+ * @param navigationPlugin The navigation plugin to inject the methods into.
858
+ */
859
+ export function InjectGenerators(navigationPlugin: RecastNavigationJSPluginV2): void;
860
+
861
+ }
862
+ declare module "babylonjs-addons/navigation/generator/index" {
863
+ export * from "babylonjs-addons/navigation/generator/generator.common";
864
+ export * from "babylonjs-addons/navigation/generator/generator.single-thread";
865
+ export * from "babylonjs-addons/navigation/generator/injection";
866
+
867
+ }
868
+ declare module "babylonjs-addons/navigation/generator/generator.worker" {
869
+ /**
870
+ * IMPORTANT!
871
+ * This file is still under construction and will change in the future.
872
+ * Workers are not yet supported.
873
+ * For more info visit: https://forum.babylonjs.com/t/replacing-recastjs-with-recast-navigation-js/56003/46
874
+ */
875
+
876
+ import { Mesh } from "babylonjs/Meshes/mesh";
877
+ import { INavMeshParametersV2 } from "babylonjs-addons/navigation/types";
878
+ /**
879
+ * Builds a any and any from meshes using provided parameters.
880
+ * @param meshes The array of meshes used to create the any
881
+ * @param parameters The parameters used to configure the any generation.
882
+ * @param workerOptions Options for the worker, including a completion callback and the worker instance.
883
+ * @throws Error if the any data is invalid or cannot be deserialized.
884
+ */
885
+ export function GenerateNavMeshWithWorker(meshes: Array<Mesh>, parameters: INavMeshParametersV2, workerOptions: {
886
+ /**
887
+ * Completion callback that is called when the any generation is complete.
888
+ * @param navMesh The generated any
889
+ * @param navMeshQuery The any associated with the generated any
890
+ * @param tileCache Optional any if tile cache generation was used.
891
+ */
892
+ completion: (navMesh: any, navMeshQuery: any, tileCache?: any) => void;
893
+ /**
894
+ * Worker instance used for asynchronous any generation.
895
+ */
896
+ worker: Worker;
897
+ }): void;
898
+
899
+ }
900
+ declare module "babylonjs-addons/navigation/generator/generator.single-thread" {
901
+ import { Mesh } from "babylonjs/Meshes/mesh";
902
+ import { INavMeshParametersV2 } from "babylonjs-addons/navigation/types";
903
+ /**
904
+ * Builds a NavMesh and NavMeshQuery from meshes using provided parameters.
905
+ * @param meshes The array of meshes used to create the NavMesh.
906
+ * @param parameters The parameters used to configure the NavMesh generation.
907
+ * @returns An object containing the NavMesh and NavMeshQuery.
908
+ * @remarks This function generates a NavMesh based on the provided meshes and parameters.
909
+ * It supports different configurations such as solo, tiled, and tile cache nav meshes.
910
+ * If you need obstacles, ensure that `maxObstacles` is set to a value greater than 0.
911
+ * Recommended values for `tileSize` are between 32 and 64 when using obstacles/tile cache.
912
+ * If you need a tiled nav mesh, ensure that `tileSize` is set to a value greater than 0.
913
+ * @throws Error if the NavMesh data is invalid or cannot be deserialized.
914
+ */
915
+ export function GenerateNavMesh(meshes: Array<Mesh>, parameters: INavMeshParametersV2): {
916
+ navMesh: any;
917
+ intermediates: any;
918
+ navMeshQuery: any;
919
+ tileCache: any;
920
+ };
921
+
922
+ }
923
+ declare module "babylonjs-addons/navigation/generator/generator.common" {
924
+
925
+ /**
926
+ * Builds a NavMesh and NavMeshQuery from serialized data.
927
+ * @param data The serialized NavMesh data.
928
+ * @returns An object containing the NavMesh and NavMeshQuery.
929
+ * @remarks This function deserializes the NavMesh data and creates a NavMeshQuery
930
+ * instance for querying the NavMesh.
931
+ * @throws Error if the NavMesh data is invalid or cannot be deserialized.
932
+ */
933
+ export function BuildFromNavmeshData(data: Uint8Array): {
934
+ navMesh: any;
935
+ navMeshQuery: any;
936
+ tileCache: undefined;
937
+ };
938
+ /**
939
+ * Builds a TileCache and NavMeshQuery from serialized data.
940
+ * @param data The serialized TileCache data.
941
+ * @param tileCacheMeshProcess Optional function to process the TileCache mesh.
942
+ * @returns An object containing the TileCache, NavMesh, and NavMeshQuery.
943
+ */
944
+ export function BuildFromTileCacheData(data: Uint8Array, tileCacheMeshProcess: any): {
945
+ navMesh: any;
946
+ navMeshQuery: any;
947
+ tileCache: any;
948
+ };
949
+
950
+ }
951
+ declare module "babylonjs-addons/navigation/factory/index" {
952
+ export * from "babylonjs-addons/navigation/factory/factory.single-thread";
953
+
954
+ }
955
+ declare module "babylonjs-addons/navigation/factory/factory.worker" {
956
+ import { RecastNavigationJSPluginV2 } from "babylonjs-addons/navigation/plugin/RecastNavigationJSPlugin";
957
+ /**
958
+ * Creates a navigation plugin for the given scene using a worker.
959
+ * @returns A promise that resolves to the created navigation plugin.
960
+ * @remarks This function initializes the Recast module and sets up the navigation plugin to use a worker.
961
+ * The worker is used to handle the creation of the navigation mesh asynchronously.
962
+ * The `createNavMesh` method is not supported in worker mode, use `createNavMeshAsync` instead.
963
+ */
964
+ export function CreateNavigationPluginWorkerAsync(): Promise<RecastNavigationJSPluginV2>;
965
+
966
+ }
967
+ declare module "babylonjs-addons/navigation/factory/factory.single-thread" {
968
+ import { RecastNavigationJSPluginV2 } from "babylonjs-addons/navigation/plugin/RecastNavigationJSPlugin";
969
+ /**
970
+ * Creates a navigation plugin for the given scene.
971
+ * @returns A promise that resolves to the created navigation plugin.
972
+ * @remarks This function initializes the Recast module and sets up the navigation plugin.
973
+ */
974
+ export function CreateNavigationPluginAsync(): Promise<RecastNavigationJSPluginV2>;
975
+
976
+ }
977
+ declare module "babylonjs-addons/navigation/factory/common" {
978
+ import { RecastInjection } from "babylonjs-addons/navigation/types";
979
+ /**
980
+ * Gets the RecastInjection instance (reference to the recast-navigation-js library).
981
+ * @returns The RecastInjection instance
982
+ * @throws Error if Recast is not initialized
983
+ */
984
+ export function GetRecast(): RecastInjection;
985
+ /**
986
+ * Sets the RecastInjection instance (reference to the recast-navigation-js library).
987
+ * @param recast The RecastInjection instance to set
988
+ */
989
+ export function SetRecast(recast: RecastInjection): void;
990
+ /**
991
+ * Initialize the Manifold library
992
+ * @param version defines the version of the library to use, default is "0.43.0"
993
+ * @param options defines the options to use to initialize the library
994
+ */
995
+ export function InitRecast(version?: string, options?: {
996
+ instance: RecastInjection;
997
+ }): Promise<void>;
998
+
999
+ }
1000
+ declare module "babylonjs-addons/navigation/debug/simple-debug" {
1001
+
1002
+ import { Scene } from "babylonjs/scene";
1003
+ import { Node } from "babylonjs/node";
1004
+ import { Mesh } from "babylonjs/Meshes/mesh";
1005
+ /**
1006
+ * Creates a debug mesh for visualizing a any in the scene.
1007
+ * @param navMesh The any to visualize.
1008
+ * @param scene The scene in which to create the debug mesh.
1009
+ * @param parent Optional parent node for the debug mesh.
1010
+ * @param flags Poly flags to filter by, defaults to undefined to include all polys
1011
+ * @returns The created debug mesh.
1012
+ */
1013
+ export function CreateDebugNavMesh(navMesh: any, scene: Scene, parent?: Node, flags?: number): Mesh;
1014
+
1015
+ }
1016
+ declare module "babylonjs-addons/navigation/debug/index" {
1017
+ export * from "babylonjs-addons/navigation/debug/NavigationDebugger";
1018
+ export * from "babylonjs-addons/navigation/debug/simple-debug";
1019
+
1020
+ }
1021
+ declare module "babylonjs-addons/navigation/debug/NavigationDebugger" {
1022
+
1023
+ import { GreasedLineMaterialOptions } from "babylonjs/Materials/GreasedLine/greasedLineMaterialInterfaces";
1024
+ import { StandardMaterial } from "babylonjs/Materials/standardMaterial";
1025
+ import { GreasedLineMeshOptions } from "babylonjs/Meshes/GreasedLine/greasedLineBaseMesh";
1026
+ import { TransformNode } from "babylonjs/Meshes/transformNode";
1027
+ import { Scene } from "babylonjs/scene";
1028
+ import { GeneratorIntermediates } from "babylonjs-addons/navigation/types";
1029
+ export const DebugLayerOption: {
1030
+ HEIGHTFIELD_SOLID: string;
1031
+ HEIGHTFIELD_WALKABLE: string;
1032
+ COMPACT_HEIGHTFIELD_SOLID: string;
1033
+ COMPACT_HEIGHTFIELD_REGIONS: string;
1034
+ COMPACT_HEIGHTFIELD_DISTANCE: string;
1035
+ RAW_CONTOURS: string;
1036
+ CONTOURS: string;
1037
+ POLY_MESH: string;
1038
+ POLY_MESH_DETAIL: string;
1039
+ NAVMESH: string;
1040
+ NAVMESH_BV_TREE: string;
1041
+ };
1042
+ export type DebugLayerOptions = (typeof DebugLayerOption)[keyof typeof DebugLayerOption];
1043
+ /**
1044
+ * NavigationDebugger is a utility class for visualizing navigation meshes and related data in a Babylon.js scene.
1045
+ * It provides methods to draw various navigation-related primitives such as points, lines, triangles, and quads.
1046
+ * It also supports drawing heightfields, compact heightfields, contours, poly meshes, and nav meshes.
1047
+ */
1048
+ export class NavigationDebugger {
1049
+ private _scene;
1050
+ /**
1051
+ * The name of the debug mesh used for navigation debugging.
1052
+ * This is used to group all navigation debug meshes under a single name for easier management
1053
+ */
1054
+ static NAV_MESH_DEBUG_NAME: string;
1055
+ /**
1056
+ * The name of the debug mesh used for visualization of the navigation mesh using points.
1057
+ */
1058
+ static NAV_MESH_DEBUG_NAME_POINTS: string;
1059
+ /**
1060
+ * The name of the debug mesh used for visualization of the navigation mesh using triangles.
1061
+ */
1062
+ static NAV_MESH_DEBUG_NAME_TRIS: string;
1063
+ /**
1064
+ * The name of the debug mesh used for visualization of the navigation mesh using quads.
1065
+ */
1066
+ static NAV_MESH_DEBUG_NAME_QUADS: string;
1067
+ /**
1068
+ * The name of the debug mesh used for visualization of the navigation mesh using lines.
1069
+ */
1070
+ static NAV_MESH_DEBUG_NAME_LINES: string;
1071
+ /**
1072
+ * The material used for rendering triangles in the navigation debug visualization.
1073
+ */
1074
+ triMaterial: StandardMaterial;
1075
+ /**
1076
+ * The material used for rendering points in the navigation debug visualization.
1077
+ */
1078
+ pointMaterial: StandardMaterial;
1079
+ /**
1080
+ * The list of line materials used in the navigation debug visualization.
1081
+ */
1082
+ lineMaterials: StandardMaterial[];
1083
+ /**
1084
+ * The parent node for the debug drawer.
1085
+ */
1086
+ debugDrawerParentNode: TransformNode;
1087
+ /**
1088
+ * * Gets or sets the primitive types to be drawn by the debug drawer.
1089
+ * * This allows you to control which types of primitives (points, lines, tris, quads) are rendered in the navigation debug visualization.
1090
+ * * The default value is `["points", "lines", "tris", "quads"]`.
1091
+ * * You can modify this property to include or exclude specific primitive types based on your debugging needs.
1092
+ * @returns An array of primitive types that the debug drawer will render.
1093
+ */
1094
+ get primitiveTypes(): any;
1095
+ set primitiveTypes(value: any);
1096
+ private _lineMaterialOptions;
1097
+ private _pointMesh;
1098
+ private _debugDrawerUtils;
1099
+ private _primitiveTypes;
1100
+ constructor(_scene: Scene, options?: {
1101
+ parent?: {
1102
+ node?: TransformNode | string;
1103
+ };
1104
+ primitiveTypes?: any;
1105
+ materials?: {
1106
+ triMaterial?: StandardMaterial;
1107
+ pointMaterial?: StandardMaterial;
1108
+ lineMaterialOptions: {
1109
+ greasedLineMaterialOptions: Partial<GreasedLineMaterialOptions>;
1110
+ greasedLineMeshOptions: Partial<GreasedLineMeshOptions>;
1111
+ };
1112
+ };
1113
+ });
1114
+ /**
1115
+ * Resets the debug drawer by disposing of all child meshes in the debug drawer parent node.
1116
+ * This is useful for clearing the debug visualization before drawing new primitives.
1117
+ */
1118
+ clear(): void;
1119
+ /**
1120
+ * Disposes of the debug drawer, including all meshes and materials used for rendering.
1121
+ * This method should be called when the debug drawer is no longer needed to free up resources.
1122
+ */
1123
+ dispose(): void;
1124
+ /**
1125
+ * This method iterates through the provided primitives and draws them based on their type.
1126
+ * It supports drawing points, lines, triangles, and quads, depending on the primitive type.
1127
+ * @param primitives An array of debug drawer primitives to be drawn.
1128
+ * @param options Optional parameters to control the drawing behavior, such as whether to join meshes.
1129
+ */
1130
+ drawPrimitives(primitives: any, options?: {
1131
+ joinMeshes?: boolean;
1132
+ }): void;
1133
+ /**
1134
+ * Draws a heightfield as solid using the debug drawer utilities.
1135
+ * @param hf The heightfield to draw as solid.
1136
+ */
1137
+ drawHeightfieldSolid(hf: any): void;
1138
+ /**
1139
+ * Draws a heightfield as walkable using the debug drawer utilities.
1140
+ * @param hf The heightfield to draw as walkable.
1141
+ */
1142
+ drawHeightfieldWalkable(hf: any): void;
1143
+ /**
1144
+ * Draws a compact heightfield as solid using the debug drawer utilities.
1145
+ * @param chf The compact heightfield to draw as solid.
1146
+ */
1147
+ drawCompactHeightfieldSolid(chf: any): void;
1148
+ /**
1149
+ * Draws the regions of a compact heightfield using the debug drawer utilities.
1150
+ * @param chf The compact heightfield to draw regions for.
1151
+ */
1152
+ drawCompactHeightfieldRegions(chf: any): void;
1153
+ /**
1154
+ * Draws the distance field of a compact heightfield using the debug drawer utilities.
1155
+ * @param chf The compact heightfield to draw the distance for.
1156
+ */
1157
+ drawCompactHeightfieldDistance(chf: any): void;
1158
+ /**
1159
+ * Draws a heightfield layer using the debug drawer utilities.
1160
+ * @param layer The heightfield layer to draw.
1161
+ * @param idx The index of the layer to draw.
1162
+ */
1163
+ drawHeightfieldLayer(layer: any, idx: number): void;
1164
+ /**
1165
+ * Draws the layers of a heightfield using the debug drawer utilities.
1166
+ * @param lset The heightfield layer set containing the layers to draw.
1167
+ */
1168
+ drawHeightfieldLayers(lset: any): void;
1169
+ /**
1170
+ * Draws the region connections of a any using the debug drawer utilities.
1171
+ * @param cset any to draw
1172
+ * @param alpha The alpha value for the drawn contours, default is 1.
1173
+ */
1174
+ drawRegionConnections(cset: any, alpha?: number): void;
1175
+ /**
1176
+ * Draws raw contours from a any using the debug drawer utilities.
1177
+ * @param cset any to draw
1178
+ * @param alpha The alpha value for the drawn contours, default is 1.
1179
+ */
1180
+ drawRawContours(cset: any, alpha?: number): void;
1181
+ /**
1182
+ * Draws contours from a any using the debug drawer utilities.
1183
+ * @param cset any to draw
1184
+ * @param alpha The alpha value for the drawn contours, default is 1.
1185
+ */
1186
+ drawContours(cset: any, alpha?: number): void;
1187
+ /**
1188
+ * Draws a poly mesh using the debug drawer utilities.
1189
+ * @param mesh any to draw
1190
+ */
1191
+ drawPolyMesh(mesh: any): void;
1192
+ /**
1193
+ * Draws a poly mesh detail using the debug drawer utilities.
1194
+ * @param dmesh any to draw
1195
+ */
1196
+ drawPolyMeshDetail(dmesh: any): void;
1197
+ /**
1198
+ * Draws a any using the debug drawer utilities.
1199
+ * @param mesh any to draw
1200
+ * @param flags Flags to control the drawing behavior, default is 0.
1201
+ */
1202
+ drawNavMesh(mesh: any, flags?: number): void;
1203
+ /**
1204
+ * Draws a any with closed list using the debug drawer utilities.
1205
+ * @param mesh any to draw
1206
+ * @param query any to use for drawing the closed list.
1207
+ * @param flags Flags to control the drawing behavior, default is 0.
1208
+ */
1209
+ drawNavMeshWithClosedList(mesh: any, query: any, flags?: number): void;
1210
+ /**
1211
+ * Draws the nodes of a any using the debug drawer utilities.
1212
+ * @param query any to use for drawing the nodes.
1213
+ */
1214
+ drawNavMeshNodes(query: any): void;
1215
+ /**
1216
+ * Draws the bounding volume tree of a any using the debug drawer utilities.
1217
+ * @param mesh any to draw the bounding volume tree for.
1218
+ */
1219
+ drawNavMeshBVTree(mesh: any): void;
1220
+ /**
1221
+ * Draws the portals of a any using the debug drawer utilities.
1222
+ * @param mesh any to draw the portals for.
1223
+ */
1224
+ drawNavMeshPortals(mesh: any): void;
1225
+ /**
1226
+ * Draws polygons of a any with specific flags using the debug drawer utilities.
1227
+ * @param mesh any to draw the polygons with specific flags.
1228
+ * @param flags The flags to filter the polygons to be drawn.
1229
+ * @param col The color to use for the drawn polygons, represented as a number.
1230
+ */
1231
+ drawNavMeshPolysWithFlags(mesh: any, flags: number, col: number): void;
1232
+ /**
1233
+ * Draws polygons of a any with specific reference and color using the debug drawer utilities.
1234
+ * @param mesh any to draw the polygons with specific reference and color.
1235
+ * @param ref The reference number of the polygons to be drawn.
1236
+ * @param col The color to use for the drawn polygons, represented as a number.
1237
+ */
1238
+ drawNavMeshPoly(mesh: any, ref: number, col: number): void;
1239
+ /**
1240
+ * Get the intermediates from the generator
1241
+ * @param intermediates - The generator intermediates
1242
+ * @returns An object containing lists of heightfields, compact heightfields, contour sets
1243
+ */
1244
+ getIntermediates: (intermediates: GeneratorIntermediates) => {
1245
+ heightfieldList: any;
1246
+ compactHeightfieldList: any;
1247
+ contourSetList: any;
1248
+ polyMeshList: any;
1249
+ polyMeshDetailList: any;
1250
+ };
1251
+ /**
1252
+ * Draw debug information based on the selected option
1253
+ * @param navMesh - The navigation mesh to draw
1254
+ * @param intermediates - The generator intermediates containing the data to draw
1255
+ * @param scene - The scene to draw in
1256
+ * @param option - The debug drawer option to use
1257
+ * @remarks This method will reset the debug drawer before drawing.
1258
+ */
1259
+ draw(navMesh: any, intermediates: GeneratorIntermediates, scene: Scene, option: DebugLayerOptions): void;
1260
+ private _drawPoints;
1261
+ private _drawLines;
1262
+ private _drawTris;
1263
+ private _drawQuads;
1264
+ /**
1265
+ * Merge the debug meshes for better performance
1266
+ */
1267
+ private _joinDebugMeshes;
1268
+ private _convertUnindexedToIndexed;
1269
+ }
1270
+
1271
+ }
1272
+ declare module "babylonjs-addons/navigation/common/utils" {
1273
+ import { IVector3Like } from "babylonjs/Maths/math.like";
1274
+ import { Vector3 } from "babylonjs/Maths/math.vector";
1275
+ /**
1276
+ * Utility function based on Chaikin's alogrithm for navigation path smoothing and segment generation.
1277
+ * @param points Array of points to be smoothed, where each point is an object with x, y, and z properties.
1278
+ * @param iterations Number of smoothing iterations to apply. Default 1.
1279
+ * @returns A new array of smoothed points after applying the Chaikin's algorithm.
1280
+ */
1281
+ export function GetChaikinSmoothPath(points: IVector3Like[], iterations?: number): IVector3Like[];
1282
+ /**
1283
+ * Generates a series of points that create an L-shaped path between each pair of points in the input navigation segment.
1284
+ * The path consists of a horizontal segment followed by a vertical segment, or vice versa,
1285
+ * depending on the relative distances between the x and z coordinates of the points.
1286
+ * @param navSegment An array of Vector3 points representing the navigation segment.
1287
+ * @returns An array of Vector3 points representing the L-shaped path.
1288
+ */
1289
+ export function GetLShapedPath(navSegment: Vector3[]): Vector3[];
1290
+
1291
+ }
1292
+ declare module "babylonjs-addons/navigation/common/tile-cache" {
1293
+
1294
+ /**
1295
+ * Creates a default tile cache mesh process function
1296
+ * @param offMeshConnections offMeshConnections
1297
+ * @param area the area to be set for each poly
1298
+ * @param flags the flags to be set for each poly
1299
+ * @returns the tile cache mesh process function
1300
+ */
1301
+ export function CreateDefaultTileCacheMeshProcess(offMeshConnections?: any, area?: number, flags?: number): any;
1302
+ /**
1303
+ * Waits until the tile cache is fully updated
1304
+ * @param navMesh The any
1305
+ * @param tileCache THe any
1306
+ */
1307
+ export function WaitForFullTileCacheUpdate(navMesh: any, tileCache: any): void;
1308
+
1309
+ }
1310
+ declare module "babylonjs-addons/navigation/common/smooth-path" {
1311
+
1312
+ import { IVector3Like } from "babylonjs/Maths/math.like";
1313
+ import { Vector3 } from "babylonjs/Maths/math.vector";
1314
+ /**
1315
+ * Compute a smooth navigation path from start to end. Returns an empty array if no path can be computed
1316
+ * @param navMesh the navigation mesh to use
1317
+ * @param navmeshQuery the navigation mesh query to use
1318
+ * @param start world position
1319
+ * @param end world position
1320
+ * @param options options object
1321
+ * @returns array containing world position composing the path
1322
+ */
1323
+ export function ComputeSmoothPath(navMesh: any, navmeshQuery: any, start: IVector3Like, end: IVector3Like, options?: {
1324
+ filter?: any;
1325
+ halfExtents?: IVector3Like;
1326
+ /**
1327
+ * @default 256
1328
+ */
1329
+ maxPathPolys?: number;
1330
+ /**
1331
+ * @default 2048
1332
+ */
1333
+ maxSmoothPathPoints?: number;
1334
+ /**
1335
+ * @default 0.5
1336
+ */
1337
+ stepSize?: number;
1338
+ /**
1339
+ * @default 0.01
1340
+ */
1341
+ slop?: number;
1342
+ }): Vector3[];
1343
+
1344
+ }
1345
+ declare module "babylonjs-addons/navigation/common/index" {
1346
+ export * from "babylonjs-addons/navigation/common/config";
1347
+ export * from "babylonjs-addons/navigation/common/convert";
1348
+ export * from "babylonjs-addons/navigation/common/getters";
1349
+ export * from "babylonjs-addons/navigation/common/smooth-path";
1350
+ export * from "babylonjs-addons/navigation/common/utils";
1351
+ export * from "babylonjs-addons/navigation/common/tile-cache";
1352
+
1353
+ }
1354
+ declare module "babylonjs-addons/navigation/common/getters" {
1355
+ import { Mesh } from "babylonjs/Meshes/mesh";
1356
+ /**
1357
+ * Extracts positions and indices from an array of meshes.
1358
+ * @param meshes The array of meshes from which to extract positions and indices.
1359
+ * @returns A tuple containing a Float32Array of positions and a Uint32Array of
1360
+ */
1361
+ export function GetPositionsAndIndices(meshes: Mesh[]): [positions: Float32Array, indices: Uint32Array];
1362
+ /**
1363
+ * Reverses the order of vertices in each triangle (3 indices per face) to ensure
1364
+ * that the winding order is consistent with the Recast Navigation requirements.
1365
+ * This is necessary because Recast Navigation expects the indices to be in a specific winding order.
1366
+ * @param meshOrIndices The mesh from which to extract indices or the indices themselves.
1367
+ * @returns Array of indices with reversed winding order.
1368
+ */
1369
+ export function GetReversedIndices(meshOrIndices: Mesh | Uint32Array | number[]): Uint32Array<ArrayBufferLike> | number[] | Int32Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | null;
1370
+
1371
+ }
1372
+ declare module "babylonjs-addons/navigation/common/convert" {
1373
+ import { Vector3 } from "babylonjs/Maths/math.vector";
1374
+ import { ComputePathResult } from "babylonjs-addons/navigation/types";
1375
+ /**
1376
+ * Converts navigation path points to a Vector3 array.
1377
+ * @param navPath The navigation path containing points and success status.
1378
+ * @returns An array of Vector3 points representing the navigation path.
1379
+ */
1380
+ export function ConvertNavPathPoints(navPath: ComputePathResult): Vector3[];
1381
+
1382
+ }
1383
+ declare module "babylonjs-addons/navigation/common/config" {
1384
+
1385
+
1386
+ import { IAgentParametersV2, INavMeshParametersV2 } from "babylonjs-addons/navigation/types";
1387
+ export const DefaultMaxObstacles = 128;
1388
+ /**
1389
+ * Creates a SoloNavMesh configuration based on the provided parameters.
1390
+ * @param parameters The parameters used to configure the SoloNavMesh generation.
1391
+ * @returns A configuration object for generating a SoloNavMesh.
1392
+ * @see https://docs.recast-navigation-js.isaacmason.com/types/index.RecastConfig.html
1393
+ */
1394
+ export function CreateSoloNavMeshConfig(parameters: INavMeshParametersV2): Partial<any>;
1395
+ /**
1396
+ * Creates a TiledNavMesh configuration based on the provided parameters.
1397
+ * @param parameters The parameters used to configure the TiledNavMesh generation.
1398
+ * @returns A configuration object for generating a TiledNavMesh.
1399
+ */
1400
+ export function CreateTiledNavMeshConfig(parameters: INavMeshParametersV2): Partial<any>;
1401
+ /**
1402
+ * Creates a TileCacheNavMesh configuration based on the provided parameters.
1403
+ * @param parameters The parameters used to configure the TileCacheNavMesh generation.
1404
+ * @returns A configuration object for generating a TileCacheNavMesh.
1405
+ */
1406
+ export function CreateTileCacheNavMeshConfig(parameters: INavMeshParametersV2): Partial<any>;
1407
+ /**
1408
+ * Convert IAgentParameters to Recast any
1409
+ * @param config Agent parameters
1410
+ * @returns Recast crowd agent paramaters
1411
+ */
1412
+ export function ToSoloNavMeshGeneratorConfig(config: INavMeshParametersV2): Partial<any>;
1413
+ /**
1414
+ * Convert IAgentParameters to Recast any
1415
+ * @param agentParams Agent parameters
1416
+ * @returns Recast crowd agent paramaters
1417
+ */
1418
+ export function ToCrowdAgentParams(agentParams: IAgentParametersV2): Partial<any>;
1419
+
1420
+ }
1421
+ declare module "babylonjs-addons/msdfText/textRenderer" {
1422
+ import { AbstractEngine } from "babylonjs/Engines/abstractEngine";
1423
+ import { IDisposable } from "babylonjs/scene";
1424
+ import { Nullable } from "babylonjs/types";
1425
+ import { FontAsset } from "babylonjs-addons/msdfText/fontAsset";
1426
+ import { ParagraphOptions } from "babylonjs-addons/msdfText/paragraphOptions";
1427
+ import { IColor4Like, IMatrixLike } from "babylonjs/Maths/math.like";
1428
+ /**
1429
+ * Abstract Node class from Babylon.js
1430
+ */
1431
+ export interface INodeLike {
1432
+ getWorldMatrix(): IMatrixLike;
1433
+ }
1434
+ /**
1435
+ * Class used to render text using MSDF (Multi-channel Signed Distance Field) technique
1436
+ * Thanks a lot to the work of Bhushan_Wagh and zb_sj for their amazing work on MSDF for Babylon.js
1437
+ * #6RLCWP#16
1438
+ * Star wars scroller: #6RLCWP#29
1439
+ * With metrics: #6RLCWP#35
1440
+ * Thickness: #IABMEZ#3
1441
+ * Solar system: #9YCDYC#9
1442
+ * Stroke: #6RLCWP#37
1443
+ */
1444
+ export class TextRenderer implements IDisposable {
1445
+ private readonly _useVAO;
1446
+ private _engine;
1447
+ private _shaderLanguage;
1448
+ private _vertexBuffers;
1449
+ private _spriteBuffer;
1450
+ private _worldBuffer;
1451
+ private _uvBuffer;
1452
+ private _drawWrapperBase;
1453
+ private _vertexArrayObject;
1454
+ private _font;
1455
+ private _charMatrices;
1456
+ private _charUvs;
1457
+ private _isDirty;
1458
+ private _baseLine;
1459
+ private _scalingMatrix;
1460
+ private _fontScaleMatrix;
1461
+ private _offsetMatrix;
1462
+ private _translationMatrix;
1463
+ private _baseMatrix;
1464
+ private _scaledMatrix;
1465
+ private _localMatrix;
1466
+ private _finalMatrix;
1467
+ private _lineMatrix;
1468
+ private _parentWorldMatrix;
1469
+ /**
1470
+ * Gets or sets the color of the text
1471
+ */
1472
+ color: IColor4Like;
1473
+ /**
1474
+ * Gets or sets the color of the stroke around the text
1475
+ */
1476
+ strokeColor: IColor4Like;
1477
+ /**
1478
+ * Gets or sets the width of the stroke around the text (inset)
1479
+ */
1480
+ strokeInsetWidth: number;
1481
+ /**
1482
+ * Gets or sets the width of the stroke around the text (outset)
1483
+ */
1484
+ strokeOutsetWidth: number;
1485
+ /**
1486
+ * Gets or sets the thickness of the text (0 means as defined in the font)
1487
+ * Value must be between -0.5 and 0.5
1488
+ */
1489
+ thicknessControl: number;
1490
+ private _parent;
1491
+ /**
1492
+ * Gets or sets the parent of the text renderer
1493
+ */
1494
+ get parent(): Nullable<INodeLike>;
1495
+ set parent(value: Nullable<INodeLike>);
1496
+ private _transformMatrix;
1497
+ /**
1498
+ * Gets or sets the transform matrix of the text renderer
1499
+ * It will be applied in that order:
1500
+ * parent x transform x paragraph world
1501
+ */
1502
+ get transformMatrix(): IMatrixLike;
1503
+ set transformMatrix(value: IMatrixLike);
1504
+ /**
1505
+ * Gets or sets if the text is billboarded
1506
+ */
1507
+ isBillboard: boolean;
1508
+ /**
1509
+ * Gets or sets if the text is screen projected
1510
+ * This will work only if the text is billboarded
1511
+ */
1512
+ isBillboardScreenProjected: boolean;
1513
+ /**
1514
+ * Gets the number of characters in the text renderer
1515
+ */
1516
+ get characterCount(): number;
1517
+ /**
1518
+ * Gets or sets if the text renderer should ignore the depth buffer
1519
+ * Default is false
1520
+ */
1521
+ ignoreDepthBuffer: boolean;
1522
+ private constructor();
1523
+ private _resizeBuffers;
1524
+ private _setShaders;
1525
+ /**
1526
+ * Add a paragraph of text to the renderer
1527
+ * @param text define the text to add
1528
+ * @param options define the options to use for the paragraph (optional)
1529
+ * @param worldMatrix define the world matrix to use for the paragraph (optional)
1530
+ */
1531
+ addParagraph(text: string, options?: Partial<ParagraphOptions>, worldMatrix?: IMatrixLike): void;
1532
+ /**
1533
+ * Render the text using the provided view and projection matrices
1534
+ * @param viewMatrix define the view matrix to use
1535
+ * @param projectionMatrix define the projection matrix to use
1536
+ */
1537
+ render(viewMatrix: IMatrixLike, projectionMatrix: IMatrixLike): void;
1538
+ /**
1539
+ * Release associated resources
1540
+ */
1541
+ dispose(): void;
1542
+ /**
1543
+ * Creates a new TextRenderer instance asynchronously
1544
+ * @param font define the font asset to use
1545
+ * @param engine define the engine to use
1546
+ * @returns a promise that resolves to the created TextRenderer instance
1547
+ */
1548
+ static CreateTextRendererAsync(font: FontAsset, engine: AbstractEngine): Promise<TextRenderer>;
1549
+ }
1550
+
1551
+ }
1552
+ declare module "babylonjs-addons/msdfText/paragraphOptions" {
1553
+ import { IVector2Like } from "babylonjs/Maths/math.like";
1554
+ import { SdfTextLine } from "babylonjs-addons/msdfText/sdf/line";
1555
+ import { SdfGlyph } from "babylonjs-addons/msdfText/sdf/glyph";
1556
+ export interface ISdfTextParagraphMetrics {
1557
+ /** @internal */
1558
+ readonly paragraph: string;
1559
+ /** @internal */
1560
+ readonly lines: SdfTextLine[];
1561
+ /** @internal */
1562
+ readonly width: number;
1563
+ /** @internal */
1564
+ readonly height: number;
1565
+ /** @internal */
1566
+ readonly glyphs: SdfGlyph[];
1567
+ }
1568
+ /** @internal */
1569
+ export type ParagraphOptions = {
1570
+ maxWidth: number;
1571
+ lineHeight: number;
1572
+ letterSpacing: number;
1573
+ tabSize: number;
1574
+ whiteSpace: "pre-line";
1575
+ textAlign: "left" | "right" | "center";
1576
+ translate: IVector2Like | undefined;
1577
+ customLayoutEngine?: (text: string, options: ParagraphOptions) => ISdfTextParagraphMetrics;
1578
+ };
1579
+ /** @internal */
1580
+ export const DefaultParagraphOptions: ParagraphOptions;
1581
+
1582
+ }
1583
+ declare module "babylonjs-addons/msdfText/index" {
1584
+ export * from "babylonjs-addons/msdfText/fontAsset";
1585
+ export * from "babylonjs-addons/msdfText/paragraphOptions";
1586
+ export * from "babylonjs-addons/msdfText/textRenderer";
1587
+ export * from "babylonjs-addons/msdfText/sdf/index";
1588
+ export * from "babylonjs-addons/msdfText/shaders/msdf.vertex";
1589
+ export * from "babylonjs-addons/msdfText/shaders/msdf.fragment";
1590
+ export * from "babylonjs-addons/msdfText/shadersWGSL/msdf.vertex";
1591
+ export * from "babylonjs-addons/msdfText/shadersWGSL/msdf.fragment";
1592
+
1593
+ }
1594
+ declare module "babylonjs-addons/msdfText/fontAsset" {
1595
+ import { IDisposable, Scene } from "babylonjs/scene";
1596
+ import { BMFontChar } from "babylonjs-addons/msdfText/sdf/bmFont";
1597
+ import { SdfFont } from "babylonjs-addons/msdfText/sdf/font";
1598
+ import { Texture } from "babylonjs/Materials/Textures/texture";
1599
+ /**
1600
+ * Class representing a font asset for SDF (Signed Distance Field) rendering.
1601
+ */
1602
+ export class FontAsset implements IDisposable {
1603
+ private readonly _chars;
1604
+ private readonly _charsRegex;
1605
+ private readonly _kernings;
1606
+ /** @internal */
1607
+ readonly _font: SdfFont;
1608
+ /**
1609
+ * Gets the font scale value
1610
+ */
1611
+ readonly scale: number;
1612
+ /**
1613
+ * Gets the list of used textures
1614
+ */
1615
+ readonly textures: Texture[];
1616
+ /**
1617
+ * Creates a new FontAsset instance.
1618
+ * @param definitionData defines the font data in JSON format.
1619
+ * @param textureUrl defines the url of the texture to use for the font.
1620
+ * @param scene defines the hosting scene.
1621
+ */
1622
+ constructor(definitionData: string, textureUrl: string, scene?: Scene);
1623
+ dispose(): void;
1624
+ private _updateFallbacks;
1625
+ /** @internal */
1626
+ _getChar(charCode: number): BMFontChar;
1627
+ /** @internal */
1628
+ _getKerning(first: number, second: number): number;
1629
+ /** @internal */
1630
+ _unsupportedChars(text: string): string;
1631
+ }
1632
+
1633
+ }
1634
+ declare module "babylonjs-addons/msdfText/shadersWGSL/msdf.vertex" {
1635
+ /** @internal */
1636
+ export const msdfVertexShaderWGSL: {
1637
+ name: string;
1638
+ shader: string;
1639
+ };
1640
+
1641
+ }
1642
+ declare module "babylonjs-addons/msdfText/shadersWGSL/msdf.fragment" {
1643
+ /** @internal */
1644
+ export const msdfPixelShaderWGSL: {
1645
+ name: string;
1646
+ shader: string;
1647
+ };
1648
+
1649
+ }
1650
+ declare module "babylonjs-addons/msdfText/shaders/msdf.vertex" {
1651
+ /** @internal */
1652
+ export const msdfVertexShader: {
1653
+ name: string;
1654
+ shader: string;
1655
+ };
1656
+
1657
+ }
1658
+ declare module "babylonjs-addons/msdfText/shaders/msdf.fragment" {
1659
+ /** @internal */
1660
+ export const msdfPixelShader: {
1661
+ name: string;
1662
+ shader: string;
1663
+ };
1664
+
1665
+ }
1666
+ declare module "babylonjs-addons/msdfText/sdf/paragraph" {
1667
+ import { FontAsset } from "babylonjs-addons/msdfText/fontAsset";
1668
+ import { type ParagraphOptions } from "babylonjs-addons/msdfText/paragraphOptions";
1669
+ import { SdfGlyph } from "babylonjs-addons/msdfText/sdf/glyph";
1670
+ import { SdfTextLine } from "babylonjs-addons/msdfText/sdf/line";
1671
+ /** @internal */
1672
+ export class SdfTextParagraph {
1673
+ readonly text: string;
1674
+ readonly fontAsset: FontAsset;
1675
+ readonly options: ParagraphOptions;
1676
+ get lineHeight(): number;
1677
+ readonly paragraph: string;
1678
+ readonly lines: SdfTextLine[];
1679
+ readonly width: number;
1680
+ readonly height: number;
1681
+ readonly glyphs: SdfGlyph[];
1682
+ constructor(text: string, fontAsset: FontAsset, options?: Partial<ParagraphOptions>);
1683
+ private _computeMetrics;
1684
+ private _breakLines;
1685
+ private _collapse;
1686
+ private _wrap;
1687
+ }
1688
+
1689
+ }
1690
+ declare module "babylonjs-addons/msdfText/sdf/line" {
1691
+ import { SdfGlyph } from "babylonjs-addons/msdfText/sdf/glyph";
1692
+ /** @internal */
1693
+ export type SdfTextLine = {
1694
+ text: string;
1695
+ glyphs: SdfGlyph[];
1696
+ start: number;
1697
+ end: number;
1698
+ width: number;
1699
+ };
272
1700
 
273
1701
  }
274
1702
  declare module "babylonjs-addons/msdfText/sdf/index" {
@@ -1631,379 +3059,1692 @@ export class Atmosphere implements IDisposable {
1631
3059
  get isAerialPerspectiveLutEnabled(): boolean;
1632
3060
  set isAerialPerspectiveLutEnabled(value: boolean);
1633
3061
  /**
1634
- * Gets the aerial perspective LUT render target or null if not enabled.
1635
- * @returns The render target.
3062
+ * Gets the aerial perspective LUT render target or null if not enabled.
3063
+ * @returns The render target.
3064
+ */
3065
+ get aerialPerspectiveLutRenderTarget(): Nullable<RenderTargetTexture>;
3066
+ /**
3067
+ * The intensity of the aerial perspective.
3068
+ */
3069
+ get aerialPerspectiveIntensity(): number;
3070
+ set aerialPerspectiveIntensity(value: number);
3071
+ /**
3072
+ * The amount of light transmitted into aerial perspective.
3073
+ * A scale of 1 is physically correct.
3074
+ */
3075
+ get aerialPerspectiveTransmittanceScale(): number;
3076
+ set aerialPerspectiveTransmittanceScale(value: number);
3077
+ /**
3078
+ * The amount of saturation applied to the aerial perspective.
3079
+ * Reducing to zero desaturates the aerial perspective completely.
3080
+ * A value of 1 has no effect.
3081
+ */
3082
+ get aerialPerspectiveSaturation(): number;
3083
+ set aerialPerspectiveSaturation(value: number);
3084
+ /**
3085
+ * A radiance bias applied to aerial perspective.
3086
+ */
3087
+ get aerialPerspectiveRadianceBias(): number;
3088
+ set aerialPerspectiveRadianceBias(value: number);
3089
+ /**
3090
+ * True if the composition should be in linear space (e.g. for HDR rendering).
3091
+ * Typically linear space is expected when ImageProcessing is enabled via PostProcesses.
3092
+ * False for non-linear output.
3093
+ */
3094
+ get isLinearSpaceComposition(): boolean;
3095
+ set isLinearSpaceComposition(value: boolean);
3096
+ /**
3097
+ * True if the {@link light} value should be specified in linear space.
3098
+ * If using PBRMaterials, light value is expected to be linear.
3099
+ */
3100
+ get isLinearSpaceLight(): boolean;
3101
+ set isLinearSpaceLight(value: boolean);
3102
+ /**
3103
+ * The lookup table for transmittance.
3104
+ */
3105
+ get transmittanceLut(): Nullable<TransmittanceLut>;
3106
+ /**
3107
+ * Gets the multiple scattering LUT render target.
3108
+ * @returns The render target.
3109
+ */
3110
+ get multiScatteringLutRenderTarget(): Nullable<RenderTargetTexture>;
3111
+ /**
3112
+ * The lookup table for diffuse sky irradiance, or null if not enabled.
3113
+ */
3114
+ get diffuseSkyIrradianceLut(): Nullable<DiffuseSkyIrradianceLut>;
3115
+ /**
3116
+ * The properties used to describe the size and optical parameters of the atmosphere.
3117
+ */
3118
+ get physicalProperties(): AtmospherePhysicalProperties;
3119
+ /**
3120
+ * The height in kilometers of the scene's origin.
3121
+ */
3122
+ get originHeight(): number;
3123
+ set originHeight(value: number);
3124
+ /**
3125
+ * When atmospheric scattering is applied to surfaces, if this value is set to true,
3126
+ * a grayscale approximation of the transmittance is used to dim surfaces.
3127
+ *
3128
+ * When set to false, the atmospheric composition does not dim the surfaces behind it.
3129
+ * It is up to the client application to apply transmittance manually.
3130
+ */
3131
+ get applyApproximateTransmittance(): boolean;
3132
+ set applyApproximateTransmittance(value: boolean);
3133
+ /**
3134
+ * The directional lights in the scene which represent the suns illuminating the atmosphere.
3135
+ * Each frame, the color and intensity of the lights are updated based on the camera position and the light's direction.
3136
+ */
3137
+ get lights(): ReadonlyArray<DirectionalLight>;
3138
+ /**
3139
+ * The rendering group ID for the sky compositor.
3140
+ * The sky will only be rendered for this group.
3141
+ */
3142
+ get skyRenderingGroup(): number;
3143
+ set skyRenderingGroup(value: number);
3144
+ /**
3145
+ * The rendering group ID for the aerial perspective compositor.
3146
+ * Aerial perspective will only be rendered for this group.
3147
+ */
3148
+ get aerialPerspectiveRenderingGroup(): number;
3149
+ set aerialPerspectiveRenderingGroup(value: number);
3150
+ /**
3151
+ * The rendering group ID for the globe atmosphere compositor.
3152
+ * The globe atmosphere will only be rendered for this group.
3153
+ */
3154
+ get globeAtmosphereRenderingGroup(): number;
3155
+ set globeAtmosphereRenderingGroup(value: number);
3156
+ /**
3157
+ * Gets the uniform buffer used to store the atmosphere's physical properties.
3158
+ */
3159
+ get uniformBuffer(): UniformBuffer;
3160
+ /**
3161
+ * Gets the camera-related variables for this atmosphere. Updated each frame.
3162
+ */
3163
+ get cameraAtmosphereVariables(): AtmospherePerCameraVariables;
3164
+ readonly uniqueId: number;
3165
+ /**
3166
+ * Constructs the {@link Atmosphere}.
3167
+ * @param name - The name of this instance.
3168
+ * @param scene - The scene to which the atmosphere will be added.
3169
+ * @param lights - The light sources that illuminate the atmosphere. Currently only supports one light, and that light should be the first light in the scene.
3170
+ * @param options - The options used to create the atmosphere.
3171
+ */
3172
+ constructor(name: string, scene: Scene, lights: DirectionalLight[], options?: IAtmosphereOptions);
3173
+ /**
3174
+ * @override
3175
+ */
3176
+ dispose(): void;
3177
+ /**
3178
+ * True if the atmosphere is enabled.
3179
+ * @returns - True if the atmosphere is enabled.
3180
+ */
3181
+ isEnabled(): boolean;
3182
+ /**
3183
+ * Sets the enabled state of the atmosphere.
3184
+ * @param enabled - True to enable the atmosphere, false to disable it.
3185
+ */
3186
+ setEnabled(enabled: boolean): void;
3187
+ /**
3188
+ * The class name of the {@link Atmosphere}.
3189
+ * @returns - The class name of the atmosphere.
3190
+ */
3191
+ getClassName(): string;
3192
+ /**
3193
+ * Gets the color of a light after being transmitted through the atmosphere to a point specified by its distance to the planet center and its geocentric normal.
3194
+ * NOTE, the result is always a linear space color.
3195
+ * @param directionToLight - The direction of the light.
3196
+ * @param pointRadius - The distance from the planet center to the point in kilometers.
3197
+ * @param pointGeocentricNormal - The geocentric normal at the point i.e., normalize(point - planet center).
3198
+ * @param result - The color to store the result in.
3199
+ * @returns The result color.
3200
+ */
3201
+ getTransmittedColorToRef: <T extends IColor3Like>(directionToLight: IVector3Like, pointRadius: number, pointGeocentricNormal: IVector3Like, result: T) => T;
3202
+ /**
3203
+ * Gets the diffuse sky irradiance. Result is always in linear space.
3204
+ * @param directionToLight - The direction of the point to the light.
3205
+ * @param pointRadius - The distance from the planet center to the point in kilometers.
3206
+ * @param pointGeocentricNormal - The geocentric normal at the point: normalize(point - planet center).
3207
+ * @param lightIrradiance - The irradiance of the light.
3208
+ * @param result - The color to store the result in.
3209
+ * @returns The result color.
3210
+ */
3211
+ getDiffuseSkyIrradianceToRef: <T extends IColor3Like>(directionToLight: IVector3Like, pointRadius: number, pointGeocentricNormal: IVector3Like, lightIrradiance: number, result: T) => T;
3212
+ /**
3213
+ * Creates a new {@link EffectWrapper} for the multiple scattering LUT
3214
+ * @returns The newly created {@link EffectWrapper}.
3215
+ */
3216
+ private _createMultiScatteringEffectWrapper;
3217
+ /**
3218
+ * Draws the multiple scattering LUT using {@link EffectWrapper} and {@link EffectRenderer}.
3219
+ */
3220
+ private _drawMultiScatteringLut;
3221
+ /**
3222
+ * Draws the aerial perspective compositor using {@link EffectWrapper} and {@link EffectRenderer}.
3223
+ */
3224
+ drawAerialPerspectiveCompositor(): void;
3225
+ /**
3226
+ * Draws the sky compositor using {@link EffectWrapper} and {@link EffectRenderer}.
3227
+ */
3228
+ drawSkyCompositor(): void;
3229
+ /**
3230
+ * Draws the globe atmosphere compositor using {@link EffectWrapper} and {@link EffectRenderer}.
3231
+ */
3232
+ drawGlobeAtmosphereCompositor(): void;
3233
+ private _disposeSkyCompositor;
3234
+ private _disposeAerialPerspectiveCompositor;
3235
+ private _disposeGlobeAtmosphereCompositor;
3236
+ /**
3237
+ * Updates the camera variables that are specific to the atmosphere.
3238
+ * @param camera - The camera to update the variables for.
3239
+ */
3240
+ private _updatePerCameraVariables;
3241
+ /**
3242
+ * Renders the lookup tables, some of which can vary per-camera.
3243
+ * It is expected that updatePerCameraVariables was previously called.
3244
+ */
3245
+ private _renderLutsForCamera;
3246
+ /**
3247
+ * Renders the lookup tables that do not depend on a camera position.
3248
+ */
3249
+ renderGlobalLuts(): void;
3250
+ /**
3251
+ * Binds the atmosphere's uniform buffer to an {@link Effect}.
3252
+ * @param effect - The {@link Effect} to bind the uniform buffer to.
3253
+ */
3254
+ bindUniformBufferToEffect(effect: Effect): void;
3255
+ /**
3256
+ * Updates the atmosphere's uniform buffer.
3257
+ */
3258
+ updateUniformBuffer(): void;
3259
+ /**
3260
+ * Draws the aerial perspective LUT using {@link EffectWrapper} and {@link EffectRenderer}.
3261
+ */
3262
+ private _drawAerialPerspectiveLut;
3263
+ /**
3264
+ * Draws the sky view LUT using {@link EffectWrapper} and {@link EffectRenderer}.
3265
+ */
3266
+ private _drawSkyViewLut;
3267
+ }
3268
+
3269
+ }
3270
+ declare module "babylonjs-addons/atmosphere/test/unit/sampling.test" {
3271
+ export {};
3272
+
3273
+ }
3274
+ declare module "babylonjs-addons/atmosphere/Shaders/transmittance.fragment" {
3275
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
3276
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
3277
+ import "babylonjs/Shaders/ShadersInclude/helperFunctions";
3278
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
3279
+ /** @internal */
3280
+ export const transmittancePixelShader: {
3281
+ name: string;
3282
+ shader: string;
3283
+ };
3284
+
3285
+ }
3286
+ declare module "babylonjs-addons/atmosphere/Shaders/skyView.fragment" {
3287
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
3288
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
3289
+ import "babylonjs/Shaders/ShadersInclude/helperFunctions";
3290
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
3291
+ /** @internal */
3292
+ export const skyViewPixelShader: {
3293
+ name: string;
3294
+ shader: string;
3295
+ };
3296
+
3297
+ }
3298
+ declare module "babylonjs-addons/atmosphere/Shaders/multiScattering.fragment" {
3299
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
3300
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
3301
+ import "babylonjs/Shaders/ShadersInclude/helperFunctions";
3302
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
3303
+ /** @internal */
3304
+ export const multiScatteringPixelShader: {
3305
+ name: string;
3306
+ shader: string;
3307
+ };
3308
+
3309
+ }
3310
+ declare module "babylonjs-addons/atmosphere/Shaders/fullscreenTriangle.vertex" {
3311
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
3312
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
3313
+ /** @internal */
3314
+ export const fullscreenTriangleVertexShader: {
3315
+ name: string;
3316
+ shader: string;
3317
+ };
3318
+
3319
+ }
3320
+ declare module "babylonjs-addons/atmosphere/Shaders/diffuseSkyIrradiance.fragment" {
3321
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
3322
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
3323
+ import "babylonjs/Shaders/ShadersInclude/helperFunctions";
3324
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/depthFunctions";
3325
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
3326
+ import "babylonjs/Shaders/ShadersInclude/importanceSampling";
3327
+ import "babylonjs/Shaders/ShadersInclude/pbrBRDFFunctions";
3328
+ import "babylonjs/Shaders/ShadersInclude/hdrFilteringFunctions";
3329
+ /** @internal */
3330
+ export const diffuseSkyIrradiancePixelShader: {
3331
+ name: string;
3332
+ shader: string;
3333
+ };
3334
+
3335
+ }
3336
+ declare module "babylonjs-addons/atmosphere/Shaders/compositeSky.fragment" {
3337
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
3338
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
3339
+ import "babylonjs/Shaders/ShadersInclude/helperFunctions";
3340
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/depthFunctions";
3341
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
3342
+ /** @internal */
3343
+ export const compositeSkyPixelShader: {
3344
+ name: string;
3345
+ shader: string;
3346
+ };
3347
+
3348
+ }
3349
+ declare module "babylonjs-addons/atmosphere/Shaders/compositeGlobeAtmosphere.fragment" {
3350
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
3351
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
3352
+ import "babylonjs/Shaders/ShadersInclude/helperFunctions";
3353
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/depthFunctions";
3354
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
3355
+ /** @internal */
3356
+ export const compositeGlobeAtmospherePixelShader: {
3357
+ name: string;
3358
+ shader: string;
3359
+ };
3360
+
3361
+ }
3362
+ declare module "babylonjs-addons/atmosphere/Shaders/compositeAerialPerspective.fragment" {
3363
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
3364
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
3365
+ import "babylonjs/Shaders/ShadersInclude/helperFunctions";
3366
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/depthFunctions";
3367
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
3368
+ /** @internal */
3369
+ export const compositeAerialPerspectivePixelShader: {
3370
+ name: string;
3371
+ shader: string;
3372
+ };
3373
+
3374
+ }
3375
+ declare module "babylonjs-addons/atmosphere/Shaders/aerialPerspective.fragment" {
3376
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
3377
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
3378
+ import "babylonjs/Shaders/ShadersInclude/helperFunctions";
3379
+ import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
3380
+ /** @internal */
3381
+ export const aerialPerspectivePixelShader: {
3382
+ name: string;
3383
+ shader: string;
3384
+ };
3385
+
3386
+ }
3387
+ declare module "babylonjs-addons/atmosphere/Shaders/ShadersInclude/depthFunctions" {
3388
+ /** @internal */
3389
+ export const depthFunctions: {
3390
+ name: string;
3391
+ shader: string;
3392
+ };
3393
+
3394
+ }
3395
+ declare module "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereVertexDeclaration" {
3396
+ /** @internal */
3397
+ export const atmosphereVertexDeclaration: {
3398
+ name: string;
3399
+ shader: string;
3400
+ };
3401
+
3402
+ }
3403
+ declare module "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration" {
3404
+ /** @internal */
3405
+ export const atmosphereUboDeclaration: {
3406
+ name: string;
3407
+ shader: string;
3408
+ };
3409
+
3410
+ }
3411
+ declare module "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions" {
3412
+ import "babylonjs/Shaders/ShadersInclude/intersectionFunctions";
3413
+ /** @internal */
3414
+ export const atmosphereFunctions: {
3415
+ name: string;
3416
+ shader: string;
3417
+ };
3418
+
3419
+ }
3420
+ declare module "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration" {
3421
+ /** @internal */
3422
+ export const atmosphereFragmentDeclaration: {
3423
+ name: string;
3424
+ shader: string;
3425
+ };
3426
+
3427
+ }
3428
+
3429
+ declare module "babylonjs-addons" {
3430
+ export * from "babylonjs-addons/index";
3431
+ }
3432
+
3433
+
3434
+ declare module ADDONS {
3435
+
3436
+
3437
+ /**
3438
+ * Recast injection type
1636
3439
  */
1637
- get aerialPerspectiveLutRenderTarget(): Nullable<RenderTargetTexture>;
3440
+ export type RecastInjection = any;
1638
3441
  /**
1639
- * The intensity of the aerial perspective.
3442
+ * Off-mesh connection data
1640
3443
  */
1641
- get aerialPerspectiveIntensity(): number;
1642
- set aerialPerspectiveIntensity(value: number);
3444
+ export interface IOffMeshConnection {
3445
+ /**
3446
+ * The start position of the off-mesh connection.
3447
+ */
3448
+ startPosition: BABYLON.IVector3Like;
3449
+ /**
3450
+ * The end position of the off-mesh connection.
3451
+ */
3452
+ endPosition: BABYLON.IVector3Like;
3453
+ /**
3454
+ * The radius of the off-mesh connection.
3455
+ */
3456
+ radius: number;
3457
+ /**
3458
+ * The type of the off-mesh connection.
3459
+ */
3460
+ bidirectional: boolean;
3461
+ /**
3462
+ * The area type of the off-mesh connection.
3463
+ */
3464
+ area: number;
3465
+ /**
3466
+ * The flags of the off-mesh connection.
3467
+ */
3468
+ flags: number;
3469
+ /**
3470
+ * The user ID of the off-mesh connection.
3471
+ * @remarks This can be used to associate the off-mesh connection with a specific user
3472
+ */
3473
+ userId?: number;
3474
+ }
1643
3475
  /**
1644
- * The amount of light transmitted into aerial perspective.
1645
- * A scale of 1 is physically correct.
3476
+ * Result of a navigation mesh creation.
1646
3477
  */
1647
- get aerialPerspectiveTransmittanceScale(): number;
1648
- set aerialPerspectiveTransmittanceScale(value: number);
3478
+ export type CreateNavMeshResult = BABYLON.Nullable<{
3479
+ /**
3480
+ * Navigation mesh
3481
+ */
3482
+ navMesh: any;
3483
+ /**
3484
+ * Navigation mesh query
3485
+ */
3486
+ navMeshQuery: any;
3487
+ /**
3488
+ * Intermediates generated during the any creation process.
3489
+ * @remarks This is only available if the `keepIntermediates` parameter is set to true in the `INavMeshParametersV2`.
3490
+ * It can be used for debugging or visualization purposes.
3491
+ */
3492
+ intermediates?: GeneratorIntermediates;
3493
+ /**
3494
+ * Tile cache generated during the any creation process.
3495
+ * @remarks This is only available if the `maxObstacles` parameter is set to a value greater than 0 in the `INavMeshParametersV2`. Defaults `maxObstacles` to 128.
3496
+ * It can be used for obstacle avoidance and dynamic navigation mesh updates.
3497
+ * @see {@link INavMeshParametersV2}
3498
+ */
3499
+ tileCache?: any;
3500
+ }>;
1649
3501
  /**
1650
- * The amount of saturation applied to the aerial perspective.
1651
- * Reducing to zero desaturates the aerial perspective completely.
1652
- * A value of 1 has no effect.
3502
+ * Agent parameters
3503
+ * For actual limits and default values check the recast-navigation-js docs.
3504
+ * @see https://docs.recast-navigation-js.isaacmason.com/types/index.CrowdAgentParams.html
1653
3505
  */
1654
- get aerialPerspectiveSaturation(): number;
1655
- set aerialPerspectiveSaturation(value: number);
3506
+ export interface IAgentParametersV2 extends BABYLON.IAgentParameters {
3507
+ /**
3508
+ * Flags that impact steering behavior.
3509
+ */
3510
+ updateFlags: number;
3511
+ /**
3512
+ * The index of the avoidance configuration to use for the agent. [Limits: 0 to #DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS inclusive]
3513
+ */
3514
+ obstacleAvoidanceType: number;
3515
+ /**
3516
+ * The index of the query filter used by this agent.
3517
+ */
3518
+ queryFilterType: number;
3519
+ /**
3520
+ * User defined data attached to the agent.
3521
+ */
3522
+ userData: unknown;
3523
+ }
1656
3524
  /**
1657
- * A radiance bias applied to aerial perspective.
3525
+ * any parameters
3526
+ * For actual limits and default values check the recast-navigation-js docs.
3527
+ * @see https://docs.recast-navigation-js.isaacmason.com/types/index.RecastConfig.html
1658
3528
  */
1659
- get aerialPerspectiveRadianceBias(): number;
1660
- set aerialPerspectiveRadianceBias(value: number);
3529
+ export interface INavMeshParametersV2 extends BABYLON.INavMeshParameters {
3530
+ /**
3531
+ * OffMeshConnections - Teleports
3532
+ */
3533
+ offMeshConnections?: IOffMeshConnection[];
3534
+ /**
3535
+ * Whether to keep intermediate navigation mesh data for debug visualization. Default is false.
3536
+ */
3537
+ keepIntermediates?: boolean;
3538
+ /**
3539
+ * The maximum number of obstacles that can be added to the navigation mesh. Default is 32.
3540
+ * If this value is greater then 0, the navigation mesh will be generated with a tile cache.
3541
+ */
3542
+ maxObstacles?: number;
3543
+ /**
3544
+ * The size of each tile in the tiled navigation mesh. Default is 32.
3545
+ */
3546
+ expectedLayersPerTile?: number;
3547
+ /**
3548
+ * Function which is sets the polyAreas and polyFlags for the tile cache mesh. Defaults to a function that sets all areas to 0 and flags to 1.
3549
+ */
3550
+ tileCacheMeshProcess?: any;
3551
+ }
1661
3552
  /**
1662
- * True if the composition should be in linear space (e.g. for HDR rendering).
1663
- * Typically linear space is expected when ImageProcessing is enabled via PostProcesses.
1664
- * False for non-linear output.
3553
+ * Result of a steer target computation.
1665
3554
  */
1666
- get isLinearSpaceComposition(): boolean;
1667
- set isLinearSpaceComposition(value: boolean);
3555
+ export type SteerTargetResult = {
3556
+ /**
3557
+ * Indicates whether the steering target computation was successful.
3558
+ */
3559
+ success: false;
3560
+ } | {
3561
+ /**
3562
+ * Indicates whether the steering target computation was successful.
3563
+ */
3564
+ success: true;
3565
+ /**
3566
+ * The position to steer towards.
3567
+ */
3568
+ steerPos: BABYLON.Vector3;
3569
+ /**
3570
+ * The flag indicating the type of steering position.
3571
+ */
3572
+ steerPosFlag: number;
3573
+ /**
3574
+ * The reference to the polygon that the steering position is associated with.
3575
+ */
3576
+ steerPosRef: number;
3577
+ /**
3578
+ * The points that make up the path to the steering position.
3579
+ */
3580
+ points: BABYLON.Vector3[];
3581
+ };
1668
3582
  /**
1669
- * True if the {@link light} value should be specified in linear space.
1670
- * If using PBRMaterials, light value is expected to be linear.
3583
+ * Error types for path computation.
1671
3584
  */
1672
- get isLinearSpaceLight(): boolean;
1673
- set isLinearSpaceLight(value: boolean);
3585
+ export var ComputePathError: {
3586
+ START_NEAREST_POLY_FAILED: string;
3587
+ END_NEAREST_POLY_FAILED: string;
3588
+ FIND_PATH_FAILED: string;
3589
+ NO_POLYGON_PATH_FOUND: string;
3590
+ NO_CLOSEST_POINT_ON_LAST_POLYGON_FOUND: string;
3591
+ };
3592
+ export type ComputePathErrorType = (typeof ComputePathError)[keyof typeof ComputePathError];
1674
3593
  /**
1675
- * The lookup table for transmittance.
3594
+ * Result of a path computation.
1676
3595
  */
1677
- get transmittanceLut(): Nullable<TransmittanceLut>;
3596
+ export type ComputePathResult = {
3597
+ /**
3598
+ * Indicates whether the path computation was successful.
3599
+ */
3600
+ success: boolean;
3601
+ /**
3602
+ * The error message if the path computation failed.
3603
+ */
3604
+ error?: {
3605
+ /**
3606
+ * A descriptive error message.
3607
+ */
3608
+ name?: string;
3609
+ /**
3610
+ * The type of error that occurred during path computation.
3611
+ * @remarks This will be one of the values from `ComputePathError`
3612
+ */
3613
+ type?: ComputePathErrorType;
3614
+ /**
3615
+ * Statusring describing the error.
3616
+ */
3617
+ status?: number;
3618
+ };
3619
+ /**
3620
+ * The computed path as an array of BABYLON.Vector3 points.
3621
+ */
3622
+ path: BABYLON.IVector3Like[];
3623
+ };
1678
3624
  /**
1679
- * Gets the multiple scattering LUT render target.
1680
- * @returns The render target.
3625
+ * Intermediates generated during the any creation process.
3626
+ * @remarks This is only available if the `keepIntermediates` parameter is set to true in the `INavMeshParametersV2`.
3627
+ * It can be used for debugging or visualization purposes.
1681
3628
  */
1682
- get multiScatteringLutRenderTarget(): Nullable<RenderTargetTexture>;
3629
+ export type GeneratorIntermediates = any | any | any | null;
3630
+
3631
+
3632
+
3633
+
1683
3634
  /**
1684
- * The lookup table for diffuse sky irradiance, or null if not enabled.
3635
+ * Generates a navigation mesh in a web worker.
1685
3636
  */
1686
- get diffuseSkyIrradianceLut(): Nullable<DiffuseSkyIrradianceLut>;
3637
+ export function GenerateNavMeshWorker(): void;
3638
+
3639
+
3640
+
3641
+
1687
3642
  /**
1688
- * The properties used to describe the size and optical parameters of the atmosphere.
3643
+ * Navigation plugin for Babylon.js. It is a simple wrapper around the recast-navigation-js library. Not all features are implemented.
3644
+ * @remarks This plugin provides navigation mesh generation and pathfinding capabilities using the recast-navigation-js library
3645
+ * @remarks It supports both single-threaded and multi-threaded generation of navigation meshes.
3646
+ * @remarks The plugin can be used to create navigation meshes from meshes in a scene, compute paths, and manage crowd agents, etc.
3647
+ * @remarks It also provides methods for creating obstacles and querying the navigation mesh.
3648
+ * @see https://github.com/isaac-mason/recast-navigation-js
1689
3649
  */
1690
- get physicalProperties(): AtmospherePhysicalProperties;
3650
+ export class RecastNavigationJSPluginV2 implements BABYLON.INavigationEnginePlugin {
3651
+ /**
3652
+ * Creates a navigation mesh - will be injected by the factory
3653
+ * @param meshes array of all the geometry used to compute the navigation mesh
3654
+ * @param parameters bunch of parameters used to filter geometry
3655
+ * @returns the created navmesh and navmesh query
3656
+ */
3657
+ createNavMeshImpl: (meshes: Array<BABYLON.Mesh>, parameters: INavMeshParametersV2) => CreateNavMeshResult;
3658
+ /**
3659
+ * Creates a navigation mesh - will be injected by the factory
3660
+ * @param meshes array of all the geometry used to compute the navigation mesh
3661
+ * @param parameters bunch of parameters used to filter geometry
3662
+ * @returns the created navmesh and navmesh query
3663
+ */
3664
+ createNavMeshAsyncImpl: (meshes: Array<BABYLON.Mesh>, parameters: INavMeshParametersV2) => Promise<CreateNavMeshResult>;
3665
+ /**
3666
+ * recast-navigation-js injection
3667
+ */
3668
+ bjsRECAST: RecastInjection;
3669
+ /**
3670
+ * plugin name
3671
+ */
3672
+ name: string;
3673
+ /**
3674
+ * the navmesh created
3675
+ */
3676
+ navMesh?: any;
3677
+ /**
3678
+ * The navmesh query created from the navmesh
3679
+ * @remarks This is used to query the navmesh for pathfinding and other navigation tasks
3680
+ */
3681
+ get navMeshQuery(): any;
3682
+ private _navMeshQuery;
3683
+ /**
3684
+ * Intermediates generated during the navmesh creation
3685
+ * @remarks This is used for debugging and visualization purposes.
3686
+ * @remarks You have access to vertices, indices and vertex colors to visusalize the navmesh creation process.
3687
+ * @remarks This is only available if the `keepIntermediates` parameter is set
3688
+ * @remarks to true during navmesh generation.
3689
+ */
3690
+ private _intermediates?;
3691
+ /**
3692
+ * Gets the intermediates generated during the navmesh creation
3693
+ * @returns The generator intermediates, or undefined if not available
3694
+ */
3695
+ get intermediates(): GeneratorIntermediates | undefined;
3696
+ /**
3697
+ * Tile cache used for tiled navigation meshes
3698
+ * @remarks This is used to store and manage tiles of the navigation mesh for efficient path and when obstacles are used.
3699
+ */
3700
+ private _tileCache?;
3701
+ /**
3702
+ * Gets the tile cache used for tiled navigation meshes
3703
+ * @returns The tile cache instance, or undefined if not available
3704
+ */
3705
+ get tileCache(): any | undefined;
3706
+ private _maximumSubStepCount;
3707
+ private _timeStep;
3708
+ private _timeFactor;
3709
+ private _crowd?;
3710
+ /**
3711
+ * Creates a RecastNavigationJSPluginV2 instance
3712
+ * @param recastInjection The recast-navigation-js injection containing core and generators
3713
+ */
3714
+ constructor(recastInjection?: RecastInjection);
3715
+ /**
3716
+ * Set the time step of the navigation tick update.
3717
+ * Default is 1/60.
3718
+ * A value of 0 will disable fixed time update
3719
+ * @param newTimeStep the new timestep to apply to this world.
3720
+ */
3721
+ setTimeStep(newTimeStep?: number): void;
3722
+ /**
3723
+ * Get the time step of the navigation tick update.
3724
+ * @returns the current time step
3725
+ */
3726
+ getTimeStep(): number;
3727
+ /**
3728
+ * If delta time in navigation tick update is greater than the time step
3729
+ * a number of sub iterations are done. If more iterations are need to reach deltatime
3730
+ * they will be discarded.
3731
+ * A value of 0 will set to no maximum and update will use as many substeps as needed
3732
+ * @param newStepCount the maximum number of iterations
3733
+ */
3734
+ setMaximumSubStepCount(newStepCount?: number): void;
3735
+ /**
3736
+ * Get the maximum number of iterations per navigation tick update
3737
+ * @returns the maximum number of iterations
3738
+ */
3739
+ getMaximumSubStepCount(): number;
3740
+ /**
3741
+ * Time factor applied when updating crowd agents (default 1). A value of 0 will pause crowd updates.
3742
+ * @param value the time factor applied at update
3743
+ */
3744
+ set timeFactor(value: number);
3745
+ /**
3746
+ * Get the time factor used for crowd agent update
3747
+ * @returns the time factor
3748
+ */
3749
+ get timeFactor(): number;
3750
+ /**
3751
+ * Creates a navigation mesh - will be injected by the factory
3752
+ * @param meshes array of all the geometry used to compute the navigation mesh
3753
+ * @param parameters bunch of parameters used to filter geometry
3754
+ * @returns the created navmesh and navmesh query
3755
+ * @throws Error if the function is not injected yet or if the navmesh is not created
3756
+ */
3757
+ createNavMesh(meshes: Array<BABYLON.Mesh>, parameters: INavMeshParametersV2): CreateNavMeshResult;
3758
+ /**
3759
+ * Creates a navigation mesh asynchronously - will be injected by the factory
3760
+ * @param meshes array of all the geometry used to compute the navigation mesh
3761
+ * @param parameters bunch of parameters used to filter geometry
3762
+ * @returns the created navmesh and navmesh query
3763
+ * @throws Error if the function is not injected yet or if the navmesh is not created
3764
+ */
3765
+ createNavMeshAsync(meshes: Array<BABYLON.Mesh>, parameters: INavMeshParametersV2): Promise<CreateNavMeshResult>;
3766
+ /**
3767
+ * Create a navigation mesh debug mesh
3768
+ * @param scene is where the mesh will be added
3769
+ * @returns debug display mesh
3770
+ */
3771
+ createDebugNavMesh(scene: BABYLON.Scene): BABYLON.Mesh;
3772
+ /**
3773
+ * Get a navigation mesh constrained position, closest to the parameter position
3774
+ * @param position world position
3775
+ * @returns the closest point to position constrained by the navigation mesh
3776
+ */
3777
+ getClosestPoint(position: BABYLON.IVector3Like, options?: {
3778
+ /**
3779
+ * The polygon filter to apply to the query.
3780
+ */
3781
+ filter?: any;
3782
+ /**
3783
+ * Half extents for the search box
3784
+ */
3785
+ halfExtents?: BABYLON.IVector3Like;
3786
+ }): BABYLON.Vector3;
3787
+ /**
3788
+ * Get a navigation mesh constrained position, closest to the parameter position
3789
+ * @param position world position
3790
+ * @param result output the closest point to position constrained by the navigation mesh
3791
+ */
3792
+ getClosestPointToRef(position: BABYLON.IVector3Like, result: BABYLON.Vector3, options?: {
3793
+ /**
3794
+ * The polygon filter to apply to the query.
3795
+ */
3796
+ filter?: any;
3797
+ /**
3798
+ * Half extents for the search box
3799
+ */
3800
+ halfExtents?: BABYLON.IVector3Like;
3801
+ }): void;
3802
+ /**
3803
+ * Get a navigation mesh constrained position, within a particular radius
3804
+ * @param position world position
3805
+ * @param maxRadius the maximum distance to the constrained world position
3806
+ * @returns the closest point to position constrained by the navigation mesh
3807
+ */
3808
+ getRandomPointAround(position: BABYLON.IVector3Like, maxRadius: number, options?: {
3809
+ startRef?: number;
3810
+ /**
3811
+ * The polygon filter to apply to the query.
3812
+ */
3813
+ filter?: any;
3814
+ /**
3815
+ * Half extents for the search box
3816
+ */
3817
+ halfExtents?: BABYLON.IVector3Like;
3818
+ }): BABYLON.Vector3;
3819
+ /**
3820
+ * Get a navigation mesh constrained position, within a particular radius
3821
+ * @param position world position
3822
+ * @param maxRadius the maximum distance to the constrained world position
3823
+ * @param result output the closest point to position constrained by the navigation mesh
3824
+ */
3825
+ getRandomPointAroundToRef(position: BABYLON.IVector3Like, maxRadius: number, result: BABYLON.Vector3, options?: {
3826
+ startRef?: number;
3827
+ /**
3828
+ * The polygon filter to apply to the query.
3829
+ */
3830
+ filter?: any;
3831
+ /**
3832
+ * Half extents for the search box
3833
+ */
3834
+ halfExtents?: BABYLON.IVector3Like;
3835
+ }): void;
3836
+ /**
3837
+ * Compute the final position from a segment made of destination-position
3838
+ * @param position position to start from
3839
+ * @param destination position to go to
3840
+ * @param startRef the reference id of the start polygon
3841
+ * @param options options for the function
3842
+ * @returns the resulting point along the navmesh
3843
+ */
3844
+ moveAlong(position: BABYLON.IVector3Like, destination: BABYLON.IVector3Like, startRef?: number, options?: {
3845
+ /**
3846
+ * The polygon filter to apply to the query.
3847
+ */
3848
+ filter?: any;
3849
+ /**
3850
+ * The maximum number of polygons the output visited array can hold.
3851
+ */
3852
+ maxVisitedSize?: number;
3853
+ }): BABYLON.Vector3;
3854
+ /**
3855
+ * Compute the final position from a segment made of destination-position
3856
+ * @param position world position
3857
+ * @param destination world position
3858
+ * @param result output the resulting point along the navmesh
3859
+ * @param startRef the reference id of the start polygon.
3860
+ * @param options options for the function
3861
+ */
3862
+ moveAlongToRef(position: BABYLON.IVector3Like, destination: BABYLON.IVector3Like, result: BABYLON.Vector3, startRef?: number, options?: {
3863
+ /**
3864
+ * The polygon filter to apply to the query.
3865
+ */
3866
+ filter?: any;
3867
+ maxVisitedSize?: number;
3868
+ }): void;
3869
+ /**
3870
+ * Compute a navigation path from start to end. Returns an empty array if no path can be computed
3871
+ * Path is straight.
3872
+ * @param start world position
3873
+ * @param end world position
3874
+ * @param options options for the function
3875
+ * @returns array containing world position composing the path
3876
+ */
3877
+ computePath(start: BABYLON.IVector3Like, end: BABYLON.IVector3Like, options?: {
3878
+ /**
3879
+ * The polygon filter to apply to the query.
3880
+ */
3881
+ filter?: any;
3882
+ /**
3883
+ * Half extents for the search box
3884
+ */
3885
+ halfExtents?: BABYLON.IVector3Like;
3886
+ maxPathPolys?: number;
3887
+ maxStraightPathPoints?: number;
3888
+ }): BABYLON.Vector3[];
3889
+ /**
3890
+ * Creates a navigation mesh - will be injected by the factory
3891
+ * @param start the start position of the navmesh
3892
+ * @param end the end position of the navmesh
3893
+ * @param options options to configure the path computation
3894
+ * @returns array containing world position composing the path
3895
+ */
3896
+ computePathSmooth(start: BABYLON.Vector3, end: BABYLON.Vector3, options?: {
3897
+ /**
3898
+ * The polygon filter to apply to the query.
3899
+ */
3900
+ filter?: any;
3901
+ /**
3902
+ * Half extents for the search box
3903
+ */
3904
+ halfExtents?: BABYLON.IVector3Like;
3905
+ maxPathPolys?: number;
3906
+ maxSmoothPathPoints?: number;
3907
+ stepSize?: number;
3908
+ slop?: number;
3909
+ }): BABYLON.Vector3[];
3910
+ /**
3911
+ * Create a new Crowd so you can add agents
3912
+ * @param maxAgents the maximum agent count in the crowd
3913
+ * @param maxAgentRadius the maximum radius an agent can have
3914
+ * @param scene to attach the crowd to
3915
+ * @returns the crowd you can add agents to
3916
+ */
3917
+ createCrowd(maxAgents: number, maxAgentRadius: number, scene: BABYLON.Scene): BABYLON.ICrowd;
3918
+ /**
3919
+ * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)
3920
+ * The queries will try to find a solution within those bounds
3921
+ * default is (1,1,1)
3922
+ * @param extent x,y,z value that define the extent around the queries point of reference
3923
+ */
3924
+ setDefaultQueryExtent(extent: BABYLON.IVector3Like): void;
3925
+ /**
3926
+ * Get the Bounding box extent specified by setDefaultQueryExtent
3927
+ * @returns the box extent values
3928
+ */
3929
+ getDefaultQueryExtent(): BABYLON.Vector3;
3930
+ /**
3931
+ * Get the Bounding box extent result specified by setDefaultQueryExtent
3932
+ * @param result output the box extent values
3933
+ */
3934
+ getDefaultQueryExtentToRef(result: BABYLON.Vector3): void;
3935
+ /**
3936
+ * build the navmesh from a previously saved state using getNavmeshData
3937
+ * @param data the Uint8Array returned by getNavmeshData
3938
+ */
3939
+ buildFromNavmeshData(data: Uint8Array): void;
3940
+ /**
3941
+ * returns the navmesh data that can be used later. The navmesh must be built before retrieving the data
3942
+ * @returns data the Uint8Array that can be saved and reused
3943
+ */
3944
+ getNavmeshData(): Uint8Array;
3945
+ /**
3946
+ * build the tile cache from a previously saved state using getTileCacheData
3947
+ * @param tileCacheData the data returned by getTileCacheData
3948
+ * @param tileCacheMeshProcess optional process to apply to each tile created
3949
+ */
3950
+ buildFromTileCacheData(tileCacheData: Uint8Array, tileCacheMeshProcess?: any): void;
3951
+ /**
3952
+ * returns the tile cache data that can be used later. The tile cache must be built before retrieving the data
3953
+ * @returns the tile cache data that can be used later. The tile cache must be built before retrieving the data
3954
+ * @throws Error if there is no any generated
3955
+ * @remarks The returned data can be used to rebuild the tile cache later using buildFromTileCacheData
3956
+ */
3957
+ getTileCacheData(): Uint8Array;
3958
+ /**
3959
+ * Disposes
3960
+ */
3961
+ dispose(): void;
3962
+ /**
3963
+ * Creates a cylinder obstacle and add it to the navigation
3964
+ * @param position world position
3965
+ * @param radius cylinder radius
3966
+ * @param height cylinder height
3967
+ * @param doNotWaitForCacheUpdate if true the function will not wait for the tile cache to be fully updated before returning
3968
+ * @returns the obstacle freshly created
3969
+ */
3970
+ addCylinderObstacle(position: BABYLON.IVector3Like, radius: number, height: number, doNotWaitForCacheUpdate?: boolean): BABYLON.Nullable<BABYLON.IObstacle>;
3971
+ /**
3972
+ * Creates an oriented box obstacle and add it to the navigation
3973
+ * @param position world position
3974
+ * @param extent box size
3975
+ * @param angle angle in radians of the box orientation on Y axis
3976
+ * @param doNotWaitForCacheUpdate if true the function will not wait for the tile cache to be fully updated before returning
3977
+ * @returns the obstacle freshly created
3978
+ */
3979
+ addBoxObstacle(position: BABYLON.IVector3Like, extent: BABYLON.IVector3Like, angle: number, doNotWaitForCacheUpdate?: boolean): BABYLON.Nullable<BABYLON.IObstacle>;
3980
+ /**
3981
+ * Removes an obstacle created by addCylinderObstacle or addBoxObstacle
3982
+ * @param obstacle obstacle to remove from the navigation
3983
+ * @param doNotWaitForCacheUpdate if true the function will not wait for the tile cache to be fully updated before returning
3984
+ *
3985
+ */
3986
+ removeObstacle(obstacle: BABYLON.IObstacle, doNotWaitForCacheUpdate?: boolean): void;
3987
+ /**
3988
+ * If this plugin is supported
3989
+ * @returns true if plugin is supported
3990
+ */
3991
+ isSupported(): boolean;
3992
+ /**
3993
+ * Returns the seed used for randomized functions like `getRandomPointAround`
3994
+ * @returns seed number
3995
+ */
3996
+ getRandomSeed(): number;
3997
+ /**
3998
+ * Set the seed used for randomized functions like `getRandomPointAround`
3999
+ * @param seed number used as seed for random functions
4000
+ */
4001
+ setRandomSeed(seed: number): void;
4002
+ /**
4003
+ * Perform a raycast on the navmesh
4004
+ * @param start start position
4005
+ * @param end end position
4006
+ * @returns if a direct path exists between start and end, and the hit point if any
4007
+ */
4008
+ raycast(start: BABYLON.IVector3Like, end: BABYLON.IVector3Like): {
4009
+ hit: boolean;
4010
+ hitPoint?: undefined;
4011
+ } | {
4012
+ hit: boolean;
4013
+ hitPoint: BABYLON.Vector3;
4014
+ };
4015
+ /**
4016
+ * Compute the final position from a segment made of destination-position, and return the height of the polygon
4017
+ * This is a more sophisiticated version of moveAlong that will use the height of the polygon at the end position
4018
+ * @param position world position to start from
4019
+ * @param velocity wvelocity of the movement
4020
+ * @param options options for the function
4021
+ * @returns the resulting point along the navmesh, the polygon reference id and the height of the polygon
4022
+ */
4023
+ moveAlongWithVelocity(position: BABYLON.IVector3Like, velocity: BABYLON.IVector3Like, options?: {
4024
+ /**
4025
+ * The polygon filter to apply to the query.
4026
+ */
4027
+ filter?: any;
4028
+ /**
4029
+ * Half extents for the search box
4030
+ */
4031
+ halfExtents?: BABYLON.IVector3Like;
4032
+ /**
4033
+ * The maximum number of polygons the output visited array can hold.
4034
+ */
4035
+ maxVisitedSize?: number;
4036
+ }): {
4037
+ position: {
4038
+ x: number;
4039
+ y: number;
4040
+ z: number;
4041
+ };
4042
+ polyRef: number;
4043
+ height: number;
4044
+ };
4045
+ /**
4046
+ * Handles common post-processing and validation of navmesh creation results
4047
+ * @param result The partial result from navmesh creation
4048
+ * @returns The validated and complete CreateNavMeshresult
4049
+ */
4050
+ private _processNavMeshResult;
4051
+ private _preprocessParameters;
4052
+ }
4053
+
4054
+
1691
4055
  /**
1692
- * The height in kilometers of the scene's origin.
4056
+ * Recast Detour crowd implementation
4057
+ * This class provides methods to manage a crowd of agents, allowing them to navigate a navigation mesh.
4058
+ * It supports adding agents, updating their parameters, moving them to destinations, and checking their states.
4059
+ * The crowd is updated in the scene's animation loop, and it notifies observers when agents reach their destinations.
1693
4060
  */
1694
- get originHeight(): number;
1695
- set originHeight(value: number);
4061
+ export class RecastJSCrowd implements BABYLON.ICrowd {
4062
+ /**
4063
+ * Recast plugin
4064
+ */
4065
+ get navigationPlugin(): RecastNavigationJSPluginV2;
4066
+ /**
4067
+ * Link to the detour crowd
4068
+ */
4069
+ get recastCrowd(): any;
4070
+ /**
4071
+ * One transform per agent
4072
+ */
4073
+ get transforms(): BABYLON.TransformNode[];
4074
+ /**
4075
+ * All agents created
4076
+ */
4077
+ get agents(): readonly number[];
4078
+ /**
4079
+ * Agents reach radius
4080
+ */
4081
+ get reachRadii(): readonly number[];
4082
+ private _navigationPlugin;
4083
+ private _recastCrowd;
4084
+ private _transforms;
4085
+ private _agents;
4086
+ private _reachRadii;
4087
+ /**
4088
+ * true when a destination is active for an agent and notifier hasn't been notified of reach
4089
+ */
4090
+ private _agentDestinationArmed;
4091
+ /**
4092
+ * agent current target
4093
+ */
4094
+ private _agentDestination;
4095
+ /**
4096
+ * Link to the scene is kept to unregister the crowd from the scene
4097
+ */
4098
+ private _scene;
4099
+ private _engine;
4100
+ /**
4101
+ * Observer for crowd updates
4102
+ */
4103
+ private _onBeforeAnimationsObserver;
4104
+ /**
4105
+ * Fires each time an agent is in reach radius of its destination
4106
+ */
4107
+ onReachTargetObservable: BABYLON.Observable<{
4108
+ /**
4109
+ *
4110
+ */
4111
+ agentIndex: number;
4112
+ /**
4113
+ *
4114
+ */
4115
+ destination: BABYLON.Vector3;
4116
+ }>;
4117
+ /**
4118
+ * Constructor
4119
+ * @param plugin recastJS plugin
4120
+ * @param maxAgents the maximum agent count in the crowd
4121
+ * @param maxAgentRadius the maximum radius an agent can have
4122
+ * @param scene to attach the crowd to
4123
+ * @returns the crowd you can add agents to
4124
+ */
4125
+ constructor(plugin: RecastNavigationJSPluginV2, maxAgents: number, maxAgentRadius: number, scene: BABYLON.Scene);
4126
+ /**
4127
+ * Add a new agent to the crowd with the specified parameter a corresponding transformNode.
4128
+ * You can attach anything to that node. The node position is updated in the scene update tick.
4129
+ * @param pos world position that will be constrained by the navigation mesh
4130
+ * @param parameters agent parameters
4131
+ * @param transform hooked to the agent that will be update by the scene
4132
+ * @returns agent index
4133
+ */
4134
+ addAgent(pos: BABYLON.IVector3Like, parameters: IAgentParametersV2, transform: BABYLON.TransformNode): number;
4135
+ /**
4136
+ * Returns the agent position in world space
4137
+ * @param index agent index returned by addAgent
4138
+ * @returns world space position
4139
+ */
4140
+ getAgentPosition(index: number): BABYLON.Vector3;
4141
+ /**
4142
+ * Returns the agent position result in world space
4143
+ * @param index agent index returned by addAgent
4144
+ * @param result output world space position
4145
+ */
4146
+ getAgentPositionToRef(index: number, result: BABYLON.Vector3): void;
4147
+ /**
4148
+ * Returns the agent velocity in world space
4149
+ * @param index agent index returned by addAgent
4150
+ * @returns world space velocity
4151
+ */
4152
+ getAgentVelocity(index: number): BABYLON.Vector3;
4153
+ /**
4154
+ * Returns the agent velocity result in world space
4155
+ * @param index agent index returned by addAgent
4156
+ * @param result output world space velocity
4157
+ */
4158
+ getAgentVelocityToRef(index: number, result: BABYLON.Vector3): void;
4159
+ /**
4160
+ * Returns the agent next target point on the path
4161
+ * @param index agent index returned by addAgent
4162
+ * @returns world space position
4163
+ */
4164
+ getAgentNextTargetPath(index: number): BABYLON.Vector3;
4165
+ /**
4166
+ * Returns the agent next target point on the path
4167
+ * @param index agent index returned by addAgent
4168
+ * @param result output world space position
4169
+ */
4170
+ getAgentNextTargetPathToRef(index: number, result: BABYLON.Vector3): void;
4171
+ /**
4172
+ * Gets the agent state
4173
+ * @param index agent index returned by addAgent
4174
+ * @returns agent state, 0 = DT_CROWDAGENT_STATE_INVALID, 1 = DT_CROWDAGENT_STATE_WALKING, 2 = DT_CROWDAGENT_STATE_OFFMESH
4175
+ */
4176
+ getAgentState(index: number): number;
4177
+ /**
4178
+ * returns true if the agent in over an off mesh link connection
4179
+ * @param index agent index returned by addAgent
4180
+ * @returns true if over an off mesh link connection
4181
+ */
4182
+ overOffmeshConnection(index: number): boolean;
4183
+ /**
4184
+ * Asks a particular agent to go to a destination. That destination is constrained by the navigation mesh
4185
+ * @param index agent index returned by addAgent
4186
+ * @param destination targeted world position
4187
+ */
4188
+ agentGoto(index: number, destination: BABYLON.IVector3Like): void;
4189
+ /**
4190
+ * Teleport the agent to a new position
4191
+ * @param index agent index returned by addAgent
4192
+ * @param destination targeted world position
4193
+ */
4194
+ agentTeleport(index: number, destination: BABYLON.IVector3Like): void;
4195
+ /**
4196
+ * Update agent parameters
4197
+ * @param index agent index returned by addAgent
4198
+ * @param parameters agent parameters
4199
+ */
4200
+ updateAgentParameters(index: number, parameters: IAgentParametersV2): void;
4201
+ /**
4202
+ * remove a particular agent previously created
4203
+ * @param index agent index returned by addAgent
4204
+ */
4205
+ removeAgent(index: number): void;
4206
+ /**
4207
+ * get the list of all agents attached to this crowd
4208
+ * @returns list of agent indices
4209
+ */
4210
+ getAgents(): number[];
4211
+ /**
4212
+ * Tick update done by the BABYLON.Scene. Agent position/velocity/acceleration is updated by this function
4213
+ * @param deltaTime in seconds
4214
+ */
4215
+ update(deltaTime: number): void;
4216
+ /**
4217
+ * Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...)
4218
+ * The queries will try to find a solution within those bounds
4219
+ * default is (1,1,1)
4220
+ * @param extent x,y,z value that define the extent around the queries point of reference
4221
+ */
4222
+ setDefaultQueryExtent(extent: BABYLON.IVector3Like): void;
4223
+ /**
4224
+ * Get the Bounding box extent specified by setDefaultQueryExtent
4225
+ * @returns the box extent values
4226
+ */
4227
+ getDefaultQueryExtent(): BABYLON.Vector3;
4228
+ /**
4229
+ * Get the Bounding box extent result specified by setDefaultQueryExtent
4230
+ * @param result output the box extent values
4231
+ */
4232
+ getDefaultQueryExtentToRef(result: BABYLON.Vector3): void;
4233
+ /**
4234
+ * Get the next corner points composing the path (max 4 points)
4235
+ * @param index agent index returned by addAgent
4236
+ * @returns array containing world position composing the path
4237
+ */
4238
+ getCorners(index: number): BABYLON.Vector3[];
4239
+ /**
4240
+ * Release all resources
4241
+ */
4242
+ dispose(): void;
4243
+ }
4244
+
4245
+
1696
4246
  /**
1697
- * When atmospheric scattering is applied to surfaces, if this value is set to true,
1698
- * a grayscale approximation of the transmittance is used to dim surfaces.
1699
- *
1700
- * When set to false, the atmospheric composition does not dim the surfaces behind it.
1701
- * It is up to the client application to apply transmittance manually.
4247
+ * Injects the navigation mesh generation methods into the navigation plugin.
4248
+ * @param navigationPlugin The navigation plugin to inject the methods into.
1702
4249
  */
1703
- get applyApproximateTransmittance(): boolean;
1704
- set applyApproximateTransmittance(value: boolean);
4250
+ export function InjectGenerators(navigationPlugin: RecastNavigationJSPluginV2): void;
4251
+
4252
+
4253
+
4254
+
1705
4255
  /**
1706
- * The directional lights in the scene which represent the suns illuminating the atmosphere.
1707
- * Each frame, the color and intensity of the lights are updated based on the camera position and the light's direction.
4256
+ * IMPORTANT!
4257
+ * This file is still under construction and will change in the future.
4258
+ * Workers are not yet supported.
4259
+ * For more info visit: https://forum.babylonjs.com/t/replacing-recastjs-with-recast-navigation-js/56003/46
1708
4260
  */
1709
- get lights(): ReadonlyArray<DirectionalLight>;
1710
4261
  /**
1711
- * The rendering group ID for the sky compositor.
1712
- * The sky will only be rendered for this group.
4262
+ * Builds a any and any from meshes using provided parameters.
4263
+ * @param meshes The array of meshes used to create the any
4264
+ * @param parameters The parameters used to configure the any generation.
4265
+ * @param workerOptions Options for the worker, including a completion callback and the worker instance.
4266
+ * @throws Error if the any data is invalid or cannot be deserialized.
1713
4267
  */
1714
- get skyRenderingGroup(): number;
1715
- set skyRenderingGroup(value: number);
4268
+ export function GenerateNavMeshWithWorker(meshes: Array<BABYLON.Mesh>, parameters: INavMeshParametersV2, workerOptions: {
4269
+ /**
4270
+ * Completion callback that is called when the any generation is complete.
4271
+ * @param navMesh The generated any
4272
+ * @param navMeshQuery The any associated with the generated any
4273
+ * @param tileCache Optional any if tile cache generation was used.
4274
+ */
4275
+ completion: (navMesh: any, navMeshQuery: any, tileCache?: any) => void;
4276
+ /**
4277
+ * Worker instance used for asynchronous any generation.
4278
+ */
4279
+ worker: Worker;
4280
+ }): void;
4281
+
4282
+
1716
4283
  /**
1717
- * The rendering group ID for the aerial perspective compositor.
1718
- * Aerial perspective will only be rendered for this group.
4284
+ * Builds a NavMesh and NavMeshQuery from meshes using provided parameters.
4285
+ * @param meshes The array of meshes used to create the NavMesh.
4286
+ * @param parameters The parameters used to configure the NavMesh generation.
4287
+ * @returns An object containing the NavMesh and NavMeshQuery.
4288
+ * @remarks This function generates a NavMesh based on the provided meshes and parameters.
4289
+ * It supports different configurations such as solo, tiled, and tile cache nav meshes.
4290
+ * If you need obstacles, ensure that `maxObstacles` is set to a value greater than 0.
4291
+ * Recommended values for `tileSize` are between 32 and 64 when using obstacles/tile cache.
4292
+ * If you need a tiled nav mesh, ensure that `tileSize` is set to a value greater than 0.
4293
+ * @throws Error if the NavMesh data is invalid or cannot be deserialized.
1719
4294
  */
1720
- get aerialPerspectiveRenderingGroup(): number;
1721
- set aerialPerspectiveRenderingGroup(value: number);
4295
+ export function GenerateNavMesh(meshes: Array<BABYLON.Mesh>, parameters: INavMeshParametersV2): {
4296
+ navMesh: any;
4297
+ intermediates: any;
4298
+ navMeshQuery: any;
4299
+ tileCache: any;
4300
+ };
4301
+
4302
+
1722
4303
  /**
1723
- * The rendering group ID for the globe atmosphere compositor.
1724
- * The globe atmosphere will only be rendered for this group.
4304
+ * Builds a NavMesh and NavMeshQuery from serialized data.
4305
+ * @param data The serialized NavMesh data.
4306
+ * @returns An object containing the NavMesh and NavMeshQuery.
4307
+ * @remarks This function deserializes the NavMesh data and creates a NavMeshQuery
4308
+ * instance for querying the NavMesh.
4309
+ * @throws Error if the NavMesh data is invalid or cannot be deserialized.
1725
4310
  */
1726
- get globeAtmosphereRenderingGroup(): number;
1727
- set globeAtmosphereRenderingGroup(value: number);
4311
+ export function BuildFromNavmeshData(data: Uint8Array): {
4312
+ navMesh: any;
4313
+ navMeshQuery: any;
4314
+ tileCache: undefined;
4315
+ };
1728
4316
  /**
1729
- * Gets the uniform buffer used to store the atmosphere's physical properties.
4317
+ * Builds a TileCache and NavMeshQuery from serialized data.
4318
+ * @param data The serialized TileCache data.
4319
+ * @param tileCacheMeshProcess Optional function to process the TileCache mesh.
4320
+ * @returns An object containing the TileCache, NavMesh, and NavMeshQuery.
1730
4321
  */
1731
- get uniformBuffer(): UniformBuffer;
4322
+ export function BuildFromTileCacheData(data: Uint8Array, tileCacheMeshProcess: any): {
4323
+ navMesh: any;
4324
+ navMeshQuery: any;
4325
+ tileCache: any;
4326
+ };
4327
+
4328
+
4329
+
4330
+
1732
4331
  /**
1733
- * Gets the camera-related variables for this atmosphere. Updated each frame.
4332
+ * Creates a navigation plugin for the given scene using a worker.
4333
+ * @returns A promise that resolves to the created navigation plugin.
4334
+ * @remarks This function initializes the Recast module and sets up the navigation plugin to use a worker.
4335
+ * The worker is used to handle the creation of the navigation mesh asynchronously.
4336
+ * The `createNavMesh` method is not supported in worker mode, use `createNavMeshAsync` instead.
1734
4337
  */
1735
- get cameraAtmosphereVariables(): AtmospherePerCameraVariables;
1736
- readonly uniqueId: number;
4338
+ export function CreateNavigationPluginWorkerAsync(): Promise<RecastNavigationJSPluginV2>;
4339
+
4340
+
1737
4341
  /**
1738
- * Constructs the {@link Atmosphere}.
1739
- * @param name - The name of this instance.
1740
- * @param scene - The scene to which the atmosphere will be added.
1741
- * @param lights - The light sources that illuminate the atmosphere. Currently only supports one light, and that light should be the first light in the scene.
1742
- * @param options - The options used to create the atmosphere.
4342
+ * Creates a navigation plugin for the given scene.
4343
+ * @returns A promise that resolves to the created navigation plugin.
4344
+ * @remarks This function initializes the Recast module and sets up the navigation plugin.
1743
4345
  */
1744
- constructor(name: string, scene: Scene, lights: DirectionalLight[], options?: IAtmosphereOptions);
4346
+ export function CreateNavigationPluginAsync(): Promise<RecastNavigationJSPluginV2>;
4347
+
4348
+
1745
4349
  /**
1746
- * @override
4350
+ * Gets the RecastInjection instance (reference to the recast-navigation-js library).
4351
+ * @returns The RecastInjection instance
4352
+ * @throws Error if Recast is not initialized
1747
4353
  */
1748
- dispose(): void;
4354
+ export function GetRecast(): RecastInjection;
1749
4355
  /**
1750
- * True if the atmosphere is enabled.
1751
- * @returns - True if the atmosphere is enabled.
4356
+ * Sets the RecastInjection instance (reference to the recast-navigation-js library).
4357
+ * @param recast The RecastInjection instance to set
1752
4358
  */
1753
- isEnabled(): boolean;
4359
+ export function SetRecast(recast: RecastInjection): void;
1754
4360
  /**
1755
- * Sets the enabled state of the atmosphere.
1756
- * @param enabled - True to enable the atmosphere, false to disable it.
4361
+ * Initialize the Manifold library
4362
+ * @param version defines the version of the library to use, default is "0.43.0"
4363
+ * @param options defines the options to use to initialize the library
1757
4364
  */
1758
- setEnabled(enabled: boolean): void;
4365
+ export function InitRecast(version?: string, options?: {
4366
+ instance: RecastInjection;
4367
+ }): Promise<void>;
4368
+
4369
+
1759
4370
  /**
1760
- * The class name of the {@link Atmosphere}.
1761
- * @returns - The class name of the atmosphere.
4371
+ * Creates a debug mesh for visualizing a any in the scene.
4372
+ * @param navMesh The any to visualize.
4373
+ * @param scene The scene in which to create the debug mesh.
4374
+ * @param parent Optional parent node for the debug mesh.
4375
+ * @param flags Poly flags to filter by, defaults to undefined to include all polys
4376
+ * @returns The created debug mesh.
1762
4377
  */
1763
- getClassName(): string;
4378
+ export function CreateDebugNavMesh(navMesh: any, scene: BABYLON.Scene, parent?: BABYLON.Node, flags?: number): BABYLON.Mesh;
4379
+
4380
+
4381
+
4382
+
4383
+ export var DebugLayerOption: {
4384
+ HEIGHTFIELD_SOLID: string;
4385
+ HEIGHTFIELD_WALKABLE: string;
4386
+ COMPACT_HEIGHTFIELD_SOLID: string;
4387
+ COMPACT_HEIGHTFIELD_REGIONS: string;
4388
+ COMPACT_HEIGHTFIELD_DISTANCE: string;
4389
+ RAW_CONTOURS: string;
4390
+ CONTOURS: string;
4391
+ POLY_MESH: string;
4392
+ POLY_MESH_DETAIL: string;
4393
+ NAVMESH: string;
4394
+ NAVMESH_BV_TREE: string;
4395
+ };
4396
+ export type DebugLayerOptions = (typeof DebugLayerOption)[keyof typeof DebugLayerOption];
1764
4397
  /**
1765
- * Gets the color of a light after being transmitted through the atmosphere to a point specified by its distance to the planet center and its geocentric normal.
1766
- * NOTE, the result is always a linear space color.
1767
- * @param directionToLight - The direction of the light.
1768
- * @param pointRadius - The distance from the planet center to the point in kilometers.
1769
- * @param pointGeocentricNormal - The geocentric normal at the point i.e., normalize(point - planet center).
1770
- * @param result - The color to store the result in.
1771
- * @returns The result color.
4398
+ * NavigationDebugger is a utility class for visualizing navigation meshes and related data in a Babylon.js scene.
4399
+ * It provides methods to draw various navigation-related primitives such as points, lines, triangles, and quads.
4400
+ * It also supports drawing heightfields, compact heightfields, contours, poly meshes, and nav meshes.
1772
4401
  */
1773
- getTransmittedColorToRef: <T extends IColor3Like>(directionToLight: IVector3Like, pointRadius: number, pointGeocentricNormal: IVector3Like, result: T) => T;
4402
+ export class NavigationDebugger {
4403
+ private _scene;
4404
+ /**
4405
+ * The name of the debug mesh used for navigation debugging.
4406
+ * This is used to group all navigation debug meshes under a single name for easier management
4407
+ */
4408
+ static NAV_MESH_DEBUG_NAME: string;
4409
+ /**
4410
+ * The name of the debug mesh used for visualization of the navigation mesh using points.
4411
+ */
4412
+ static NAV_MESH_DEBUG_NAME_POINTS: string;
4413
+ /**
4414
+ * The name of the debug mesh used for visualization of the navigation mesh using triangles.
4415
+ */
4416
+ static NAV_MESH_DEBUG_NAME_TRIS: string;
4417
+ /**
4418
+ * The name of the debug mesh used for visualization of the navigation mesh using quads.
4419
+ */
4420
+ static NAV_MESH_DEBUG_NAME_QUADS: string;
4421
+ /**
4422
+ * The name of the debug mesh used for visualization of the navigation mesh using lines.
4423
+ */
4424
+ static NAV_MESH_DEBUG_NAME_LINES: string;
4425
+ /**
4426
+ * The material used for rendering triangles in the navigation debug visualization.
4427
+ */
4428
+ triMaterial: BABYLON.StandardMaterial;
4429
+ /**
4430
+ * The material used for rendering points in the navigation debug visualization.
4431
+ */
4432
+ pointMaterial: BABYLON.StandardMaterial;
4433
+ /**
4434
+ * The list of line materials used in the navigation debug visualization.
4435
+ */
4436
+ lineMaterials: BABYLON.StandardMaterial[];
4437
+ /**
4438
+ * The parent node for the debug drawer.
4439
+ */
4440
+ debugDrawerParentNode: BABYLON.TransformNode;
4441
+ /**
4442
+ * * Gets or sets the primitive types to be drawn by the debug drawer.
4443
+ * * This allows you to control which types of primitives (points, lines, tris, quads) are rendered in the navigation debug visualization.
4444
+ * * The default value is `["points", "lines", "tris", "quads"]`.
4445
+ * * You can modify this property to include or exclude specific primitive types based on your debugging needs.
4446
+ * @returns An array of primitive types that the debug drawer will render.
4447
+ */
4448
+ get primitiveTypes(): any;
4449
+ set primitiveTypes(value: any);
4450
+ private _lineMaterialOptions;
4451
+ private _pointMesh;
4452
+ private _debugDrawerUtils;
4453
+ private _primitiveTypes;
4454
+ constructor(_scene: BABYLON.Scene, options?: {
4455
+ parent?: {
4456
+ node?: BABYLON.TransformNode | string;
4457
+ };
4458
+ primitiveTypes?: any;
4459
+ materials?: {
4460
+ triMaterial?: BABYLON.StandardMaterial;
4461
+ pointMaterial?: BABYLON.StandardMaterial;
4462
+ lineMaterialOptions: {
4463
+ greasedLineMaterialOptions: Partial<BABYLON.GreasedLineMaterialOptions>;
4464
+ greasedLineMeshOptions: Partial<BABYLON.GreasedLineMeshOptions>;
4465
+ };
4466
+ };
4467
+ });
4468
+ /**
4469
+ * Resets the debug drawer by disposing of all child meshes in the debug drawer parent node.
4470
+ * This is useful for clearing the debug visualization before drawing new primitives.
4471
+ */
4472
+ clear(): void;
4473
+ /**
4474
+ * Disposes of the debug drawer, including all meshes and materials used for rendering.
4475
+ * This method should be called when the debug drawer is no longer needed to free up resources.
4476
+ */
4477
+ dispose(): void;
4478
+ /**
4479
+ * This method iterates through the provided primitives and draws them based on their type.
4480
+ * It supports drawing points, lines, triangles, and quads, depending on the primitive type.
4481
+ * @param primitives An array of debug drawer primitives to be drawn.
4482
+ * @param options Optional parameters to control the drawing behavior, such as whether to join meshes.
4483
+ */
4484
+ drawPrimitives(primitives: any, options?: {
4485
+ joinMeshes?: boolean;
4486
+ }): void;
4487
+ /**
4488
+ * Draws a heightfield as solid using the debug drawer utilities.
4489
+ * @param hf The heightfield to draw as solid.
4490
+ */
4491
+ drawHeightfieldSolid(hf: any): void;
4492
+ /**
4493
+ * Draws a heightfield as walkable using the debug drawer utilities.
4494
+ * @param hf The heightfield to draw as walkable.
4495
+ */
4496
+ drawHeightfieldWalkable(hf: any): void;
4497
+ /**
4498
+ * Draws a compact heightfield as solid using the debug drawer utilities.
4499
+ * @param chf The compact heightfield to draw as solid.
4500
+ */
4501
+ drawCompactHeightfieldSolid(chf: any): void;
4502
+ /**
4503
+ * Draws the regions of a compact heightfield using the debug drawer utilities.
4504
+ * @param chf The compact heightfield to draw regions for.
4505
+ */
4506
+ drawCompactHeightfieldRegions(chf: any): void;
4507
+ /**
4508
+ * Draws the distance field of a compact heightfield using the debug drawer utilities.
4509
+ * @param chf The compact heightfield to draw the distance for.
4510
+ */
4511
+ drawCompactHeightfieldDistance(chf: any): void;
4512
+ /**
4513
+ * Draws a heightfield layer using the debug drawer utilities.
4514
+ * @param layer The heightfield layer to draw.
4515
+ * @param idx The index of the layer to draw.
4516
+ */
4517
+ drawHeightfieldLayer(layer: any, idx: number): void;
4518
+ /**
4519
+ * Draws the layers of a heightfield using the debug drawer utilities.
4520
+ * @param lset The heightfield layer set containing the layers to draw.
4521
+ */
4522
+ drawHeightfieldLayers(lset: any): void;
4523
+ /**
4524
+ * Draws the region connections of a any using the debug drawer utilities.
4525
+ * @param cset any to draw
4526
+ * @param alpha The alpha value for the drawn contours, default is 1.
4527
+ */
4528
+ drawRegionConnections(cset: any, alpha?: number): void;
4529
+ /**
4530
+ * Draws raw contours from a any using the debug drawer utilities.
4531
+ * @param cset any to draw
4532
+ * @param alpha The alpha value for the drawn contours, default is 1.
4533
+ */
4534
+ drawRawContours(cset: any, alpha?: number): void;
4535
+ /**
4536
+ * Draws contours from a any using the debug drawer utilities.
4537
+ * @param cset any to draw
4538
+ * @param alpha The alpha value for the drawn contours, default is 1.
4539
+ */
4540
+ drawContours(cset: any, alpha?: number): void;
4541
+ /**
4542
+ * Draws a poly mesh using the debug drawer utilities.
4543
+ * @param mesh any to draw
4544
+ */
4545
+ drawPolyMesh(mesh: any): void;
4546
+ /**
4547
+ * Draws a poly mesh detail using the debug drawer utilities.
4548
+ * @param dmesh any to draw
4549
+ */
4550
+ drawPolyMeshDetail(dmesh: any): void;
4551
+ /**
4552
+ * Draws a any using the debug drawer utilities.
4553
+ * @param mesh any to draw
4554
+ * @param flags Flags to control the drawing behavior, default is 0.
4555
+ */
4556
+ drawNavMesh(mesh: any, flags?: number): void;
4557
+ /**
4558
+ * Draws a any with closed list using the debug drawer utilities.
4559
+ * @param mesh any to draw
4560
+ * @param query any to use for drawing the closed list.
4561
+ * @param flags Flags to control the drawing behavior, default is 0.
4562
+ */
4563
+ drawNavMeshWithClosedList(mesh: any, query: any, flags?: number): void;
4564
+ /**
4565
+ * Draws the nodes of a any using the debug drawer utilities.
4566
+ * @param query any to use for drawing the nodes.
4567
+ */
4568
+ drawNavMeshNodes(query: any): void;
4569
+ /**
4570
+ * Draws the bounding volume tree of a any using the debug drawer utilities.
4571
+ * @param mesh any to draw the bounding volume tree for.
4572
+ */
4573
+ drawNavMeshBVTree(mesh: any): void;
4574
+ /**
4575
+ * Draws the portals of a any using the debug drawer utilities.
4576
+ * @param mesh any to draw the portals for.
4577
+ */
4578
+ drawNavMeshPortals(mesh: any): void;
4579
+ /**
4580
+ * Draws polygons of a any with specific flags using the debug drawer utilities.
4581
+ * @param mesh any to draw the polygons with specific flags.
4582
+ * @param flags The flags to filter the polygons to be drawn.
4583
+ * @param col The color to use for the drawn polygons, represented as a number.
4584
+ */
4585
+ drawNavMeshPolysWithFlags(mesh: any, flags: number, col: number): void;
4586
+ /**
4587
+ * Draws polygons of a any with specific reference and color using the debug drawer utilities.
4588
+ * @param mesh any to draw the polygons with specific reference and color.
4589
+ * @param ref The reference number of the polygons to be drawn.
4590
+ * @param col The color to use for the drawn polygons, represented as a number.
4591
+ */
4592
+ drawNavMeshPoly(mesh: any, ref: number, col: number): void;
4593
+ /**
4594
+ * Get the intermediates from the generator
4595
+ * @param intermediates - The generator intermediates
4596
+ * @returns An object containing lists of heightfields, compact heightfields, contour sets
4597
+ */
4598
+ getIntermediates: (intermediates: GeneratorIntermediates) => {
4599
+ heightfieldList: any;
4600
+ compactHeightfieldList: any;
4601
+ contourSetList: any;
4602
+ polyMeshList: any;
4603
+ polyMeshDetailList: any;
4604
+ };
4605
+ /**
4606
+ * Draw debug information based on the selected option
4607
+ * @param navMesh - The navigation mesh to draw
4608
+ * @param intermediates - The generator intermediates containing the data to draw
4609
+ * @param scene - The scene to draw in
4610
+ * @param option - The debug drawer option to use
4611
+ * @remarks This method will reset the debug drawer before drawing.
4612
+ */
4613
+ draw(navMesh: any, intermediates: GeneratorIntermediates, scene: BABYLON.Scene, option: DebugLayerOptions): void;
4614
+ private _drawPoints;
4615
+ private _drawLines;
4616
+ private _drawTris;
4617
+ private _drawQuads;
4618
+ /**
4619
+ * Merge the debug meshes for better performance
4620
+ */
4621
+ private _joinDebugMeshes;
4622
+ private _convertUnindexedToIndexed;
4623
+ }
4624
+
4625
+
1774
4626
  /**
1775
- * Gets the diffuse sky irradiance. Result is always in linear space.
1776
- * @param directionToLight - The direction of the point to the light.
1777
- * @param pointRadius - The distance from the planet center to the point in kilometers.
1778
- * @param pointGeocentricNormal - The geocentric normal at the point: normalize(point - planet center).
1779
- * @param lightIrradiance - The irradiance of the light.
1780
- * @param result - The color to store the result in.
1781
- * @returns The result color.
4627
+ * Utility function based on Chaikin's alogrithm for navigation path smoothing and segment generation.
4628
+ * @param points Array of points to be smoothed, where each point is an object with x, y, and z properties.
4629
+ * @param iterations Number of smoothing iterations to apply. Default 1.
4630
+ * @returns A new array of smoothed points after applying the Chaikin's algorithm.
1782
4631
  */
1783
- getDiffuseSkyIrradianceToRef: <T extends IColor3Like>(directionToLight: IVector3Like, pointRadius: number, pointGeocentricNormal: IVector3Like, lightIrradiance: number, result: T) => T;
4632
+ export function GetChaikinSmoothPath(points: BABYLON.IVector3Like[], iterations?: number): BABYLON.IVector3Like[];
1784
4633
  /**
1785
- * Creates a new {@link EffectWrapper} for the multiple scattering LUT
1786
- * @returns The newly created {@link EffectWrapper}.
4634
+ * Generates a series of points that create an L-shaped path between each pair of points in the input navigation segment.
4635
+ * The path consists of a horizontal segment followed by a vertical segment, or vice versa,
4636
+ * depending on the relative distances between the x and z coordinates of the points.
4637
+ * @param navSegment An array of BABYLON.Vector3 points representing the navigation segment.
4638
+ * @returns An array of BABYLON.Vector3 points representing the L-shaped path.
1787
4639
  */
1788
- private _createMultiScatteringEffectWrapper;
4640
+ export function GetLShapedPath(navSegment: BABYLON.Vector3[]): BABYLON.Vector3[];
4641
+
4642
+
1789
4643
  /**
1790
- * Draws the multiple scattering LUT using {@link EffectWrapper} and {@link EffectRenderer}.
4644
+ * Creates a default tile cache mesh process function
4645
+ * @param offMeshConnections offMeshConnections
4646
+ * @param area the area to be set for each poly
4647
+ * @param flags the flags to be set for each poly
4648
+ * @returns the tile cache mesh process function
1791
4649
  */
1792
- private _drawMultiScatteringLut;
4650
+ export function CreateDefaultTileCacheMeshProcess(offMeshConnections?: any, area?: number, flags?: number): any;
1793
4651
  /**
1794
- * Draws the aerial perspective compositor using {@link EffectWrapper} and {@link EffectRenderer}.
4652
+ * Waits until the tile cache is fully updated
4653
+ * @param navMesh The any
4654
+ * @param tileCache THe any
1795
4655
  */
1796
- drawAerialPerspectiveCompositor(): void;
4656
+ export function WaitForFullTileCacheUpdate(navMesh: any, tileCache: any): void;
4657
+
4658
+
1797
4659
  /**
1798
- * Draws the sky compositor using {@link EffectWrapper} and {@link EffectRenderer}.
4660
+ * Compute a smooth navigation path from start to end. Returns an empty array if no path can be computed
4661
+ * @param navMesh the navigation mesh to use
4662
+ * @param navmeshQuery the navigation mesh query to use
4663
+ * @param start world position
4664
+ * @param end world position
4665
+ * @param options options object
4666
+ * @returns array containing world position composing the path
1799
4667
  */
1800
- drawSkyCompositor(): void;
4668
+ export function ComputeSmoothPath(navMesh: any, navmeshQuery: any, start: BABYLON.IVector3Like, end: BABYLON.IVector3Like, options?: {
4669
+ filter?: any;
4670
+ halfExtents?: BABYLON.IVector3Like;
4671
+ /**
4672
+ * @default 256
4673
+ */
4674
+ maxPathPolys?: number;
4675
+ /**
4676
+ * @default 2048
4677
+ */
4678
+ maxSmoothPathPoints?: number;
4679
+ /**
4680
+ * @default 0.5
4681
+ */
4682
+ stepSize?: number;
4683
+ /**
4684
+ * @default 0.01
4685
+ */
4686
+ slop?: number;
4687
+ }): BABYLON.Vector3[];
4688
+
4689
+
4690
+
4691
+
1801
4692
  /**
1802
- * Draws the globe atmosphere compositor using {@link EffectWrapper} and {@link EffectRenderer}.
4693
+ * Extracts positions and indices from an array of meshes.
4694
+ * @param meshes The array of meshes from which to extract positions and indices.
4695
+ * @returns A tuple containing a Float32Array of positions and a Uint32Array of
1803
4696
  */
1804
- drawGlobeAtmosphereCompositor(): void;
1805
- private _disposeSkyCompositor;
1806
- private _disposeAerialPerspectiveCompositor;
1807
- private _disposeGlobeAtmosphereCompositor;
4697
+ export function GetPositionsAndIndices(meshes: BABYLON.Mesh[]): [positions: Float32Array, indices: Uint32Array];
1808
4698
  /**
1809
- * Updates the camera variables that are specific to the atmosphere.
1810
- * @param camera - The camera to update the variables for.
4699
+ * Reverses the order of vertices in each triangle (3 indices per face) to ensure
4700
+ * that the winding order is consistent with the Recast Navigation requirements.
4701
+ * This is necessary because Recast Navigation expects the indices to be in a specific winding order.
4702
+ * @param meshOrIndices The mesh from which to extract indices or the indices themselves.
4703
+ * @returns Array of indices with reversed winding order.
1811
4704
  */
1812
- private _updatePerCameraVariables;
4705
+ export function GetReversedIndices(meshOrIndices: BABYLON.Mesh | Uint32Array | number[]): Uint32Array<ArrayBufferLike> | number[] | Int32Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | null;
4706
+
4707
+
1813
4708
  /**
1814
- * Renders the lookup tables, some of which can vary per-camera.
1815
- * It is expected that updatePerCameraVariables was previously called.
4709
+ * Converts navigation path points to a BABYLON.Vector3 array.
4710
+ * @param navPath The navigation path containing points and success status.
4711
+ * @returns An array of BABYLON.Vector3 points representing the navigation path.
1816
4712
  */
1817
- private _renderLutsForCamera;
4713
+ export function ConvertNavPathPoints(navPath: ComputePathResult): BABYLON.Vector3[];
4714
+
4715
+
4716
+ export const DefaultMaxObstacles = 128;
1818
4717
  /**
1819
- * Renders the lookup tables that do not depend on a camera position.
4718
+ * Creates a SoloNavMesh configuration based on the provided parameters.
4719
+ * @param parameters The parameters used to configure the SoloNavMesh generation.
4720
+ * @returns A configuration object for generating a SoloNavMesh.
4721
+ * @see https://docs.recast-navigation-js.isaacmason.com/types/index.RecastConfig.html
1820
4722
  */
1821
- renderGlobalLuts(): void;
4723
+ export function CreateSoloNavMeshConfig(parameters: INavMeshParametersV2): Partial<any>;
1822
4724
  /**
1823
- * Binds the atmosphere's uniform buffer to an {@link Effect}.
1824
- * @param effect - The {@link Effect} to bind the uniform buffer to.
4725
+ * Creates a TiledNavMesh configuration based on the provided parameters.
4726
+ * @param parameters The parameters used to configure the TiledNavMesh generation.
4727
+ * @returns A configuration object for generating a TiledNavMesh.
1825
4728
  */
1826
- bindUniformBufferToEffect(effect: Effect): void;
4729
+ export function CreateTiledNavMeshConfig(parameters: INavMeshParametersV2): Partial<any>;
1827
4730
  /**
1828
- * Updates the atmosphere's uniform buffer.
4731
+ * Creates a TileCacheNavMesh configuration based on the provided parameters.
4732
+ * @param parameters The parameters used to configure the TileCacheNavMesh generation.
4733
+ * @returns A configuration object for generating a TileCacheNavMesh.
1829
4734
  */
1830
- updateUniformBuffer(): void;
4735
+ export function CreateTileCacheNavMeshConfig(parameters: INavMeshParametersV2): Partial<any>;
1831
4736
  /**
1832
- * Draws the aerial perspective LUT using {@link EffectWrapper} and {@link EffectRenderer}.
4737
+ * Convert IAgentParameters to Recast any
4738
+ * @param config Agent parameters
4739
+ * @returns Recast crowd agent paramaters
1833
4740
  */
1834
- private _drawAerialPerspectiveLut;
4741
+ export function ToSoloNavMeshGeneratorConfig(config: INavMeshParametersV2): Partial<any>;
1835
4742
  /**
1836
- * Draws the sky view LUT using {@link EffectWrapper} and {@link EffectRenderer}.
4743
+ * Convert IAgentParameters to Recast any
4744
+ * @param agentParams Agent parameters
4745
+ * @returns Recast crowd agent paramaters
1837
4746
  */
1838
- private _drawSkyViewLut;
1839
- }
1840
-
1841
- }
1842
- declare module "babylonjs-addons/atmosphere/test/unit/sampling.test" {
1843
- export {};
1844
-
1845
- }
1846
- declare module "babylonjs-addons/atmosphere/Shaders/transmittance.fragment" {
1847
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
1848
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
1849
- import "babylonjs/Shaders/ShadersInclude/helperFunctions";
1850
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
1851
- /** @internal */
1852
- export const transmittancePixelShader: {
1853
- name: string;
1854
- shader: string;
1855
- };
1856
-
1857
- }
1858
- declare module "babylonjs-addons/atmosphere/Shaders/skyView.fragment" {
1859
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
1860
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
1861
- import "babylonjs/Shaders/ShadersInclude/helperFunctions";
1862
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
1863
- /** @internal */
1864
- export const skyViewPixelShader: {
1865
- name: string;
1866
- shader: string;
1867
- };
1868
-
1869
- }
1870
- declare module "babylonjs-addons/atmosphere/Shaders/multiScattering.fragment" {
1871
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
1872
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
1873
- import "babylonjs/Shaders/ShadersInclude/helperFunctions";
1874
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
1875
- /** @internal */
1876
- export const multiScatteringPixelShader: {
1877
- name: string;
1878
- shader: string;
1879
- };
1880
-
1881
- }
1882
- declare module "babylonjs-addons/atmosphere/Shaders/fullscreenTriangle.vertex" {
1883
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
1884
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
1885
- /** @internal */
1886
- export const fullscreenTriangleVertexShader: {
1887
- name: string;
1888
- shader: string;
1889
- };
1890
-
1891
- }
1892
- declare module "babylonjs-addons/atmosphere/Shaders/diffuseSkyIrradiance.fragment" {
1893
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
1894
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
1895
- import "babylonjs/Shaders/ShadersInclude/helperFunctions";
1896
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/depthFunctions";
1897
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
1898
- import "babylonjs/Shaders/ShadersInclude/importanceSampling";
1899
- import "babylonjs/Shaders/ShadersInclude/pbrBRDFFunctions";
1900
- import "babylonjs/Shaders/ShadersInclude/hdrFilteringFunctions";
1901
- /** @internal */
1902
- export const diffuseSkyIrradiancePixelShader: {
1903
- name: string;
1904
- shader: string;
1905
- };
1906
-
1907
- }
1908
- declare module "babylonjs-addons/atmosphere/Shaders/compositeSky.fragment" {
1909
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
1910
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
1911
- import "babylonjs/Shaders/ShadersInclude/helperFunctions";
1912
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/depthFunctions";
1913
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
1914
- /** @internal */
1915
- export const compositeSkyPixelShader: {
1916
- name: string;
1917
- shader: string;
1918
- };
1919
-
1920
- }
1921
- declare module "babylonjs-addons/atmosphere/Shaders/compositeGlobeAtmosphere.fragment" {
1922
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
1923
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
1924
- import "babylonjs/Shaders/ShadersInclude/helperFunctions";
1925
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/depthFunctions";
1926
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
1927
- /** @internal */
1928
- export const compositeGlobeAtmospherePixelShader: {
1929
- name: string;
1930
- shader: string;
1931
- };
1932
-
1933
- }
1934
- declare module "babylonjs-addons/atmosphere/Shaders/compositeAerialPerspective.fragment" {
1935
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
1936
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
1937
- import "babylonjs/Shaders/ShadersInclude/helperFunctions";
1938
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/depthFunctions";
1939
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
1940
- /** @internal */
1941
- export const compositeAerialPerspectivePixelShader: {
1942
- name: string;
1943
- shader: string;
1944
- };
1945
-
1946
- }
1947
- declare module "babylonjs-addons/atmosphere/Shaders/aerialPerspective.fragment" {
1948
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration";
1949
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration";
1950
- import "babylonjs/Shaders/ShadersInclude/helperFunctions";
1951
- import "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions";
1952
- /** @internal */
1953
- export const aerialPerspectivePixelShader: {
1954
- name: string;
1955
- shader: string;
1956
- };
1957
-
1958
- }
1959
- declare module "babylonjs-addons/atmosphere/Shaders/ShadersInclude/depthFunctions" {
1960
- /** @internal */
1961
- export const depthFunctions: {
1962
- name: string;
1963
- shader: string;
1964
- };
1965
-
1966
- }
1967
- declare module "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereVertexDeclaration" {
1968
- /** @internal */
1969
- export const atmosphereVertexDeclaration: {
1970
- name: string;
1971
- shader: string;
1972
- };
1973
-
1974
- }
1975
- declare module "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereUboDeclaration" {
1976
- /** @internal */
1977
- export const atmosphereUboDeclaration: {
1978
- name: string;
1979
- shader: string;
1980
- };
1981
-
1982
- }
1983
- declare module "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFunctions" {
1984
- import "babylonjs/Shaders/ShadersInclude/intersectionFunctions";
1985
- /** @internal */
1986
- export const atmosphereFunctions: {
1987
- name: string;
1988
- shader: string;
1989
- };
1990
-
1991
- }
1992
- declare module "babylonjs-addons/atmosphere/Shaders/ShadersInclude/atmosphereFragmentDeclaration" {
1993
- /** @internal */
1994
- export const atmosphereFragmentDeclaration: {
1995
- name: string;
1996
- shader: string;
1997
- };
1998
-
1999
- }
2000
-
2001
- declare module "babylonjs-addons" {
2002
- export * from "babylonjs-addons/index";
2003
- }
2004
-
2005
-
2006
- declare module ADDONS {
4747
+ export function ToCrowdAgentParams(agentParams: IAgentParametersV2): Partial<any>;
2007
4748
 
2008
4749
 
2009
4750
  /**
@@ -2130,6 +4871,18 @@ declare module ADDONS {
2130
4871
  }
2131
4872
 
2132
4873
 
4874
+ export interface ISdfTextParagraphMetrics {
4875
+ /** @internal */
4876
+ readonly paragraph: string;
4877
+ /** @internal */
4878
+ readonly lines: SdfTextLine[];
4879
+ /** @internal */
4880
+ readonly width: number;
4881
+ /** @internal */
4882
+ readonly height: number;
4883
+ /** @internal */
4884
+ readonly glyphs: SdfGlyph[];
4885
+ }
2133
4886
  /** @internal */
2134
4887
  export type ParagraphOptions = {
2135
4888
  maxWidth: number;
@@ -2139,6 +4892,7 @@ declare module ADDONS {
2139
4892
  whiteSpace: "pre-line";
2140
4893
  textAlign: "left" | "right" | "center";
2141
4894
  translate: BABYLON.IVector2Like | undefined;
4895
+ customLayoutEngine?: (text: string, options: ParagraphOptions) => ISdfTextParagraphMetrics;
2142
4896
  };
2143
4897
  /** @internal */
2144
4898
  export var DefaultParagraphOptions: ParagraphOptions;