@babylonjs/lite-compat 0.0.1-preview.54961
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundler-resolve-0pEkTP9X.js +33 -0
- package/bundler-resolve-0pEkTP9X.js.map +1 -0
- package/esbuild.d.ts +68 -0
- package/esbuild.js +27 -0
- package/esbuild.js.map +1 -0
- package/index.d.ts +3159 -0
- package/index.js +6192 -0
- package/index.js.map +1 -0
- package/meshes-BQZyNGmT.js +1460 -0
- package/meshes-BQZyNGmT.js.map +1 -0
- package/navigation.d.ts +1293 -0
- package/navigation.js +139 -0
- package/navigation.js.map +1 -0
- package/package.json +54 -0
- package/recast-shim.d.ts +16 -0
- package/recast-shim.js +6 -0
- package/recast-shim.js.map +1 -0
- package/rollup.d.ts +48 -0
- package/rollup.js +18 -0
- package/rollup.js.map +1 -0
- package/vite.d.ts +10 -0
- package/vite.js +24 -0
- package/vite.js.map +1 -0
- package/webpack.d.ts +54 -0
- package/webpack.js +16 -0
- package/webpack.js.map +1 -0
package/navigation.d.ts
ADDED
|
@@ -0,0 +1,1293 @@
|
|
|
1
|
+
import { AnisotropyProps } from '@babylonjs/lite';
|
|
2
|
+
import { ClearCoatProps } from '@babylonjs/lite';
|
|
3
|
+
import { EngineOptions } from '@babylonjs/lite';
|
|
4
|
+
import { IridescenceProps } from '@babylonjs/lite';
|
|
5
|
+
import { Mesh } from '@babylonjs/lite';
|
|
6
|
+
import { NavCrowd } from '@babylonjs/lite';
|
|
7
|
+
import { NavigationPlugin } from '@babylonjs/lite';
|
|
8
|
+
import { ObstacleHandle } from '@babylonjs/lite';
|
|
9
|
+
import { RenderCanvas } from '@babylonjs/lite';
|
|
10
|
+
import { SceneNode } from '@babylonjs/lite';
|
|
11
|
+
import { SheenProps } from '@babylonjs/lite';
|
|
12
|
+
import { Texture2D } from '@babylonjs/lite';
|
|
13
|
+
|
|
14
|
+
declare abstract class AbstractEngine {
|
|
15
|
protected readonly _canvas: RenderCanvas;
|
|
16
|
+
private readonly _options;
|
|
17
|
+
protected readonly _scenes: Scene[];
|
|
18
|
+
protected readonly _loopCallbacks: Array<() => void>;
|
|
19
|
+
protected _initialized: boolean;
|
|
20
|
+
private _started;
|
|
1
21
|
/**
|
|
22
|
+
* Babylon.js `engine.useReverseDepthBuffer`. Babylon Lite owns its depth
|
|
23
|
+
* configuration internally, so this is a settable no-op kept for API shape.
|
|
24
|
+
*/
|
|
25
|
+
useReverseDepthBuffer: boolean;
|
|
26
|
+
/** Babylon.js `engine.onResizeObservable` — fires after `resize()` / `setSize()`. */
|
|
27
|
+
readonly onResizeObservable: Observable<AbstractEngine>;
|
|
2
28
|
constructor(canvas: RenderCanvas, options?: ({
|
|
29
|
+
antialias?: boolean;
|
|
30
|
+
adaptToDeviceRatio?: boolean;
|
|
31
|
+
useLargeWorldRendering?: boolean;
|
|
32
|
+
} & EngineOptions) | boolean);
|
|
33
|
+
/** Acquire the GPU device and build the Lite engine context. */
|
|
34
|
+
initAsync(): Promise<void>;
|
|
35
|
+
getRenderingCanvas(): RenderCanvas;
|
|
36
|
+
/**
|
|
37
|
+
* Babylon.js `engine.getDeltaTime()` — milliseconds elapsed since the previous
|
|
38
|
+
* frame. Updated from each scene's Lite before-render hook (which receives the
|
|
39
|
+
* frame delta); defaults to ~16ms before the first frame.
|
|
40
|
+
*/
|
|
41
|
+
getDeltaTime(): number;
|
|
42
|
+
/**
|
|
43
|
+
* Babylon.js `engine.isNDCHalfZRange`. WebGPU's clip space uses a `[0, 1]`
|
|
44
|
+
* depth range, so this is always `true` under Babylon Lite.
|
|
45
|
+
*/
|
|
46
|
+
get isNDCHalfZRange(): boolean;
|
|
47
|
+
/** Babylon.js `engine.isWebGPU` — Babylon Lite is WebGPU-only, so always `true`. */
|
|
48
|
+
get isWebGPU(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Babylon.js `engine.getCaps()` — engine capability flags. Only the
|
|
51
|
+
* compressed-texture-format flags ported scenes branch on are derived (from the
|
|
52
|
+
* Lite WebGPU device's enabled features); the rest report Babylon Lite's fixed
|
|
53
|
+
* WebGPU baseline. A headless `NullEngine` has no device, so all flags are off.
|
|
54
|
+
*/
|
|
55
|
+
getCaps(): Record<string, unknown>;
|
|
56
|
+
/** Babylon.js `engine.scenes` — every scene created against this engine. */
|
|
57
|
+
get scenes(): Scene[];
|
|
58
|
+
/** Babylon.js `engine.getRenderWidth()` — backing render-target width in pixels. */
|
|
59
|
+
getRenderWidth(): number;
|
|
60
|
+
/** Babylon.js `engine.getRenderHeight()` — backing render-target height in pixels. */
|
|
61
|
+
getRenderHeight(): number;
|
|
62
|
+
/** Babylon.js `engine.getScreenAspectRatio()` — render-target width / height. */
|
|
63
|
+
getScreenAspectRatio(): number;
|
|
64
|
+
/**
|
|
65
|
+
* Babylon.js `engine.getAspectRatio(camera?, useScreen?)`. Babylon Lite renders
|
|
66
|
+
* each scene through a single full-canvas viewport, so the camera viewport does
|
|
67
|
+
* not subdivide the surface — this is the screen aspect ratio.
|
|
68
|
+
*/
|
|
69
|
+
getAspectRatio(_camera?: unknown, _useScreen?: boolean): number;
|
|
70
|
+
/** Babylon.js `engine.getFps()` — frames-per-second estimate from the last frame delta. */
|
|
71
|
+
getFps(): number;
|
|
72
|
+
/**
|
|
73
|
+
* Babylon.js `engine.getHardwareScalingLevel()`. Babylon Lite manages its own
|
|
74
|
+
* device-pixel-ratio scaling, so this returns the stored parity value.
|
|
75
|
+
*/
|
|
76
|
+
getHardwareScalingLevel(): number;
|
|
77
|
+
/** Babylon.js `engine.setHardwareScalingLevel(level)` — stored for parity (Lite self-manages DPR). */
|
|
78
|
+
setHardwareScalingLevel(level: number): void;
|
|
79
|
+
/** Babylon.js `engine.getRenderingCanvasClientRect()` — the canvas client rect, or `null` for offscreen canvases. */
|
|
80
|
+
getRenderingCanvasClientRect(): {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
width: number;
|
|
84
|
+
height: number;
|
|
85
|
+
} | null;
|
|
86
|
+
/**
|
|
87
|
+
* Babylon.js `engine.clear(color?, backBuffer?, depth?, stencil?)`. Babylon
|
|
88
|
+
* Lite owns clearing through its render contexts (scenes / sprite renderers),
|
|
89
|
+
* so this records the requested clear colour (used by the scene-less sprite
|
|
90
|
+
* renderer path) and is otherwise a no-op.
|
|
91
|
+
*/
|
|
92
|
+
clear(color?: {
|
|
93
|
+
r: number;
|
|
94
|
+
g: number;
|
|
95
|
+
b: number;
|
|
96
|
+
a: number;
|
|
97
|
+
}, _backBuffer?: boolean, _depth?: boolean, _stencil?: boolean): void;
|
|
3
98
|
runRenderLoop(callback: () => void): void;
|
|
99
|
+
stopRenderLoop(): void;
|
|
100
|
+
resize(): void;
|
|
101
|
+
setSize(width: number, height: number): void;
|
|
102
|
+
dispose(): void;
|
|
103
|
+
/** Babylon.js manual frame-pump entry point — unsupported (Lite's frame graph owns the frame). */
|
|
104
|
+
beginFrame(): never;
|
|
105
|
+
/** Babylon.js manual frame-pump exit point — unsupported (Lite's frame graph owns the frame). */
|
|
106
|
+
endFrame(): never;
|
|
107
|
+
private _start;
|
|
108
|
+
private _ensureInitialized;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Babylon.js `AbstractMesh` — a renderable transform node with a material,
|
|
113
|
+
* visibility, and shadow-receipt. Concrete meshes derive from this.
|
|
114
|
+
*/
|
|
115
|
+
declare class AbstractMesh extends TransformNode {
|
|
4
116
|
private _material;
|
|
117
|
+
private _visible;
|
|
118
|
+
constructor(name: string, lite: Mesh, scene?: Scene);
|
|
119
|
+
getClassName(): string;
|
|
5
120
|
get material(): CompatMaterial | null;
|
|
121
|
+
set material(value: CompatMaterial | null);
|
|
122
|
+
get isVisible(): boolean;
|
|
123
|
+
set isVisible(value: boolean);
|
|
124
|
+
get receiveShadows(): boolean;
|
|
125
|
+
set receiveShadows(value: boolean);
|
|
126
|
+
setEnabled(enabled: boolean): void;
|
|
127
|
+
/** Bounding info accessor — needs a public Lite bounds accessor that does not yet exist. */
|
|
128
|
+
getBoundingInfo(): never;
|
|
129
|
+
/**
|
|
130
|
+
* Babylon.js `mesh.getVerticesData(kind)` — read back the CPU geometry buffer
|
|
131
|
+
* for `position` / `normal` / `uv`. Babylon Lite retains these on the mesh
|
|
132
|
+
* (for picking + device-loss recovery); other kinds are not stored.
|
|
133
|
+
*/
|
|
134
|
+
getVerticesData(kind: string): Float32Array | null;
|
|
135
|
+
/**
|
|
136
|
+
* Babylon.js `mesh.setVerticesData(kind, data)` — replace a vertex attribute.
|
|
137
|
+
* `position` / `normal` / `uv` / `color` / `tangent` re-upload the geometry in
|
|
138
|
+
* place; the last-set `color`/`tangent` buffers are retained so successive calls
|
|
139
|
+
* (e.g. set tangent then set color) keep both. Skinning/morph attributes
|
|
140
|
+
* (`matricesIndices`, etc.) are accepted but not applied (Babylon Lite drives
|
|
141
|
+
* skinning through its own loaded-skeleton path).
|
|
142
|
+
*/
|
|
143
|
+
setVerticesData(kind: string, data: number[] | Float32Array, _updatable?: boolean): void;
|
|
6
144
|
private _lastColors;
|
|
145
|
+
/** Babylon.js `mesh.getTotalVertices()` — vertex count from the position buffer. */
|
|
146
|
+
getTotalVertices(): number;
|
|
147
|
+
/**
|
|
148
|
+
* Babylon.js `mesh.refreshBoundingInfo()` — Babylon Lite recomputes a mesh's
|
|
149
|
+
* bounds from its CPU geometry on demand (and on geometry upload), so this is a
|
|
150
|
+
* no-op that returns the mesh for chaining. The deformed-pick options
|
|
151
|
+
* (`applySkeleton` / `applyMorph`) are accepted for parity but not used.
|
|
152
|
+
*/
|
|
153
|
+
refreshBoundingInfo(_options?: unknown): this;
|
|
154
|
+
/**
|
|
155
|
+
* Babylon.js `mesh.bakeCurrentTransformIntoVertices()` — fold the node's local
|
|
156
|
+
* transform (position / rotation / scaling) into the CPU geometry and reset the
|
|
157
|
+
* transform to identity. Babylon Lite has no built-in mesh-transform bake, so we
|
|
158
|
+
* transform the retained CPU positions (full matrix) and normals (rotation only,
|
|
159
|
+
* renormalized), re-upload via `resizeMeshGeometry`, then clear the transform.
|
|
160
|
+
*/
|
|
161
|
+
bakeCurrentTransformIntoVertices(): this;
|
|
162
|
+
dispose(): void;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
declare abstract class AbstractScene {
|
|
7
166
|
/**
|
|
167
|
+
* Babylon.js `scene.meshes`. Babylon Lite does not expose a public scene-mesh
|
|
168
|
+
* registry, so this tracks the meshes the compat layer creates against a scene
|
|
169
|
+
* which need lookup (currently Gaussian-Splatting meshes surfaced through the
|
|
170
|
+
* loader). Other primitives register with the Lite scene directly.
|
|
171
|
+
*/
|
|
172
|
+
get meshes(): TransformNode[];
|
|
173
|
+
/** Babylon.js `scene.cameras` — every camera constructed against this scene. */
|
|
174
|
+
get cameras(): Camera[];
|
|
175
|
+
/** Babylon.js `scene.lights` — every light constructed against this scene. */
|
|
176
|
+
get lights(): Light[];
|
|
177
|
+
/** Babylon.js `scene.materials` — every material constructed against this scene. */
|
|
178
|
+
get materials(): Material[];
|
|
8
179
|
/** Babylon.js `scene.getCameraByName(name)` — first camera with a matching name, else `null`. */
|
|
180
|
+
getCameraByName(name: string): Camera | null;
|
|
181
|
+
/** Babylon.js `scene.getCameraById(id)` — first camera whose `id` matches, else `null`. */
|
|
182
|
+
getCameraById(id: string): Camera | null;
|
|
183
|
+
/** Babylon.js `scene.getLightByName(name)` — first light with a matching name, else `null`. */
|
|
184
|
+
getLightByName(name: string): Light | null;
|
|
185
|
+
/** Babylon.js `scene.getLightById(id)` — first light whose `id` matches, else `null`. */
|
|
186
|
+
getLightById(id: string): Light | null;
|
|
187
|
+
/** Babylon.js `scene.getMaterialByName(name)` — first material with a matching name, else `null`. */
|
|
188
|
+
getMaterialByName(name: string): Material | null;
|
|
189
|
+
/** Babylon.js `scene.getMaterialById(id)` — first material whose `id` matches, else `null`. */
|
|
190
|
+
getMaterialById(id: string): Material | null;
|
|
191
|
+
/**
|
|
192
|
+
* Babylon.js `scene.getMeshByName(name)`. Babylon Lite has no public scene-mesh
|
|
193
|
+
* registry, so this searches the compat meshes tracked through `scene.meshes`
|
|
194
|
+
* (currently meshes the loader surfaces, e.g. Gaussian-Splatting). Returns `null`
|
|
195
|
+
* when not found, matching Babylon.js.
|
|
196
|
+
*/
|
|
197
|
+
getMeshByName(name: string): TransformNode | null;
|
|
198
|
+
/** Babylon.js `scene.getMeshById(id)` — first tracked mesh whose `id` matches, else `null`. */
|
|
199
|
+
getMeshById(id: string): TransformNode | null;
|
|
200
|
+
/** Babylon.js legacy `scene.getMeshByID(id)` — alias of {@link getMeshById}. */
|
|
201
|
+
getMeshByID(id: string): TransformNode | null;
|
|
202
|
+
/** Babylon.js `scene.getNodeByName(name)` — searches tracked meshes, cameras, and lights. */
|
|
203
|
+
getNodeByName(name: string): Node_2 | null;
|
|
204
|
+
/** Babylon.js `scene.getNodeById(id)` — searches tracked meshes, cameras, and lights by `id`. */
|
|
205
|
+
getNodeById(id: string): Node_2 | null;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** Babylon.js `IAgentParameters` subset accepted by `RecastJSCrowd.addAgent`. */
|
|
209
|
+
declare interface AgentParameters {
|
|
210
|
+
radius: number;
|
|
211
|
+
height: number;
|
|
212
|
+
maxAcceleration: number;
|
|
213
|
+
maxSpeed: number;
|
|
214
|
+
collisionQueryRange: number;
|
|
215
|
+
pathOptimizationRange: number;
|
|
216
|
+
separationWeight: number;
|
|
217
|
+
reachRadius?: number;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
declare interface AgentTransform {
|
|
221
|
+
position: {
|
|
222
|
+
set(x: number, y: number, z: number): unknown;
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Babylon.js `Animatable` — a running animation on a target, driven per-frame on
|
|
228
|
+
* the CPU by evaluating each `Animation`'s keyframes and writing the result onto
|
|
229
|
+
* the target's (dotted) property path.
|
|
230
|
+
*/
|
|
231
|
+
declare class Animatable_2 {
|
|
232
|
+
private readonly _target;
|
|
233
|
+
private readonly _animations;
|
|
234
|
+
private readonly _from;
|
|
235
|
+
private readonly _to;
|
|
236
|
+
private readonly _loop;
|
|
237
|
+
masterFrame: number;
|
|
238
|
+
speedRatio: number;
|
|
239
|
+
private _paused;
|
|
240
|
+
private _stopped;
|
|
241
|
+
constructor(_target: unknown, _animations: Animation_2[], _from: number, _to: number, _loop: boolean, speedRatio: number);
|
|
9
242
|
goToFrame(frame: number): void;
|
|
243
|
+
pause(): void;
|
|
244
|
+
restart(): void;
|
|
245
|
+
stop(): void;
|
|
246
|
+
get animationStarted(): boolean;
|
|
247
|
+
private _apply;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
declare class Animation_2 {
|
|
251
|
+
name: string;
|
|
252
|
+
targetProperty: string;
|
|
253
|
+
framePerSecond: number;
|
|
254
|
+
dataType: number;
|
|
255
|
+
loopMode: number;
|
|
256
|
+
static readonly ANIMATIONTYPE_FLOAT: 0;
|
|
257
|
+
static readonly ANIMATIONTYPE_VECTOR3: 1;
|
|
258
|
+
static readonly ANIMATIONTYPE_QUATERNION: 2;
|
|
259
|
+
static readonly ANIMATIONTYPE_MATRIX: 3;
|
|
260
|
+
static readonly ANIMATIONTYPE_COLOR3: 4;
|
|
261
|
+
static readonly ANIMATIONLOOPMODE_RELATIVE: 0;
|
|
262
|
+
static readonly ANIMATIONLOOPMODE_CYCLE: 1;
|
|
263
|
+
static readonly ANIMATIONLOOPMODE_CONSTANT: 2;
|
|
264
|
+
private _keys;
|
|
265
|
+
constructor(name: string, targetProperty: string, framePerSecond: number, dataType?: number, loopMode?: number);
|
|
266
|
+
setKeys(keys: IAnimationKey[]): void;
|
|
267
|
+
getKeys(): IAnimationKey[];
|
|
268
|
+
getHighestFrame(): number;
|
|
269
|
+
/** Linearly evaluate the animated value at `frame` (clamped to the key range). */
|
|
270
|
+
evaluate(frame: number): number | number[];
|
|
271
|
+
/** Babylon.js helper: build a one-shot float animation between two values. */
|
|
272
|
+
static CreateAndStartAnimation(name: string, _target: unknown, targetProperty: string, framePerSecond: number, totalFrame: number, from: number, to: number): Animation_2;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Babylon.js `AnimationGroup` — a named collection of targeted animations with
|
|
277
|
+
* playback state. This is the **single** `AnimationGroup` type, matching Babylon.js;
|
|
278
|
+
* there is no separate "loaded" subtype. Two construction paths map onto Lite:
|
|
279
|
+
*
|
|
280
|
+
* - **Structural** (`new AnimationGroup(name, scene?)`): a CPU-side collection
|
|
281
|
+
* built by ported code via `addTargetedAnimation`. When `start`ed it registers
|
|
282
|
+
* with the scene and is stepped each frame on the CPU; multiple groups that
|
|
283
|
+
* animate the same property are **weight-blended** (Babylon.js manual weighted
|
|
284
|
+
* / cross-fade blending) before the result is written to the target.
|
|
285
|
+
* - **Loaded** (`AnimationGroup._fromLite`, used to populate `scene.animationGroups`
|
|
286
|
+
* from glTF / `.babylon` clips): a thin wrapper over a Babylon Lite loaded group.
|
|
287
|
+
* The playback methods (`goToFrame`/`play`/`pause`/`stop`/`reset`) and the
|
|
288
|
+
* `from`/`to`/`isPlaying`/`speedRatio`/`loopAnimation`/`weight`/`animatables`
|
|
289
|
+
* accessors delegate to the Lite group so ported scenes can freeze/seek a
|
|
290
|
+
* loaded animation at a deterministic frame.
|
|
291
|
+
*/
|
|
292
|
+
declare class AnimationGroup {
|
|
293
|
+
name: string;
|
|
294
|
+
readonly targetedAnimations: Array<{
|
|
295
|
+
animation: Animation_2;
|
|
296
|
+
target: unknown;
|
|
297
|
+
}>;
|
|
298
|
+
onAnimationGroupEndObservable?: () => void;
|
|
10
299
|
private _from;
|
|
300
|
+
private _to;
|
|
301
|
+
private _state;
|
|
302
|
+
private _speedRatio;
|
|
303
|
+
private _loopAnimation;
|
|
11
304
|
constructor(name: string, scene?: unknown);
|
|
12
305
|
/**
|
|
306
|
+
* Babylon.js `AnimationGroup.MakeAnimationAdditive(group)` — convert a loaded
|
|
307
|
+
* group into an additive layer (reference frame 0) and enable the scene's
|
|
308
|
+
* weighted-blend manager. Returns the same group (Babylon Lite mutates in
|
|
309
|
+
* place rather than cloning).
|
|
310
|
+
*/
|
|
311
|
+
static MakeAnimationAdditive(group: AnimationGroup): AnimationGroup;
|
|
312
|
+
/** First frame of the clip. Always 0 for loaded clips. */
|
|
313
|
+
get from(): number;
|
|
314
|
+
/** Last frame of the clip. */
|
|
315
|
+
get to(): number;
|
|
316
|
+
get isPlaying(): boolean;
|
|
317
|
+
get state(): AnimationGroupState;
|
|
318
|
+
get speedRatio(): number;
|
|
319
|
+
set speedRatio(value: number);
|
|
320
|
+
get loopAnimation(): boolean;
|
|
321
|
+
set loopAnimation(value: boolean);
|
|
322
|
+
get weight(): number;
|
|
323
|
+
set weight(value: number);
|
|
324
|
+
/**
|
|
325
|
+
* Babylon.js `AnimationGroup.animatables`. For loaded groups Babylon Lite drives
|
|
326
|
+
* the whole group as one unit, so this surfaces a single animatable whose
|
|
327
|
+
* `masterFrame` reflects the group's current frame. Structural groups built
|
|
328
|
+
* without a running scene report no animatables.
|
|
329
|
+
*/
|
|
330
|
+
get animatables(): Array<{
|
|
331
|
+
masterFrame: number;
|
|
332
|
+
}>;
|
|
333
|
+
addTargetedAnimation(animation: Animation_2, target: unknown): {
|
|
334
|
+
animation: Animation_2;
|
|
335
|
+
target: unknown;
|
|
336
|
+
};
|
|
337
|
+
/**
|
|
338
|
+
* Babylon.js `start(loop?, speedRatio?, from?, to?)`. On the structural path this
|
|
339
|
+
* registers the group with its host scene, captures the targets' rest-pose
|
|
340
|
+
* baselines, and begins CPU stepping + weight blending. On the loaded path it
|
|
341
|
+
* seeks to `from` and plays — except a zero-length range (`from === to`) is a
|
|
342
|
+
* **held single-frame pose** (e.g. an additive pose layer), which must hold
|
|
343
|
+
* rather than play: Babylon Lite's group advance ignores the BJS play range and
|
|
344
|
+
* would otherwise loop the (often ~2-frame) pose clip every frame, flickering.
|
|
345
|
+
*/
|
|
346
|
+
start(loop?: boolean, speedRatio?: number, from?: number, to?: number): this;
|
|
347
|
+
/** Babylon.js `goToFrame(frame)` — seek to a frame (loaded groups seek + hold via Lite; structural groups re-blend). */
|
|
348
|
+
goToFrame(frame: number): this;
|
|
349
|
+
play(loop?: boolean): this;
|
|
350
|
+
pause(): this;
|
|
351
|
+
stop(): this;
|
|
352
|
+
reset(): this;
|
|
353
|
+
|
|
354
|
+
declare type AnimationGroupState = "init" | "playing" | "paused" | "stopped";
|
|
355
|
+
|
|
356
|
+
declare abstract class BaseTexture {
|
|
357
|
+
name: string;
|
|
13
358
|
getClassName(): string;
|
|
359
|
+
abstract whenReadyAsync(): Promise<void>;
|
|
360
|
+
dispose(): void;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/** Babylon.js `Camera` — base class for all cameras (derives from `Node`). */
|
|
364
|
+
declare abstract class Camera extends Node_2 {
|
|
14
365
|
private _detach;
|
|
366
|
+
protected constructor(name: string, scene?: Scene);
|
|
367
|
+
getClassName(): string;
|
|
368
|
+
get fov(): number;
|
|
369
|
+
set fov(value: number);
|
|
370
|
+
get minZ(): number;
|
|
371
|
+
set minZ(value: number);
|
|
372
|
+
get maxZ(): number;
|
|
373
|
+
set maxZ(value: number);
|
|
374
|
+
/** World-space position of the camera. */
|
|
375
|
+
get globalPosition(): Vector3;
|
|
376
|
+
/** Babylon.js `camera.getViewMatrix()` — the camera's view matrix. */
|
|
377
|
+
getViewMatrix(): Matrix;
|
|
378
|
+
/** Babylon.js `camera.getProjectionMatrix()` — the camera's projection matrix. */
|
|
379
|
+
getProjectionMatrix(): Matrix;
|
|
380
|
+
private _aspectRatio;
|
|
381
|
+
abstract attachControl(canvas: HTMLCanvasElement, noPreventDefault?: boolean): void;
|
|
382
|
+
detachControl(): void;
|
|
15
383
|
protected _makeActive(scene: Scene | undefined): void;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Babylon.js-compatible colour classes (`Color3`, `Color4`).
|
|
388
|
+
*
|
|
389
|
+
* Mutable, backed by `r`/`g`/`b`/`a` fields. `asArray()` yields the tuple shape
|
|
390
|
+
* (`[r, g, b]` / `[r, g, b, a]`) consumed by the Babylon Lite material and light
|
|
391
|
+
* APIs.
|
|
392
|
+
*/
|
|
393
|
+
declare class Color3 {
|
|
394
|
+
r: number;
|
|
395
|
+
g: number;
|
|
396
|
+
b: number;
|
|
397
|
+
constructor(r?: number, g?: number, b?: number);
|
|
398
|
+
set(r: number, g: number, b: number): this;
|
|
399
|
+
copyFrom(source: Color3): this;
|
|
400
|
+
scale(scale: number): Color3;
|
|
401
|
+
scaleInPlace(scale: number): this;
|
|
402
|
+
multiply(other: Color3): Color3;
|
|
403
|
+
add(other: Color3): Color3;
|
|
404
|
+
clone(): Color3;
|
|
405
|
+
equals(other: Color3): boolean;
|
|
406
|
+
asArray(): [number, number, number];
|
|
407
|
+
toColor4(alpha?: number): Color4;
|
|
408
|
+
toHexString(): string;
|
|
409
|
+
static Black(): Color3;
|
|
410
|
+
static White(): Color3;
|
|
411
|
+
static Red(): Color3;
|
|
412
|
+
static Green(): Color3;
|
|
413
|
+
static Blue(): Color3;
|
|
414
|
+
static FromArray(array: ArrayLike<number>, offset?: number): Color3;
|
|
415
|
+
static FromInts(r: number, g: number, b: number): Color3;
|
|
416
|
+
static FromHexString(hex: string): Color3;
|
|
417
|
+
static Lerp(start: Color3, end: Color3, amount: number): Color3;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
declare class Color4 {
|
|
421
|
+
r: number;
|
|
422
|
+
g: number;
|
|
423
|
+
b: number;
|
|
424
|
+
a: number;
|
|
425
|
+
constructor(r?: number, g?: number, b?: number, a?: number);
|
|
426
|
+
set(r: number, g: number, b: number, a: number): this;
|
|
427
|
+
copyFrom(source: Color4): this;
|
|
428
|
+
scale(scale: number): Color4;
|
|
429
|
+
add(other: Color4): Color4;
|
|
430
|
+
clone(): Color4;
|
|
431
|
+
equals(other: Color4): boolean;
|
|
432
|
+
toColor3(): Color3;
|
|
433
|
+
asArray(): [number, number, number, number];
|
|
434
|
+
static FromArray(array: ArrayLike<number>, offset?: number): Color4;
|
|
435
|
+
static FromInts(r: number, g: number, b: number, a: number): Color4;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
declare type CompatMaterial = StandardMaterial | PBRMaterial | NodeMaterial | GridMaterial;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* Babylon.js `@babylonjs/addons/navigation` `CreateNavigationPluginAsync`. The
|
|
442
|
+
* injected Recast `instance` (if any) is ignored — Babylon Lite loads its own
|
|
443
|
+
* Recast wasm from `/recast-navigation.wasm`.
|
|
444
|
+
*/
|
|
445
|
+
export declare function CreateNavigationPluginAsync(_options?: {
|
|
446
|
+
version?: string;
|
|
447
|
+
instance?: unknown;
|
|
448
|
+
}): Promise<RecastNavigationJSPluginV2>;
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Babylon.js `CubeTexture` — environment/skybox cube map. Babylon Lite loads
|
|
452
|
+
* environments through `loadEnvironment` (IBL + skybox registered on the scene)
|
|
453
|
+
* rather than as a standalone GPU texture object. This compat `CubeTexture`
|
|
454
|
+
* therefore acts as a lightweight handle that records the environment URL; the
|
|
455
|
+
* actual GPU work happens when it is assigned to `scene.environmentTexture` and
|
|
456
|
+
* the engine starts (see `Scene` env handling).
|
|
457
|
+
*/
|
|
458
|
+
declare class CubeTexture {
|
|
459
|
+
/** Source URL of the (prefiltered) environment. */
|
|
460
|
+
readonly url: string;
|
|
461
|
+
/** Babylon.js `coordinatesMode` (skybox = 5). Recorded for API parity. */
|
|
462
|
+
coordinatesMode: number;
|
|
463
|
+
name: string;
|
|
464
|
+
gammaSpace: boolean;
|
|
465
|
+
level: number;
|
|
466
|
+
/** Fires when the cube map is "ready" (resolved on a microtask in this compat layer). */
|
|
467
|
+
readonly onLoadObservable: Observable<CubeTexture>;
|
|
468
|
+
private _ready;
|
|
469
|
+
constructor(url: string, _scene?: unknown, _extensions?: unknown, _noMipmap?: boolean, _files?: unknown, onLoad?: (() => void) | null, _onError?: unknown, _format?: unknown, _prefiltered?: boolean);
|
|
470
|
+
/** Babylon.js `BaseTexture.isReady()`. */
|
|
471
|
+
isReady(): boolean;
|
|
472
|
+
/** Babylon.js `CubeTexture.CreateFromPrefilteredData(url, scene)`. */
|
|
473
|
+
static CreateFromPrefilteredData(url: string, scene?: unknown): CubeTexture;
|
|
474
|
+
dispose(): void;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
declare interface DefaultEnvironmentOptions {
|
|
478
|
+
createSkybox?: boolean;
|
|
479
|
+
createGround?: boolean;
|
|
480
|
+
skyboxSize?: number;
|
|
481
|
+
/** Babylon.js EnvironmentHelper: set up tone mapping / exposure / contrast (default true). */
|
|
482
|
+
setupImageProcessing?: boolean;
|
|
483
|
+
/** Babylon.js EnvironmentHelper camera exposure (default 0.8). */
|
|
484
|
+
cameraExposure?: number;
|
|
485
|
+
/** Babylon.js EnvironmentHelper camera contrast (default 1.2). */
|
|
486
|
+
cameraContrast?: number;
|
|
487
|
+
/** Babylon.js EnvironmentHelper tone-mapping toggle (default true). */
|
|
488
|
+
toneMappingEnabled?: boolean;
|
|
489
|
+
|
|
490
|
+
declare class GridMaterial {
|
|
491
|
+
name: string;
|
|
492
|
+
/** Background color between the lines (Babylon.js default black). */
|
|
493
|
+
mainColor: Color3;
|
|
494
|
+
/** Color of the grid lines (Babylon.js default teal). */
|
|
495
|
+
lineColor: Color3;
|
|
496
|
+
/** Spacing of the grid in object-space units. */
|
|
497
|
+
gridRatio: number;
|
|
498
|
+
/** Object-space offset added before computing the grid. */
|
|
499
|
+
gridOffset: Vector3;
|
|
500
|
+
/** Every Nth line is a major line. */
|
|
501
|
+
majorUnitFrequency: number;
|
|
502
|
+
/** Visibility of the minor (non-major) lines, `0..1`. */
|
|
503
|
+
minorUnitVisibility: number;
|
|
504
|
+
/** Opacity of the grid outside the lines; `<1` enables the transparent path. */
|
|
505
|
+
opacity: number;
|
|
506
|
+
/** Cosine-based antialiasing of the lines. */
|
|
507
|
+
antialias: boolean;
|
|
508
|
+
/** Combine axes with `max` instead of additive sum. */
|
|
509
|
+
useMaxLine: boolean;
|
|
510
|
+
/**
|
|
511
|
+
* Babylon.js `@babylonjs/materials` 9.x `linesOnly` — show only the lines with
|
|
512
|
+
* transparency between them. Babylon Lite expresses this via the opacity (`<1`)
|
|
513
|
+
* transparent path, so enabling it forces that path.
|
|
514
|
+
*/
|
|
515
|
+
linesOnly: boolean;
|
|
516
|
+
/** Back-face culling toggle. */
|
|
517
|
+
backFaceCulling: boolean;
|
|
518
|
+
/** Babylon.js `Material.transparencyMode` (accepted for parity). */
|
|
519
|
+
transparencyMode: number | null;
|
|
520
|
+
/** Wireframe toggle (not honoured by the grid material). */
|
|
521
|
+
wireframe: boolean;
|
|
16
522
|
constructor(name: string, _scene?: Scene);
|
|
523
|
+
getClassName(): string;
|
|
17
524
|
dispose(): void;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
declare interface IAnimationKey {
|
|
528
|
+
frame: number;
|
|
529
|
+
value: number | number[];
|
|
530
|
+
/** Babylon.js per-key interpolation hint (`AnimationKeyInterpolation`). */
|
|
531
|
+
interpolation?: number;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/** Babylon.js `Light` — base class for all lights (derives from `Node`). */
|
|
535
|
+
declare abstract class Light extends Node_2 {
|
|
18
536
|
protected constructor(name: string, scene?: Scene);
|
|
537
|
+
getClassName(): string;
|
|
538
|
+
abstract get intensity(): number;
|
|
539
|
+
abstract set intensity(value: number);
|
|
540
|
+
/** Detach this light's shadow generator (compat for `light.shadowEnabled = false`). */
|
|
541
|
+
set shadowEnabled(enabled: boolean);
|
|
542
|
+
dispose(): void;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/** Babylon.js `Material` — base class for all materials. */
|
|
546
|
+
declare abstract class Material {
|
|
547
|
+
name: string;
|
|
548
|
+
/** Common transparency mode flag (Babylon.js `Material.transparencyMode`). */
|
|
549
|
+
transparencyMode: number | null;
|
|
550
|
+
/** Back-face culling toggle (Babylon.js `Material.backFaceCulling`). */
|
|
551
|
+
private _backFaceCulling;
|
|
552
|
+
get backFaceCulling(): boolean;
|
|
553
|
+
set backFaceCulling(value: boolean);
|
|
19
554
|
/** Wireframe rendering toggle (not honoured by all Lite materials). */
|
|
555
|
+
wireframe: boolean;
|
|
20
556
|
protected constructor(name: string, scene?: Scene);
|
|
557
|
+
getClassName(): string;
|
|
558
|
+
protected _markDirty(): void;
|
|
21
559
|
dispose(): void;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
declare class Matrix {
|
|
563
|
+
readonly m: Float32Array;
|
|
564
|
+
constructor();
|
|
565
|
+
set(index: number, value: number): this;
|
|
566
|
+
copyFrom(source: Matrix): this;
|
|
567
|
+
clone(): Matrix;
|
|
568
|
+
asArray(): Float32Array;
|
|
569
|
+
toArray(): number[];
|
|
570
|
+
/** Babylon.js `Matrix.copyToArray` — copy the 16 elements into `array` at `offset`. */
|
|
571
|
+
copyToArray(array: Float32Array | number[], offset?: number): this;
|
|
572
|
+
equals(other: Matrix): boolean;
|
|
573
|
+
multiply(other: Matrix): Matrix;
|
|
574
|
+
multiplyToRef(other: Matrix, result: Matrix): Matrix;
|
|
575
|
+
transpose(): Matrix;
|
|
576
|
+
determinant(): number;
|
|
577
|
+
invert(): Matrix;
|
|
578
|
+
invertToRef(result: Matrix): Matrix;
|
|
579
|
+
getTranslation(): Vector3;
|
|
580
|
+
static FromValues(m0: number, m1: number, m2: number, m3: number, m4: number, m5: number, m6: number, m7: number, m8: number, m9: number, m10: number, m11: number, m12: number, m13: number, m14: number, m15: number): Matrix;
|
|
581
|
+
static FromArray(array: ArrayLike<number>, offset?: number): Matrix;
|
|
582
|
+
static Identity(): Matrix;
|
|
583
|
+
static Zero(): Matrix;
|
|
584
|
+
static Translation(x: number, y: number, z: number): Matrix;
|
|
585
|
+
static Scaling(x: number, y: number, z: number): Matrix;
|
|
586
|
+
static RotationX(angle: number): Matrix;
|
|
587
|
+
static RotationY(angle: number): Matrix;
|
|
588
|
+
static RotationZ(angle: number): Matrix;
|
|
589
|
+
/** Babylon.js `Matrix.LookAtLH(eye, target, up)` — left-handed view matrix. */
|
|
590
|
+
static LookAtLH(eye: Vector3, target: Vector3, up: Vector3): Matrix;
|
|
591
|
+
/** Babylon.js `Matrix.OrthoOffCenterLH(left, right, bottom, top, znear, zfar, halfZRange?)` — LH ortho projection. */
|
|
592
|
+
static OrthoOffCenterLH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, _halfZRange?: boolean): Matrix;
|
|
593
|
+
/**
|
|
594
|
+
* Babylon.js `Matrix.Compose(scale, rotation, translation)` — build a TRS matrix
|
|
595
|
+
* from a scale vector, a rotation quaternion, and a translation vector (row-vector
|
|
596
|
+
* convention, translation in elements 12/13/14).
|
|
597
|
+
*/
|
|
598
|
+
static Compose(scale: Vector3, rotation: {
|
|
599
|
+
x: number;
|
|
600
|
+
y: number;
|
|
601
|
+
z: number;
|
|
602
|
+
w: number;
|
|
603
|
+
}, translation: Vector3): Matrix;
|
|
604
|
+
/** Babylon.js `Matrix.markAsUpdated()` — Lite has no per-matrix dirty flag; no-op for parity. */
|
|
605
|
+
markAsUpdated(): this;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/** Babylon.js `Mesh` — a concrete renderable mesh with geometry. */
|
|
609
|
+
declare class Mesh_2 extends AbstractMesh {
|
|
610
|
+
constructor(name: string, sceneOrLite?: Scene | Mesh, scene?: Scene);
|
|
611
|
+
getClassName(): string;
|
|
612
|
+
private _morphTargetManager;
|
|
613
|
+
/**
|
|
614
|
+
* Babylon.js `mesh.morphTargetManager`. Babylon Lite builds morph GPU data via
|
|
615
|
+
* `createMorphTargets` and stores it on the Lite mesh; the compat manager is
|
|
616
|
+
* registered with the scene so the engine builds it at start (once the base
|
|
617
|
+
* CPU geometry exists) and assigns it onto the Lite mesh before registration.
|
|
618
|
+
*/
|
|
619
|
+
get morphTargetManager(): MorphTargetManager | null;
|
|
620
|
+
set morphTargetManager(value: MorphTargetManager | null);
|
|
621
|
+
/** Legacy `Mesh.CreateSphere(name, segments, diameter, scene)`. */
|
|
622
|
+
static CreateSphere(name: string, segments: number, diameter: number, scene: Scene): Mesh_2;
|
|
623
|
+
/** Legacy `Mesh.CreateBox(name, size, scene)`. */
|
|
624
|
+
static CreateBox(name: string, size: number, scene: Scene): Mesh_2;
|
|
625
|
+
/** Legacy `Mesh.CreateGround(name, width, height, subdivisions, scene)`. */
|
|
626
|
+
static CreateGround(name: string, width: number, height: number, subdivisions: number, scene: Scene): Mesh_2;
|
|
627
|
+
/** Legacy `Mesh.CreatePlane(name, size, scene)`. */
|
|
628
|
+
static CreatePlane(name: string, size: number, scene: Scene): Mesh_2;
|
|
629
|
+
/** Legacy `Mesh.CreateCylinder(name, height, diameterTop, diameterBottom, tessellation, _subdivisions, scene)`. */
|
|
630
|
+
static CreateCylinder(name: string, height: number, diameterTop: number, diameterBottom: number, tessellation: number, _subdivisions: number, scene: Scene): Mesh_2;
|
|
631
|
+
/** Legacy `Mesh.CreateTorus(name, diameter, thickness, tessellation, scene)`. */
|
|
632
|
+
static CreateTorus(name: string, diameter: number, thickness: number, tessellation: number, scene: Scene): Mesh_2;
|
|
633
|
+
/** Hardware-instanced copy — unsupported. Use native thin instances instead. */
|
|
634
|
+
createInstance(): never;
|
|
635
|
+
/**
|
|
636
|
+
* Babylon.js `mesh.thinInstanceSetBuffer(kind, buffer, stride)`. Maps the
|
|
637
|
+
* `"matrix"` and `"color"` instance buffers onto Babylon Lite's thin-instance
|
|
638
|
+
* API. Applied immediately to the Lite mesh (before the scene builds).
|
|
639
|
+
*/
|
|
640
|
+
thinInstanceSetBuffer(kind: string, buffer: Float32Array | null, _stride?: number): void;
|
|
641
|
+
/** Deep mesh clone — not yet wrapped. */
|
|
642
|
+
clone(): never;
|
|
643
|
+
/** Level-of-detail — unsupported (no LOD system in Babylon Lite). */
|
|
644
|
+
addLODLevel(): never;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/** Babylon.js `MorphTarget` — a single named morph influence with absolute target geometry. */
|
|
648
|
+
declare class MorphTarget {
|
|
649
|
+
name: string;
|
|
22
650
|
private _influence;
|
|
651
|
+
constructor(name: string, influence?: number, _scene?: Scene);
|
|
652
|
+
get influence(): number;
|
|
653
|
+
set influence(value: number);
|
|
654
|
+
/** Babylon.js `MorphTarget.setPositions(data)` — absolute target positions. */
|
|
655
|
+
setPositions(data: Float32Array | number[] | null): void;
|
|
656
|
+
/** Babylon.js `MorphTarget.getPositions()`. */
|
|
657
|
+
getPositions(): Float32Array | null;
|
|
658
|
+
/** Babylon.js `MorphTarget.setNormals(data)` — absolute target normals. */
|
|
659
|
+
setNormals(data: Float32Array | number[] | null): void;
|
|
660
|
+
/** Babylon.js `MorphTarget.getNormals()`. */
|
|
661
|
+
getNormals(): Float32Array | null;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/** Babylon.js `MorphTargetManager` — owns a mesh's morph targets (Babylon Lite supports up to 4). */
|
|
665
|
+
declare class MorphTargetManager {
|
|
23
666
|
private readonly _targets;
|
|
667
|
+
constructor(_scene?: Scene);
|
|
668
|
+
get numTargets(): number;
|
|
669
|
+
getTarget(index: number): MorphTarget;
|
|
670
|
+
/** Babylon.js `MorphTargetManager.addTarget(target)`. */
|
|
671
|
+
addTarget(target: MorphTarget): void;
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Result of {@link RecastNavigationJSPluginV2.createNavMesh}. Babylon.js's
|
|
675
|
+
* tile-cache navmesh build returns `{ navMesh, tileCache }`; here both reference
|
|
676
|
+
* the plugin so {@link WaitForFullTileCacheUpdate} can reach it.
|
|
677
|
+
*/
|
|
678
|
+
declare interface NavMeshResult {
|
|
679
|
+
navMesh: RecastNavigationJSPluginV2;
|
|
680
|
+
tileCache: RecastNavigationJSPluginV2;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
declare abstract class Node_2 {
|
|
684
|
+
name: string;
|
|
685
|
+
/** String id. Defaults to the name (Babylon.js parity). */
|
|
686
|
+
id: string;
|
|
687
|
+
/** Process-unique numeric id, assigned at construction. */
|
|
688
|
+
readonly uniqueId: number;
|
|
689
|
+
/** Free-form user data slot (Babylon.js `Node.metadata`). */
|
|
690
|
+
metadata: unknown;
|
|
24
691
|
protected constructor(name: string, scene?: Scene);
|
|
692
|
+
/** The runtime class name (overridden by each subclass). */
|
|
693
|
+
getClassName(): string;
|
|
694
|
+
/** The scene this node belongs to, if any. */
|
|
695
|
+
getScene(): Scene | undefined;
|
|
696
|
+
/** The engine backing this node's scene, if any. */
|
|
697
|
+
getEngine(): WebGPUEngine | undefined;
|
|
698
|
+
get parent(): Node_2 | null;
|
|
699
|
+
set parent(value: Node_2 | null);
|
|
25
700
|
/**
|
|
701
|
+
* Babylon.js `node.getDescendants(directDescendantsOnly?, predicate?)` — the
|
|
702
|
+
* nodes parented (directly or transitively) under this one, optionally filtered.
|
|
703
|
+
*/
|
|
704
|
+
getDescendants(directDescendantsOnly?: boolean, predicate?: (node: Node_2) => boolean): Node_2[];
|
|
705
|
+
/**
|
|
706
|
+
* Babylon.js `node.getChildren(predicate?, directDescendantsOnly?)` — descendant
|
|
707
|
+
* nodes (direct children by default), optionally filtered by a predicate.
|
|
708
|
+
*/
|
|
709
|
+
getChildren(predicate?: (node: Node_2) => boolean, directDescendantsOnly?: boolean): Node_2[];
|
|
710
|
+
/**
|
|
711
|
+
* Babylon.js `node.getChildMeshes(directDescendantsOnly?, predicate?)` — the
|
|
712
|
+
* descendant nodes that are meshes (all descendants by default).
|
|
713
|
+
*/
|
|
714
|
+
getChildMeshes(directDescendantsOnly?: boolean, predicate?: (node: Node_2) => boolean): Node_2[];
|
|
715
|
+
isEnabled(): boolean;
|
|
716
|
+
setEnabled(value: boolean): void;
|
|
717
|
+
isDisposed(): boolean;
|
|
718
|
+
dispose(): void;
|
|
719
|
+
|
|
720
|
+
declare class NodeMaterial {
|
|
721
|
+
name: string;
|
|
722
|
+
backFaceCulling: boolean;
|
|
26
723
|
private readonly _json;
|
|
724
|
+
private readonly _textureOverrides;
|
|
725
|
+
constructor(name: string, _scene: Scene, json?: object | string);
|
|
726
|
+
getClassName(): string;
|
|
727
|
+
/** Babylon.js `getBlockByName(name)` — returns a proxy that captures texture overrides. */
|
|
728
|
+
getBlockByName(name: string): NodeMaterialBlockProxy;
|
|
27
729
|
/** Babylon.js `NodeMaterial.build()` — Lite builds during parse, so this is a no-op. */
|
|
730
|
+
build(_verbose?: boolean): void;
|
|
28
731
|
dispose(): void;
|
|
29
732
|
/**
|
|
733
|
+
* Babylon.js `NodeMaterial.Parse(source, scene, rootUrl?)` — parse an NME graph
|
|
734
|
+
* from inline JSON. Returns synchronously; the actual GPU compile runs async and
|
|
735
|
+
* is driven by the engine (after shadow generators are built) before the scene
|
|
736
|
+
* builds, so NME shadow-receiver blocks can sample the scene's shadow generators.
|
|
737
|
+
*/
|
|
738
|
+
static Parse(source: object | string, scene: Scene, _rootUrl?: string): NodeMaterial;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
/** A thin proxy for a Babylon.js NME block, capturing texture assignments. */
|
|
742
|
+
declare class NodeMaterialBlockProxy {
|
|
743
|
+
private readonly _owner;
|
|
744
|
+
private readonly _name;
|
|
745
|
+
constructor(_owner: NodeMaterial, _name: string);
|
|
746
|
+
set texture(value: TextureLike | null);
|
|
747
|
+
get texture(): TextureLike | null;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
declare class Observable<T> {
|
|
751
|
+
private _observers;
|
|
752
|
+
add(callback: ObserverCallback<T>): ObserverCallback<T>;
|
|
753
|
+
addOnce(callback: ObserverCallback<T>): ObserverCallback<T>;
|
|
754
|
+
remove(callback: ObserverCallback<T> | null | undefined): boolean;
|
|
755
|
+
removeCallback(callback: ObserverCallback<T>): boolean;
|
|
756
|
+
notifyObservers(eventData?: T): void;
|
|
757
|
+
hasObservers(): boolean;
|
|
758
|
+
clear(): void;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
/**
|
|
762
|
+
* Minimal Babylon.js-compatible `Observable`.
|
|
763
|
+
*
|
|
764
|
+
* Supports the common surface used by ported scenes: `add`, `addOnce`, `remove`,
|
|
765
|
+
* `removeCallback`, `notifyObservers`, `hasObservers`, and `clear`. This is pure
|
|
766
|
+
* JS with no Babylon Lite dependency and is fully unit-testable.
|
|
767
|
+
*/
|
|
768
|
+
declare type ObserverCallback<T> = (eventData: T) => void;
|
|
769
|
+
|
|
770
|
+
/** Babylon.js `PBRAnisotropicConfiguration` — the `pbr.anisotropy` sub-object over Lite `AnisotropyProps`. */
|
|
771
|
+
declare class PBRAnisotropicConfiguration {
|
|
772
|
+
private readonly _props;
|
|
773
|
+
private readonly _markDirty;
|
|
774
|
+
constructor(_props: AnisotropyProps, _markDirty: () => void);
|
|
775
|
+
get isEnabled(): boolean;
|
|
776
|
+
set isEnabled(value: boolean);
|
|
777
|
+
get intensity(): number;
|
|
778
|
+
set intensity(value: number);
|
|
779
|
+
get direction(): {
|
|
780
|
+
x: number;
|
|
781
|
+
y: number;
|
|
782
|
+
};
|
|
783
|
+
set direction(value: {
|
|
784
|
+
x: number;
|
|
785
|
+
y: number;
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Babylon.js `PBRClearCoatConfiguration` — the `pbr.clearCoat` sub-object.
|
|
791
|
+
* Proxies the common clearcoat fields onto a Babylon Lite `ClearCoatProps`.
|
|
792
|
+
*/
|
|
793
|
+
declare class PBRClearCoatConfiguration {
|
|
794
|
+
private readonly _props;
|
|
795
|
+
private readonly _markDirty;
|
|
796
|
+
constructor(_props: ClearCoatProps, _markDirty: () => void);
|
|
797
|
+
get isEnabled(): boolean;
|
|
798
|
+
set isEnabled(value: boolean);
|
|
799
|
+
get intensity(): number;
|
|
800
|
+
set intensity(value: number);
|
|
801
|
+
get roughness(): number;
|
|
802
|
+
set roughness(value: number);
|
|
803
|
+
get indexOfRefraction(): number;
|
|
804
|
+
set indexOfRefraction(value: number);
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
/** Babylon.js `PBRIridescenceConfiguration` — the `pbr.iridescence` sub-object over Lite `IridescenceProps`. */
|
|
808
|
+
declare class PBRIridescenceConfiguration {
|
|
809
|
+
private readonly _props;
|
|
810
|
+
private readonly _markDirty;
|
|
811
|
+
constructor(_props: IridescenceProps, _markDirty: () => void);
|
|
812
|
+
get isEnabled(): boolean;
|
|
813
|
+
set isEnabled(value: boolean);
|
|
814
|
+
get intensity(): number;
|
|
815
|
+
set intensity(value: number);
|
|
816
|
+
get indexOfRefraction(): number;
|
|
817
|
+
set indexOfRefraction(value: number);
|
|
818
|
+
get minimumThickness(): number;
|
|
819
|
+
set minimumThickness(value: number);
|
|
820
|
+
get maximumThickness(): number;
|
|
821
|
+
set maximumThickness(value: number);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
declare class PBRMaterial extends PushMaterial {
|
|
30
825
|
constructor(name: string, scene?: Scene);
|
|
826
|
+
getClassName(): string;
|
|
827
|
+
get albedoColor(): Color3;
|
|
828
|
+
set albedoColor(value: Color3);
|
|
829
|
+
/**
|
|
830
|
+
* Babylon.js `pbr.albedoTexture` (glTF base-color map). The texture loads
|
|
831
|
+
* asynchronously, so the resolved Lite handle (+ sRGB flag) is bound in
|
|
832
|
+
* {@link _ensureRenderable} at engine start rather than here.
|
|
833
|
+
*/
|
|
834
|
+
get albedoTexture(): BaseTexture | null;
|
|
835
|
+
set albedoTexture(texture: BaseTexture | null);
|
|
836
|
+
private _albedoTexture;
|
|
837
|
+
get metallic(): number;
|
|
838
|
+
set metallic(value: number);
|
|
839
|
+
get roughness(): number;
|
|
840
|
+
set roughness(value: number);
|
|
841
|
+
get emissiveColor(): Color3;
|
|
842
|
+
set emissiveColor(value: Color3);
|
|
843
|
+
/**
|
|
844
|
+
* Babylon.js `pbr.usePhysicalLightFalloff`. When false, point/spot lights use
|
|
845
|
+
* Standard-style linear range falloff instead of physical inverse-square.
|
|
846
|
+
* Default true (matches Babylon.js PBRMaterial).
|
|
847
|
+
*/
|
|
848
|
+
get usePhysicalLightFalloff(): boolean;
|
|
849
|
+
set usePhysicalLightFalloff(value: boolean);
|
|
850
|
+
get alpha(): number;
|
|
851
|
+
set alpha(value: number);
|
|
852
|
+
/**
|
|
853
|
+
* Babylon.js `material.forceIrradianceInFragment`. Babylon Lite computes
|
|
854
|
+
* irradiance in the fragment stage already, so this is accepted for parity.
|
|
855
|
+
*/
|
|
856
|
+
forceIrradianceInFragment: boolean;
|
|
857
|
+
protected _applyBackFaceCulling(value: boolean): void;
|
|
858
|
+
/**
|
|
859
|
+
* Babylon.js `pbr.clearCoat` sub-configuration. Lazily allocates the Lite
|
|
860
|
+
* `clearCoat` props on first access and proxies the common fields
|
|
861
|
+
* (`isEnabled`, `intensity`, `roughness`, `indexOfRefraction`) onto them.
|
|
862
|
+
*/
|
|
863
|
+
get clearCoat(): PBRClearCoatConfiguration;
|
|
864
|
+
private _clearCoat?;
|
|
865
|
+
/** Babylon.js `pbr.sheen` sub-configuration (Lite `SheenProps`). */
|
|
866
|
+
get sheen(): PBRSheenConfiguration;
|
|
867
|
+
private _sheen?;
|
|
868
|
+
/** Babylon.js `pbr.anisotropy` sub-configuration (Lite `AnisotropyProps`). */
|
|
869
|
+
get anisotropy(): PBRAnisotropicConfiguration;
|
|
870
|
+
private _anisotropy?;
|
|
871
|
+
/** Babylon.js `pbr.iridescence` sub-configuration (Lite `IridescenceProps`). */
|
|
872
|
+
get iridescence(): PBRIridescenceConfiguration;
|
|
873
|
+
private _iridescence?;
|
|
874
|
+
/**
|
|
875
|
+
* Babylon.js `material.environmentTexture` / `reflectionTexture`. Babylon Lite
|
|
876
|
+
* applies image-based lighting scene-wide rather than per-material, so a cube
|
|
877
|
+
* environment assigned to a material is routed to the owning scene's
|
|
878
|
+
* environment (the dominant single-IBL case Babylon.js scenes use).
|
|
879
|
+
*/
|
|
880
|
+
get environmentTexture(): CubeTexture | null;
|
|
881
|
+
set environmentTexture(value: CubeTexture | null);
|
|
882
|
+
get reflectionTexture(): CubeTexture | null;
|
|
883
|
+
set reflectionTexture(value: CubeTexture | null);
|
|
884
|
+
|
|
885
|
+
/** Babylon.js `PBRSheenConfiguration` — the `pbr.sheen` sub-object over Lite `SheenProps`. */
|
|
886
|
+
declare class PBRSheenConfiguration {
|
|
887
|
+
private readonly _props;
|
|
888
|
+
private readonly _markDirty;
|
|
889
|
+
constructor(_props: SheenProps, _markDirty: () => void);
|
|
890
|
+
get isEnabled(): boolean;
|
|
891
|
+
set isEnabled(value: boolean);
|
|
892
|
+
get intensity(): number;
|
|
893
|
+
set intensity(value: number);
|
|
894
|
+
get roughness(): number;
|
|
895
|
+
set roughness(value: number);
|
|
896
|
+
get color(): Color3;
|
|
897
|
+
set color(value: Color3);
|
|
898
|
+
/** Babylon.js `sheen.texture`. Binds the Lite handle if the texture has resolved. */
|
|
899
|
+
set texture(value: {
|
|
900
|
+
_lite?: Texture2D;
|
|
901
|
+
} | null);
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
declare class Plane {
|
|
905
|
+
/** Normal x/y/z and signed distance `d` from the origin (`normal · p + d = 0`). */
|
|
906
|
+
normal: Vector3;
|
|
907
|
+
d: number;
|
|
908
|
+
constructor(a: number, b: number, c: number, d: number);
|
|
909
|
+
asArray(): [number, number, number, number];
|
|
910
|
+
clone(): Plane;
|
|
911
|
+
normalize(): this;
|
|
912
|
+
/** Signed distance from `point` to this plane. */
|
|
913
|
+
signedDistanceTo(point: Vector3): number;
|
|
914
|
+
dotCoordinate(point: Vector3): number;
|
|
915
|
+
static FromArray(array: ArrayLike<number>): Plane;
|
|
916
|
+
static FromPositionAndNormal(origin: Vector3, normal: Vector3): Plane;
|
|
917
|
+
static FromPoints(point1: Vector3, point2: Vector3, point3: Vector3): Plane;
|
|
918
|
+
/** Transform a copy of this plane by the transpose of the inverse of `transformation`. */
|
|
919
|
+
transform(transformation: Matrix): Plane;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
/** Babylon.js `PushMaterial` — intermediate base; behaves like {@link Material} here. */
|
|
923
|
+
declare abstract class PushMaterial extends Material {
|
|
924
|
+
getClassName(): string;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
declare class Quaternion {
|
|
928
|
+
x: number;
|
|
929
|
+
y: number;
|
|
930
|
+
z: number;
|
|
931
|
+
w: number;
|
|
932
|
+
constructor(x?: number, y?: number, z?: number, w?: number);
|
|
933
|
+
set(x: number, y: number, z: number, w: number): this;
|
|
934
|
+
copyFrom(source: Quaternion): this;
|
|
935
|
+
multiply(other: Quaternion): Quaternion;
|
|
936
|
+
length(): number;
|
|
937
|
+
normalize(): this;
|
|
938
|
+
conjugate(): Quaternion;
|
|
939
|
+
clone(): Quaternion;
|
|
940
|
+
equals(other: Quaternion): boolean;
|
|
941
|
+
asArray(): [number, number, number, number];
|
|
942
|
+
toEulerAngles(): Vector3;
|
|
943
|
+
static Identity(): Quaternion;
|
|
944
|
+
static FromEulerAngles(x: number, y: number, z: number): Quaternion;
|
|
945
|
+
static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Quaternion;
|
|
946
|
+
static RotationAxis(axis: Vector3, angle: number): Quaternion;
|
|
947
|
+
static Slerp(left: Quaternion, right: Quaternion, amount: number): Quaternion;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* Babylon.js `RecastJSCrowd` (subset) — owns crowd agents and syncs each agent's
|
|
952
|
+
* Babylon transform to the simulated position every frame, exactly like the addon.
|
|
953
|
+
*/
|
|
954
|
+
export declare class RecastJSCrowd {
|
|
31
955
|
private readonly _transforms;
|
|
956
|
+
private readonly _plugin;
|
|
957
|
+
constructor(lite: NavCrowd, plugin: RecastNavigationJSPluginV2, scene: Scene);
|
|
958
|
+
/** Babylon.js `crowd.addAgent(pos, parameters, transform)` — returns the agent index. */
|
|
959
|
+
addAgent(pos: Vec3Like, parameters: AgentParameters, transform: AgentTransform): number;
|
|
960
|
+
/** Babylon.js `crowd.getAgentPosition(index)`. */
|
|
961
|
+
getAgentPosition(index: number): Vector3;
|
|
962
|
+
/** Babylon.js `crowd.agentGoto(index, destination)` — request the agent to move toward a target. */
|
|
963
|
+
agentGoto(index: number, destination: Vec3Like): void;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* Babylon.js `RecastNavigationJSPluginV2` (subset) over Babylon Lite navigation.
|
|
968
|
+
*/
|
|
969
|
+
export declare class RecastNavigationJSPluginV2 {
|
|
32
970
|
/**
|
|
971
|
+
* Babylon.js `plugin.timeFactor` — multiplier applied to each crowd update step.
|
|
972
|
+
* `0` pauses crowd movement (used by parity tests); default `1`.
|
|
973
|
+
*/
|
|
974
|
+
timeFactor: number;
|
|
975
|
+
constructor(lite: NavigationPlugin);
|
|
976
|
+
/**
|
|
977
|
+
* Babylon.js `plugin.createNavMesh(meshes, parameters)`. Returns a
|
|
978
|
+
* `{ navMesh, tileCache }` handle (both reference this plugin) so scenes using
|
|
979
|
+
* the tile-cache obstacle API can pass them to {@link WaitForFullTileCacheUpdate}.
|
|
980
|
+
* Scenes that ignore the return (the non-obstacle navmesh scenes) are unaffected.
|
|
981
|
+
*/
|
|
982
|
+
createNavMesh(meshes: Array<{
|
|
983
|
+
_lite: Mesh;
|
|
984
|
+
}>, parameters: Record<string, unknown>): NavMeshResult;
|
|
985
|
+
/** Babylon.js `plugin.addCylinderObstacle(position, radius, height)` — tile-cache obstacle. */
|
|
986
|
+
addCylinderObstacle(position: Vec3Like, radius: number, height: number): ObstacleHandle | null;
|
|
987
|
+
/** Babylon.js `plugin.addBoxObstacle(position, extent, angle)` — tile-cache obstacle (`extent` = half-extents). */
|
|
988
|
+
addBoxObstacle(position: Vec3Like, extent: Vec3Like, angle: number): ObstacleHandle | null;
|
|
989
|
+
/** Babylon.js `plugin.removeObstacle(obstacle)` — remove a previously-added tile-cache obstacle. */
|
|
990
|
+
removeObstacle(obstacle: ObstacleHandle): void;
|
|
33
991
|
/** Babylon.js `plugin.createDebugNavMesh(scene)` — builds a renderable debug mesh. */
|
|
992
|
+
createDebugNavMesh(scene: Scene): Mesh_2;
|
|
993
|
+
/** Babylon.js `plugin.getClosestPoint(position)` — snap to the navmesh. */
|
|
994
|
+
getClosestPoint(position: Vec3Like): Vector3;
|
|
995
|
+
/** Babylon.js `plugin.computePath(start, end)` — navmesh-snapped path as world points. */
|
|
996
|
+
computePath(start: Vec3Like, end: Vec3Like): Vector3[];
|
|
997
|
+
/** Babylon.js `plugin.computePathSmooth(start, end)` — alias of {@link computePath} (Lite smooths internally). */
|
|
998
|
+
computePathSmooth(start: Vec3Like, end: Vec3Like): Vector3[];
|
|
999
|
+
/**
|
|
1000
|
+
* Babylon.js `plugin.raycast(start, end)` — walkability raycast on the navmesh.
|
|
1001
|
+
* Returns `{ hit, hitPoint? }` (`hitPoint` is a `Vector3` when `hit`).
|
|
1002
|
+
*/
|
|
1003
|
+
raycast(start: Vec3Like, end: Vec3Like): {
|
|
1004
|
+
hit: boolean;
|
|
1005
|
+
hitPoint?: Vector3;
|
|
1006
|
+
};
|
|
1007
|
+
/** Babylon.js `plugin.createCrowd(maxAgents, maxAgentRadius, scene)`. */
|
|
1008
|
+
createCrowd(maxAgents: number, maxAgentRadius: number, scene: Scene): RecastJSCrowd;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
declare class Scene extends AbstractScene {
|
|
34
1012
|
/** Babylon.js fog-mode constants. */
|
|
1013
|
+
static readonly FOGMODE_NONE = 0;
|
|
1014
|
+
static readonly FOGMODE_EXP = 1;
|
|
1015
|
+
static readonly FOGMODE_EXP2 = 2;
|
|
1016
|
+
static readonly FOGMODE_LINEAR = 3;
|
|
1017
|
+
/** Fires before each scene render (wired to Lite's before-render hook). */
|
|
1018
|
+
readonly onBeforeRenderObservable: Observable<Scene>;
|
|
1019
|
+
/** Fires before animations are evaluated each frame (used by ported cross-fade drivers). */
|
|
1020
|
+
readonly onBeforeAnimationsObservable: Observable<Scene>;
|
|
1021
|
+
/** Fires after each scene render. */
|
|
1022
|
+
readonly onAfterRenderObservable: Observable<Scene>;
|
|
1023
|
+
/** Fires once when the scene is disposed. */
|
|
1024
|
+
readonly onDisposeObservable: Observable<Scene>;
|
|
1025
|
+
/**
|
|
1026
|
+
* Babylon.js `scene.animationGroups` / `scene.animatables`. Loaded glTF /
|
|
1027
|
+
* `.babylon` animation clips live on the Lite scene; `animationGroups` returns
|
|
1028
|
+
* BJS-shaped `AnimationGroup`s over them (so scenes can `goToFrame`/`pause`/`stop`
|
|
1029
|
+
* to freeze a model at a deterministic frame). `animatables` surfaces the running
|
|
1030
|
+
* CPU `Animatable`s started via `beginDirectAnimation`.
|
|
1031
|
+
*/
|
|
1032
|
+
get animationGroups(): AnimationGroup[];
|
|
1033
|
+
/** Babylon.js `scene.getAnimationGroupByName(name)` — first loaded animation group with a matching name, else `null`. */
|
|
1034
|
+
getAnimationGroupByName(name: string): AnimationGroup | null;
|
|
1035
|
+
get animatables(): Animatable_2[];
|
|
1036
|
+
private readonly _engine;
|
|
1037
|
+
private _activeCamera;
|
|
1038
|
+
private _defaultMaterial;
|
|
1039
|
+
private _fogMode;
|
|
1040
|
+
private _fogStart;
|
|
1041
|
+
private _fogEnd;
|
|
1042
|
+
private _fogDensity;
|
|
1043
|
+
private _fogColor;
|
|
35
1044
|
private _started;
|
|
1045
|
+
private _envTexture;
|
|
1046
|
+
private _defaultEnvOptions;
|
|
1047
|
+
private readonly _shadowGenerators;
|
|
1048
|
+
private readonly _pendingTextures;
|
|
1049
|
+
private readonly _pendingGroundBakes;
|
|
1050
|
+
private readonly _pendingMorphBuilds;
|
|
1051
|
+
private readonly _runningAnimatables;
|
|
1052
|
+
private readonly _animationGroupCache;
|
|
36
1053
|
private _ambientColor;
|
|
1054
|
+
private _environmentIntensity;
|
|
37
1055
|
/** Babylon.js `scene.uniqueId` — a process-unique numeric id. */
|
|
1056
|
+
readonly uniqueId: number;
|
|
1057
|
+
constructor(engine: WebGPUEngine);
|
|
38
1058
|
getEngine(): WebGPUEngine;
|
|
1059
|
+
/** Babylon.js `scene.getClassName()`. */
|
|
1060
|
+
getClassName(): string;
|
|
1061
|
+
/** Babylon.js `scene.getUniqueId()` — the process-unique scene id. */
|
|
1062
|
+
getUniqueId(): number;
|
|
39
1063
|
/**
|
|
1064
|
+
* Babylon.js `scene.defaultMaterial` — a shared `StandardMaterial` applied to
|
|
1065
|
+
* meshes that have no material assigned. Babylon Lite requires every mesh to
|
|
1066
|
+
* carry a material to render, so the mesh wrappers assign this lazily-created
|
|
1067
|
+
* default; reading it (or assigning a replacement) matches Babylon.js.
|
|
1068
|
+
*/
|
|
1069
|
+
get defaultMaterial(): StandardMaterial;
|
|
1070
|
+
set defaultMaterial(value: StandardMaterial);
|
|
1071
|
+
get clearColor(): Color4;
|
|
1072
|
+
set clearColor(value: Color4);
|
|
1073
|
+
get activeCamera(): Camera | null;
|
|
1074
|
+
set activeCamera(camera: Camera | null);
|
|
40
1075
|
/** Image-processing exposure proxy (Babylon.js `imageProcessingConfiguration.exposure`). */
|
|
1076
|
+
get imageProcessingConfiguration(): {
|
|
1077
|
+
exposure: number;
|
|
1078
|
+
contrast: number;
|
|
1079
|
+
toneMappingEnabled: boolean;
|
|
1080
|
+
};
|
|
1081
|
+
/** Babylon.js `scene.performancePriority` — accepted for parity; Babylon Lite tunes its own pipeline. */
|
|
1082
|
+
performancePriority: number;
|
|
1083
|
+
/**
|
|
1084
|
+
* Babylon.js `scene.ambientColor` — the scene-wide ambient term multiplied into
|
|
1085
|
+
* each material's ambient contribution. Babylon Lite bakes ambient at the
|
|
1086
|
+
* material level (the `.babylon` loader folds `scene.ambientColor` into each
|
|
1087
|
+
* material), so this is stored for parity; the BJS default `(0,0,0)` is a no-op.
|
|
1088
|
+
*/
|
|
1089
|
+
get ambientColor(): Color3;
|
|
1090
|
+
set ambientColor(value: Color3);
|
|
1091
|
+
/**
|
|
1092
|
+
* Babylon.js `scene.environmentIntensity` — a global multiplier on IBL
|
|
1093
|
+
* contribution. Babylon Lite applies environment intensity per PBR material;
|
|
1094
|
+
* this is stored for parity (the BJS default `1` is a no-op).
|
|
1095
|
+
*/
|
|
1096
|
+
get environmentIntensity(): number;
|
|
1097
|
+
set environmentIntensity(value: number);
|
|
1098
|
+
/**
|
|
1099
|
+
* Babylon.js `scene.useRightHandedSystem`. Babylon Lite's coordinate system is
|
|
1100
|
+
* fixed; this is stored for parity (the BJS WebGPU default is left-handed —
|
|
1101
|
+
* `false` — so the common case is a no-op).
|
|
1102
|
+
*/
|
|
1103
|
+
useRightHandedSystem: boolean;
|
|
1104
|
+
/** Babylon.js `scene.registerBeforeRender(cb)` — convenience over `onBeforeRenderObservable`. */
|
|
1105
|
+
registerBeforeRender(callback: () => void): void;
|
|
1106
|
+
/** Babylon.js `scene.unregisterBeforeRender(cb)`. */
|
|
1107
|
+
unregisterBeforeRender(callback: () => void): void;
|
|
1108
|
+
/** Babylon.js `scene.registerAfterRender(cb)` — convenience over `onAfterRenderObservable`. */
|
|
1109
|
+
registerAfterRender(callback: () => void): void;
|
|
1110
|
+
/** Babylon.js `scene.unregisterAfterRender(cb)`. */
|
|
1111
|
+
unregisterAfterRender(callback: () => void): void;
|
|
1112
|
+
/** Babylon.js `scene.attachControl` — camera input is attached per-camera in the compat layer; no-op. */
|
|
1113
|
+
attachControl(_attachUp?: boolean, _attachDown?: boolean, _attachMove?: boolean): void;
|
|
1114
|
+
/** Babylon.js `scene.detachControl` — no-op (see {@link attachControl}). */
|
|
1115
|
+
detachControl(): void;
|
|
1116
|
+
get fogMode(): number;
|
|
1117
|
+
set fogMode(value: number);
|
|
1118
|
+
get fogStart(): number;
|
|
1119
|
+
set fogStart(value: number);
|
|
1120
|
+
get fogEnd(): number;
|
|
1121
|
+
set fogEnd(value: number);
|
|
1122
|
+
get fogDensity(): number;
|
|
1123
|
+
set fogDensity(value: number);
|
|
1124
|
+
get fogColor(): Color3;
|
|
1125
|
+
set fogColor(value: Color3);
|
|
41
1126
|
private _clipPlane;
|
|
1127
|
+
/**
|
|
1128
|
+
* Babylon.js `scene.clipPlane` — a single world-space clip plane
|
|
1129
|
+
* (`normal · p + d = 0`); fragments on the negative side are discarded.
|
|
1130
|
+
* Routed to Babylon Lite's opt-in `setClipPlane`.
|
|
1131
|
+
*/
|
|
1132
|
+
get clipPlane(): Plane | null;
|
|
1133
|
+
set clipPlane(value: Plane | null);
|
|
1134
|
+
get environmentTexture(): CubeTexture | null;
|
|
1135
|
+
set environmentTexture(value: CubeTexture | null);
|
|
1136
|
+
/**
|
|
1137
|
+
* Babylon.js `scene.createDefaultEnvironment` — adds an IBL skybox and ground.
|
|
1138
|
+
* Babylon Lite performs this through `loadEnvironment` (deferred to engine start),
|
|
1139
|
+
* combining the environment URL recorded via `scene.environmentTexture` with
|
|
1140
|
+
* Babylon.js's default skybox/ground assets.
|
|
1141
|
+
*/
|
|
1142
|
+
createDefaultEnvironment(options?: DefaultEnvironmentOptions): {
|
|
1143
|
+
dispose(): void;
|
|
1144
|
+
};
|
|
1145
|
+
/**
|
|
1146
|
+
* Babylon.js `scene.createDefaultSkybox(texture, pbr?, scale?, blur?, setGlobalEnv?)` —
|
|
1147
|
+
* adds a skybox built from the given environment texture. Babylon Lite reuses the
|
|
1148
|
+
* loaded `.env` specular cubemap as an HDR skybox, so this records the env URL (if
|
|
1149
|
+
* not already set) and flags a skybox-from-environment load at engine start.
|
|
1150
|
+
*/
|
|
1151
|
+
createDefaultSkybox(texture?: CubeTexture, _pbr?: boolean, scale?: number, _blur?: number, _setGlobalEnv?: boolean): {
|
|
1152
|
+
dispose(): void;
|
|
1153
|
+
};
|
|
42
1154
|
/** Create and activate a default arc-rotate camera framing the scene. */
|
|
1155
|
+
createDefaultCamera(_createArcRotateCamera?: boolean, _replace?: boolean, _attachControl?: boolean): Camera;
|
|
1156
|
+
/** Babylon.js `createDefaultCameraOrLight` — default framing camera plus a default hemispheric light. */
|
|
1157
|
+
createDefaultCameraOrLight(createArcRotateCamera?: boolean, replace?: boolean, attachControl?: boolean): void;
|
|
1158
|
+
/** Babylon.js render hook. No-op under Babylon Lite's engine-driven loop. */
|
|
1159
|
+
render(): void;
|
|
1160
|
+
/**
|
|
1161
|
+
* Babylon.js readiness gate. Babylon Lite builds its scene synchronously and
|
|
1162
|
+
* defers GPU work into `registerScene`/`startEngine` (driven by the engine's
|
|
1163
|
+
* render loop), so there is nothing to await here — resolve immediately.
|
|
1164
|
+
*/
|
|
1165
|
+
whenReadyAsync(): Promise<void>;
|
|
1166
|
+
/** Babylon.js synchronous readiness check — always ready in the compat layer. */
|
|
1167
|
+
isReady(): boolean;
|
|
1168
|
+
/** Synchronous CPU picking — unsupported. Babylon Lite uses async GPU picking. */
|
|
1169
|
+
pick(): never;
|
|
1170
|
+
/** Synchronous ray picking — unsupported. */
|
|
1171
|
+
pickWithRay(): never;
|
|
1172
|
+
/**
|
|
1173
|
+
* Babylon.js `scene.beginDirectAnimation(target, animations, from, to, loop, speedRatio?)`.
|
|
1174
|
+
* Drives the given `Animation`s on the CPU each frame, writing onto the target's
|
|
1175
|
+
* (dotted) property path. Returns an `Animatable` with `goToFrame`/`pause`/`stop`.
|
|
1176
|
+
*/
|
|
1177
|
+
beginDirectAnimation(target: unknown, animations: Animation_2[], from: number, to: number, loop?: boolean, speedRatio?: number): Animatable_2;
|
|
43
1178
|
/**
|
|
1179
|
+
* Babylon.js `scene.beginAnimation(target, from, to, loop, speedRatio?)`. Runs
|
|
1180
|
+
* the animations already attached to `target.animations`.
|
|
1181
|
+
*/
|
|
1182
|
+
beginAnimation(target: {
|
|
1183
|
+
animations?: Animation_2[];
|
|
1184
|
+
}, from: number, to: number, loop?: boolean, speedRatio?: number): Animatable_2;
|
|
1185
|
+
dispose(): void;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
declare class StandardMaterial extends PushMaterial {
|
|
44
1189
|
constructor(name: string, scene?: Scene);
|
|
1190
|
+
getClassName(): string;
|
|
1191
|
+
get diffuseColor(): Color3;
|
|
1192
|
+
set diffuseColor(value: Color3);
|
|
1193
|
+
get specularColor(): Color3;
|
|
1194
|
+
set specularColor(value: Color3);
|
|
1195
|
+
get emissiveColor(): Color3;
|
|
1196
|
+
set emissiveColor(value: Color3);
|
|
1197
|
+
get ambientColor(): Color3;
|
|
1198
|
+
set ambientColor(value: Color3);
|
|
1199
|
+
get disableLighting(): boolean;
|
|
1200
|
+
set disableLighting(value: boolean);
|
|
1201
|
+
protected _applyBackFaceCulling(value: boolean): void;
|
|
1202
|
+
get alpha(): number;
|
|
1203
|
+
set alpha(value: number);
|
|
1204
|
+
get diffuseTexture(): BaseTexture | null;
|
|
1205
|
+
set diffuseTexture(texture: BaseTexture | null);
|
|
1206
|
+
/**
|
|
1207
|
+
* Babylon.js `StandardMaterial.alphaCutOff` — alpha-test threshold. Fragments
|
|
1208
|
+
* whose diffuse-texture alpha is below this value are discarded. Babylon Lite's
|
|
1209
|
+
* Standard pipeline alpha-tests against the diffuse texture's alpha when
|
|
1210
|
+
* `alphaCutOff > 0`, so this is wired directly.
|
|
1211
|
+
*/
|
|
1212
|
+
get alphaCutOff(): number;
|
|
1213
|
+
set alphaCutOff(value: number);
|
|
1214
|
+
/**
|
|
1215
|
+
* Babylon.js `StandardMaterial.useAlphaFromDiffuseTexture`. Babylon Lite's
|
|
1216
|
+
* alpha test already samples the diffuse texture's alpha (enabled via
|
|
1217
|
+
* `alphaCutOff`), so this is accepted for parity.
|
|
1218
|
+
*/
|
|
1219
|
+
useAlphaFromDiffuseTexture: boolean;
|
|
1220
|
+
get bumpTexture(): BaseTexture | null;
|
|
1221
|
+
set bumpTexture(texture: BaseTexture | null);
|
|
1222
|
+
get emissiveTexture(): BaseTexture | null;
|
|
1223
|
+
set emissiveTexture(texture: BaseTexture | null);
|
|
1224
|
+
private _diffuseTexture;
|
|
1225
|
+
private _bumpTexture;
|
|
1226
|
+
private _emissiveTexture;
|
|
1227
|
+
|
|
1228
|
+
declare interface TextureLike {
|
|
1229
|
+
_lite?: Texture2D;
|
|
1230
|
+
whenReadyAsync?(): Promise<void>;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
/**
|
|
1234
|
+
* Babylon.js `TransformNode` — a positioned, rotated, scaled scene-graph node.
|
|
1235
|
+
* Wraps a Lite scene node (`_node`): either a standalone Lite transform node, or
|
|
1236
|
+
* (for meshes) the Lite mesh itself, which also carries the transform.
|
|
1237
|
+
*/
|
|
1238
|
+
declare class TransformNode extends Node_2 {
|
|
45
1239
|
constructor(name: string, scene?: Scene, liteNode?: SceneNode);
|
|
1240
|
+
getClassName(): string;
|
|
1241
|
+
get position(): Vector3;
|
|
1242
|
+
set position(value: Vector3);
|
|
1243
|
+
get rotation(): Vector3;
|
|
1244
|
+
set rotation(value: Vector3);
|
|
1245
|
+
get scaling(): Vector3;
|
|
1246
|
+
set scaling(value: Vector3);
|
|
46
1247
|
/**
|
|
1248
|
+
* Babylon.js `rotationQuaternion`. Babylon Lite always drives a node's world
|
|
1249
|
+
* matrix from a quaternion (its euler `rotation` is a proxy over the same
|
|
1250
|
+
* quaternion), so this reads/writes that quaternion. Returns `null` until
|
|
1251
|
+
* explicitly assigned, matching Babylon.js's euler-by-default convention.
|
|
1252
|
+
*/
|
|
1253
|
+
get rotationQuaternion(): Quaternion | null;
|
|
1254
|
+
set rotationQuaternion(value: Quaternion | null);
|
|
1255
|
+
/**
|
|
1256
|
+
* Babylon.js `setParent(node)` — reparent while **preserving world position**
|
|
1257
|
+
* (the child's local transform is recomputed). Distinct from the `parent`
|
|
1258
|
+
* setter, which keeps the local transform and lets the world move.
|
|
1259
|
+
*/
|
|
1260
|
+
setParent(parent: Node_2 | null): TransformNode;
|
|
1261
|
+
protected _applyParent(parent: Node_2 | null): void;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
declare interface Vec3Like {
|
|
1265
|
+
x: number;
|
|
1266
|
+
y: number;
|
|
1267
|
+
z: number;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
declare class Vector3 {
|
|
1271
|
+
x: number;
|
|
1272
|
+
y: number;
|
|
1273
|
+
z: number;
|
|
1274
|
+
constructor(x?: number, y?: number, z?: number);
|
|
1275
|
+
set(x: number, y: number, z: number): this;
|
|
1276
|
+
setAll(value: number): this;
|
|
1277
|
+
copyFrom(source: Vector3): this;
|
|
1278
|
+
copyFromFloats(x: number, y: number, z: number): this;
|
|
1279
|
+
add(other: Vector3): Vector3;
|
|
1280
|
+
addInPlace(other: Vector3): this;
|
|
1281
|
+
addInPlaceFromFloats(x: number, y: number, z: number): this;
|
|
1282
|
+
subtract(other: Vector3): Vector3;
|
|
1283
|
+
subtractInPlace(other: Vector3): this;
|
|
1284
|
+
multiply(other: Vector3): Vector3;
|
|
1285
|
+
scale(scale: number): Vector3;
|
|
1286
|
+
scaleInPlace(scale: number): this;
|
|
1287
|
+
negate(): Vector3;
|
|
1288
|
+
length(): number;
|
|
1289
|
+
lengthSquared(): number;
|
|
1290
|
+
normalize(): this;
|
|
1291
|
+
clone(): Vector3;
|
|
1292
|
+
equals(other: Vector3): boolean;
|
|
1293
|
+
equalsWithEpsilon(other: Vector3, epsilon?: number): boolean;
|
|
1294
|
+
asArray(): [number, number, number];
|
|
1295
|
+
toArray(array: number[], index?: number): this;
|
|
1296
|
+
static Zero(): Vector3;
|
|
1297
|
+
static One(): Vector3;
|
|
1298
|
+
static Up(): Vector3;
|
|
1299
|
+
static Down(): Vector3;
|
|
1300
|
+
static Forward(): Vector3;
|
|
1301
|
+
static Backward(): Vector3;
|
|
1302
|
+
static Right(): Vector3;
|
|
1303
|
+
static Left(): Vector3;
|
|
1304
|
+
static FromArray(array: ArrayLike<number>, offset?: number): Vector3;
|
|
1305
|
+
static Dot(a: Vector3, b: Vector3): number;
|
|
1306
|
+
static Cross(a: Vector3, b: Vector3): Vector3;
|
|
1307
|
+
static Distance(a: Vector3, b: Vector3): number;
|
|
1308
|
+
static DistanceSquared(a: Vector3, b: Vector3): number;
|
|
1309
|
+
static Lerp(start: Vector3, end: Vector3, amount: number): Vector3;
|
|
1310
|
+
/** Midpoint between two vectors. */
|
|
1311
|
+
static Center(a: Vector3, b: Vector3): Vector3;
|
|
1312
|
+
/** Midpoint between two vectors, written into `ref`. */
|
|
1313
|
+
static CenterToRef(a: Vector3, b: Vector3, ref: Vector3): Vector3;
|
|
1314
|
+
static Normalize(vector: Vector3): Vector3;
|
|
1315
|
+
static Minimize(a: Vector3, b: Vector3): Vector3;
|
|
1316
|
+
static Maximize(a: Vector3, b: Vector3): Vector3;
|
|
1317
|
+
/** Transform a coordinate (point) by a matrix using the row-vector convention. */
|
|
1318
|
+
static TransformCoordinates(vector: Vector3, transformation: Matrix): Vector3;
|
|
1319
|
+
/** Transform a direction (normal) by a matrix, ignoring translation. */
|
|
1320
|
+
static TransformNormal(vector: Vector3, transformation: Matrix): Vector3;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1323
|
+
/**
|
|
1324
|
+
* Babylon.js `@babylonjs/addons/navigation/common/tile-cache`
|
|
1325
|
+
* `WaitForFullTileCacheUpdate(navMesh, tileCache)` — block until pending
|
|
1326
|
+
* tile-cache obstacle updates are applied. The addon takes the raw navMesh /
|
|
1327
|
+
* tileCache; here `navMesh` is the compat plugin (returned from `createNavMesh`),
|
|
1328
|
+
* so this delegates to Babylon Lite's `updateNavMeshObstacles`.
|
|
1329
|
+
*/
|
|
1330
|
+
export declare function WaitForFullTileCacheUpdate(navMesh: unknown, _tileCache?: unknown): void;
|
|
1331
|
+
|
|
1332
|
+
/**
|
|
1333
|
+
* Babylon.js's WebGPU engine. In Babylon.js `WebGPUEngine extends AbstractEngine`
|
|
1334
|
+
* (sibling to {@link Engine}). This is the natural engine for the compat layer
|
|
1335
|
+
* since Babylon Lite is WebGPU-only.
|
|
1336
|
+
*/
|
|
1337
|
+
declare class WebGPUEngine extends AbstractEngine {
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
export { }
|