@babylonjs/lite-compat 1.31.1-preview → 1.32.0-preview

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/README.md CHANGED
@@ -119,7 +119,7 @@ overloads within a supported area may still be absent.
119
119
  | ----------------------------------------------------------------------------------------------------------------------------------------- | :----: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
120
120
  | Math (`Vector*`, `Color*`, `Quaternion`, `Matrix`, `Plane`, `Ray`, `Frustum`, `Scalar`, `Axis`/`Space`, color temperature/white balance) | ✅ | `Angle` / `Curve3` / `Path3D` partial |
121
121
  | Engine (`WebGPUEngine`, `Engine`, `ThinEngine`, `NullEngine`) | ⚡ | async startup + render loop; `currentSampleCount` reports the active surface's MSAA count; `beginFrame`/`endFrame`, occlusion queries, engine-wide alpha-to-coverage, and manual `scene.render()` unsupported |
122
- | Compute + GPU buffers (`ComputeShader`, `StorageBuffer`, `UniformBuffer`) | ⚡ | WGSL compute, direct/indirect dispatch, storage buffers, and compute-oriented std140 uniform buffers forward to Lite; shader registries/preprocessing, texture bindings, in-frame immediate dispatch, and Effect-oriented UBO methods remain unsupported |
122
+ | Compute + GPU buffers (`ComputeShader`, `StorageBuffer`, `UniformBuffer`) | ⚡ | WGSL compute, direct/indirect dispatch, storage buffers, and compute-oriented std140 uniform buffers forward to Lite; shader registries/preprocessing, texture bindings, in-frame immediate dispatch, and Effect-oriented UBO methods remain unsupported |
123
123
  | Scene (clear color, cameras/lights, fog, environment, observables, ready state) | ⚡ | sync `scene.pick` forwards to Lite's CPU/AABB picker; triangle-level positions, normals, and UVs still require async `GPUPicker`; `scene.meshes` + `getMeshBy*`/`getNodeBy*` enumerate every mesh via a canonical wrapper registry; exposure/contrast/tone mapping are forwarded, while white balance and fluid rendering throw because Lite lacks their cross-cutting shader/render-pass subsystems |
124
124
  | Cameras (`ArcRotateCamera`, `FreeCamera`/`Universal`/`Target`, `FollowCamera`, `GeospatialCamera`) | ✅ | arc controls include pointer, wheel, touch, and BJS-default Arrow-key input; orthographic bounds and projection-mode switching forward to Lite; fully unconfigured orthographic extents use Lite's `halfHeight` + aspect-ratio derivation rather than Babylon.js render dimensions; XR / device-orientation / stereoscopic rigs unsupported |
125
125
  | Lights (`Hemispheric`, `Directional`, `Point`, `Spot`) | ✅ | `ClusteredLightContainer` clusters point lights (⚡ partial); `RectAreaLight` unsupported |
@@ -129,7 +129,7 @@ overloads within a supported area may still be absent.
129
129
  | Gizmos (position/rotation/scale/bounding-box/light/camera + `GizmoManager`) | ⚡ | over Lite gizmo suite; `isEnabled` toggles per-axis interactivity (display-only when disabled) |
130
130
  | Materials (`StandardMaterial`, `PBRMaterial`, metallic-rough / spec-gloss, `NodeMaterial`) | ⚡ | `clone(name)` shares textures with its own renderable; fixed-slot custom WGSL `MaterialPluginBase` injection is supported (`#include`, regex replacement, and custom UBO/sampler hooks are not), while `DitheredTileFadeMaterialPlugin`, GLSL `ShaderMaterial`, `MultiMaterial`, `BackgroundMaterial`, and `OpenPBRMaterial` remain unsupported |
131
131
  | Textures (`Texture`, `RawTexture`, `RawTexture2DArray`, `RawTexture3D`, `DynamicTexture`, `HtmlTexture`, `CubeTexture`, `HDRCubeTexture`) | ⚡ | `HDRCubeTexture` routes to native `loadHdrEnvironment`; `RawTexture2DArray` supports raw bytes, image sources/URLs, and single-file KTX2 arrays; `HtmlTexture` forwards native Lite DOM capture/update; `RenderTargetTexture` / `MirrorTexture` unsupported |
132
- | Animation (keyframe `Animation`, easing, `Animatable`, `AnimationGroup` incl. weighted/additive blend) | ⚡ | All standard easing classes, including `PowerEase` / `BezierCurveEase`, reuse Lite's native functional curves; `beginAnimation` / `beginDirectAnimation` delegate supported float/vector/quaternion tracks to Lite property animation; unsupported tracks use an explicit compat evaluator; structural groups remain compat-owned; loaded glTF skeletal blending supported |
132
+ | Animation (keyframe `Animation`, easing, `Animatable`, `AnimationGroup` incl. weighted/additive blend) | ⚡ | All standard easing classes, including `PowerEase` / `BezierCurveEase`, reuse Lite's native functional curves; `beginAnimation` / `beginDirectAnimation` delegate supported float/vector/quaternion tracks to Lite property animation; unsupported tracks use an explicit compat evaluator; structural groups remain compat-owned; loaded glTF skeletal blending supported; root-motion analysis/controller APIs throw |
133
133
  | Morph targets (`MorphTarget` / `MorphTargetManager`) | ✅ | over Lite morph targets |
134
134
  | Sprites (`SpriteManager` / `Sprite`) | ⚡ | camera-facing billboards; `SpriteMap` / packed atlas unsupported |
135
135
  | Behaviors / Actions (`AutoRotation`, `Framing`, `ActionManager`, conditions) | ⚡ | `ActionManager` is manual-dispatch; drag / six-DoF / XR-oriented mesh behaviors throw |
@@ -141,16 +141,16 @@ overloads within a supported area may still be absent.
141
141
 
142
142
  ### `@babylonjs/loaders`
143
143
 
144
- | Feature area | Status | Notes |
145
- | ---------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
146
- | glTF 2.0 (+ extensions), `.babylon` | ✅ | via Lite `loadGltf` / `loadBabylon`; KHR_interactivity assets run through Lite's native flow-graph runtime |
147
- | `GLTF2.KHR_interactivity` public helpers | ⚡ | pure operation/data normalization and exporter data types are implemented; BJS FlowGraph registry/parser/export planning throws with named structural blockers |
148
- | glTF 1.0 loader and extensions | ❌ | named `GLTF1` stubs throw; Lite has no legacy parser, extension registry, or material-conversion subsystem |
149
- | OpenPBR glTF material adapter | ❌ | exported at root and under `GLTF2`; throws because Lite has no OpenPBR material subsystem |
150
- | OpenUSD (`USDFileLoader`) | ❌ | named stub; requires a WebAssembly worker and a USD-to-Lite scene/material materializer |
151
- | `SceneLoader` (`ImportMeshAsync` / `AppendAsync` / `LoadAssetContainerAsync`), `AssetsManager` | ⚡ | `AssetContainer` partial |
152
- | Gaussian Splatting (`.ply` / `.splat` / `.sog` / `.spz`) | ⚡ | via `GaussianSplattingMesh`; LOD-streaming + glTF-embedded (`KHR_gaussian_splatting`) variants unsupported |
153
- | `OBJ` / `STL` / `FBX` / `BVH` | ❌ | parser/materializer subsystems are not in Lite — convert to glTF |
144
+ | Feature area | Status | Notes |
145
+ | ---------------------------------------------------------------------------------------------- | :----: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
146
+ | glTF 2.0 (+ extensions), `.babylon` | ✅ | via Lite `loadGltf` / `loadBabylon`; KHR_interactivity assets run through Lite's native flow-graph runtime |
147
+ | `GLTF2.KHR_interactivity` public helpers | ⚡ | pure operation/data normalization and exporter data types are implemented; BJS FlowGraph registry/parser/export planning throws with named structural blockers |
148
+ | glTF 1.0 loader and extensions | ❌ | named `GLTF1` stubs throw; Lite has no legacy parser, extension registry, or material-conversion subsystem |
149
+ | OpenPBR glTF material adapter | ❌ | exported at root and under `GLTF2`; throws because Lite has no OpenPBR material subsystem |
150
+ | OpenUSD (`USDFileLoader`) | ⚡ | delegates binary import, virtual files, callbacks, diagnostics, asset containers, and disposal to Lite; all four custom runtime assets must share one directory |
151
+ | `SceneLoader` (`ImportMeshAsync` / `AppendAsync` / `LoadAssetContainerAsync`), `AssetsManager` | ⚡ | `AssetContainer` partial |
152
+ | Gaussian Splatting (`.ply` / `.splat` / `.sog` / `.spz`) | ⚡ | via `GaussianSplattingMesh` and the binary-data `SPLATFileLoader` plugin surface; detached containers, unpackaged/streaming SOG, replaceable decoder policies, and full glTF-embedded (`KHR_gaussian_splatting`) variants remain unsupported |
153
+ | `OBJ` / `STL` / `FBX` / `BVH` | ❌ | parser/materializer subsystems are not in Lite — convert to glTF |
154
154
 
155
155
  ### `@babylonjs/addons` · `@recast-navigation/*`
156
156
 
package/index.d.ts CHANGED
@@ -22,6 +22,8 @@ import { StorageBuffer as StorageBuffer_2 } from '@babylonjs/lite';
22
22
  import { Texture2D } from '@babylonjs/lite';
23
23
  import { Texture2DArray } from '@babylonjs/lite';
24
24
  import { UniformBuffer as UniformBuffer_2 } from '@babylonjs/lite';
25
+ import { UsdDiagnostics } from '@babylonjs/lite';
26
+ import { UsdProgress } from '@babylonjs/lite';
25
27
 
26
28
  /** Base class for an asset-loading task. Subclasses implement {@link runAsync}. */
27
29
  export declare abstract class AbstractAssetTask {
@@ -826,7 +828,9 @@ export declare class ArcRotateCamera extends Camera {
826
828
  constructor(name: stri
827
829
  set panningSensibility(value: number);
828
830
  attachControl(canvas: HTMLCanvasElement, noPreventDefault?: boolean): void;
829
831
 
830
- export declare class AssetContainer {
831
832
  constructor(lite: AssetContainer_2);
833
+ export declare class AssetContainer {
832
834
  private readonly _dispose;
833
835
  private _sceneDisposeObserver;
836
+ private _disposed;
837
+ constructor(lite: AssetContainer_2, dispose?: () => void, ownedMeshes?: readonly Mesh_2[]);
834
838
  get animationGroups(): AnimationGroup_2[];
835
839
  /**
836
840
  * Flat list of the loaded meshes as canonical, stable-identity compat `Mesh`
@@ -837,8 +841,10 @@ export declare class AssetContainer {
837
841
  constructor(lite: AssetContainer_2);
838
842
  get meshes(): Mesh[];
839
843
  get skeletons(): Skeleton[];
840
844
  /** Add every entity, animation group, camera, and clear colour to the scene. */
841
- addAllToScene(scene: Scene): void;
842
- dispose(): void;
845
+ addAllToScene(scene: Scene): void;
843
846
  dispose(): void;
847
+ private _detachFromScene;
848
+ private _retireMeshWrappers;
849
+ private _disposeOnce;
844
850
  }
845
851
 
846
852
  export declare class AssetsManager {
@@ -3031,6 +3037,22 @@ export declare interface IRaycastQuery {
3031
3037
  ignoreBody?: PhysicsBody;
3032
3038
  }
3033
3039
 
3040
+ export declare interface IRootMotionClipOptions {
3041
+ rootNode?: TransformNode | Bone;
3042
+ characterNode?: TransformNode;
3043
+ contactNodes?: Array<TransformNode | Bone>;
3044
+ source?: RootMotionSource;
3045
+ extractRotation?: boolean;
3046
+ samplesPerSecond?: number;
3047
+ minimumTravel?: number;
3048
+ minimumTurn?: number;
3049
+ directionSnapAngle?: number;
3050
+ extractLateralMotion?: boolean;
3051
+ upAxis?: Vector3;
3052
+ name?: string;
3053
+ cloneAnimations?: boolean;
3054
+ }
3055
+
3034
3056
  /**
3035
3057
  * Babylon.js `ISafeOrbitCameraLimits` — safe-orbit camera limits embedded in a Gaussian
3036
3058
  * Splatting file's metadata (Adobe safe-orbit extension). Exposed on the loaded mesh via
@@ -3053,6 +3075,8 @@ export declare interface ISceneLoaderOptions {
3053
3075
  preprocessUrlAsync?: (url: string) => Promise<string>;
3054
3076
  [option: string]: unknown;
3055
3077
  };
3078
+ splat?: Partial<Readonly<SPLATLoadingOptions>>;
3079
+ usd?: Partial<USDFileLoaderOptions>;
3056
3080
  };
3057
3081
  }
3058
3082
 
@@ -3918,8 +3942,7 @@ export declare class Observable<T> {
3918
3942
  addOnce(callback: ObserverCallback<T>, mask?: number): ObserverCallback<T>;
3919
3943
  remove(callback: ObserverCallback<T> | null | undefined): boolean;
3920
3944
  removeCallback(callback: ObserverCallback<T>): boolean;
3921
- notifyObservers(eventData?: T, mask?: number): void;
3922
- hasObservers(): boolean;
3945
+ notifyObservers(eventData?: T, mask?: number): void;
3923
3946
  hasObservers(): boolean;
3924
3947
  clear(): void;
3925
3948
  cleanLastNotifiedState(): void;
3926
3949
  }
@@ -4972,13 +4995,60 @@ export declare function RegisterMeshBlendingPostProcessBlock(): never;
4972
4995
 
4973
4996
  export declare function RegisterOpenpbrMaterial(): void;
4974
4997
 
4975
- export declare function RegisterUSDFileLoader(): never;
4998
+ export declare function RegisterSPLATFileLoader(): void;
4999
+
5000
+ export declare function RegisterUSDFileLoader(): void;
4976
5001
 
4977
5002
  /** Babylon.js `RenderTargetTexture` — offscreen render target. Use the native frame-graph RTT APIs. */
4978
5003
  export declare class RenderTargetTexture {
4979
5004
  constructor();
4980
5005
  }
4981
5006
 
5007
+ export declare class RootMotionClip {
5008
+ constructor(_animationGroup: AnimationGroup, _options?: IRootMotionClipOptions);
5009
+ get sourceAnimationGroup(): AnimationGroup;
5010
+ get animationGroup(): AnimationGroup;
5011
+ get controller(): RootMotionController | null;
5012
+ get source(): RootMotionSource;
5013
+ get rootNode(): TransformNode | null;
5014
+ get characterNode(): TransformNode;
5015
+ get contactNodes(): ReadonlyArray<TransformNode>;
5016
+ get upAxis(): Vector3;
5017
+ get fromFrame(): number;
5018
+ get toFrame(): number;
5019
+ get travelDirection(): Vector3;
5020
+ get cycleOffset(): Vector3;
5021
+ get cycleDistance(): number;
5022
+ get cycleRotation(): number;
5023
+ get extractsRotation(): boolean;
5024
+ get duration(): number;
5025
+ get averageSpeed(): number;
5026
+ get characterHeight(): number;
5027
+ getOffsetAtFrame(_frame: number, _result: Vector3): Vector3;
5028
+ getRotationAtFrame(_frame: number): number;
5029
+ dispose(): void;
5030
+ }
5031
+
5032
+ export declare class RootMotionController {
5033
+ applyToCharacter: boolean;
5034
+ readonly onRootMotionObservable: Observable<RootMotionController>;
5035
+ constructor(_characterNode: TransformNode, _clips?: RootMotionClip[]);
5036
+ get characterNode(): TransformNode;
5037
+ get clips(): ReadonlyArray<RootMotionClip>;
5038
+ get deltaPosition(): Vector3;
5039
+ get deltaRotation(): number;
5040
+ addClip(_clip: RootMotionClip): void;
5041
+ removeClip(_clip: RootMotionClip): void;
5042
+ reset(): void;
5043
+ dispose(): void;
5044
+ }
5045
+
5046
+ export declare enum RootMotionSource {
5047
+ None = 0,
5048
+ Root = 1,
5049
+ FootContact = 2
5050
+ }
5051
+
4982
5052
  export declare class RotationGizmo extends GizmoBase {
4983
5053
  private _attached;
4984
5054
  private _xGizmo;
4985
5055
  private _yGizmo;
@@ -5532,6 +5602,60 @@ export declare class Spherical {
5532
5602
  static FromArray(array: number[]): Spherical;
5533
5603
  }
5534
5604
 
5605
+ export declare class SPLATFileLoader {
5606
+ readonly name = "splat";
5607
+ readonly extensions: {
5608
+ readonly ".splat": {
5609
+ readonly isBinary: true;
5610
+ };
5611
+ readonly ".ply": {
5612
+ readonly isBinary: true;
5613
+ };
5614
+ readonly ".spz": {
5615
+ readonly isBinary: true;
5616
+ };
5617
+ readonly ".json": {
5618
+ readonly isBinary: false;
5619
+ };
5620
+ readonly ".sog": {
5621
+ readonly isBinary: true;
5622
+ };
5623
+ };
5624
+ private readonly _loadingOptions;
5625
+ constructor(loadingOptions?: Partial<Readonly<SPLATLoadingOptions>>);
5626
+ createPlugin(options: {
5627
+ splat?: Partial<Readonly<SPLATLoadingOptions>>;
5628
+ }): SPLATFileLoader;
5629
+ importMeshAsync(_meshesNames: unknown, scene: Scene, data: unknown, _rootUrl: string, _onProgress?: (event: ISceneLoaderProgressEvent) => void, _fileName?: string): Promise<SPLATImportResult>;
5630
+ loadAsync(scene: Scene, data: unknown, rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
5631
+ loadAssetContainerAsync(_scene: Scene, _data: string, _rootUrl: string): Promise<AssetContainer>;
5535
5632
  private _load;
5633
+ private _loadReserved;
5634
+ private _adoptLoaded;
5635
+ }
5636
+
5637
+ declare interface SPLATImportResult {
5638
+ meshes: GaussianSplattingMesh[];
5639
+ particleSystems: unknown[];
5640
+ skeletons: unknown[];
5641
+ animationGroups: unknown[];
5642
+ transformNodes: unknown[];
5643
+ geometries: unknown[];
5644
+ lights: unknown[];
5645
+ spriteManagers: unknown[];
5646
+ }
5647
+
5648
+ export declare type SPLATLoadingOptions = {
5649
+ keepInRam?: boolean;
5650
+ flipY?: boolean;
5651
+ deflateURL?: string;
5652
+ fflate?: unknown;
5653
+ disableAutoCameraLimits?: boolean;
5654
+ gaussianSplattingMesh?: GaussianSplattingMesh;
5655
+ needsRotationScaleTextures?: boolean;
5656
+ useSogTextures?: boolean;
5657
+ spzLibraryUrl?: string;
5658
+ };
5659
+
5536
5660
  export declare class SpotLight extends Light {
5537
5661
  constructor(name: string, position: Vector3, direction: Vector3, angle: number, exponent: number, scene?: Scene);
5538
5662
  getClassName(): string;
5539
5663
  get angle(): number;
@@ -6154,7 +6278,34 @@ export declare function UploadImageToTexture2DArrayLayer(texture: RawTexture2DAr
6154
6278
  export declare type USDBinaryInput = ArrayBuffer | ArrayBufferView;
6155
6279
 
6156
6280
  export declare class USDFileLoader {
6157
- constructor(_options?: Partial<USDFileLoaderOptions>);
6281
+ static get DefaultConfiguration(): Required<Pick<USDFileLoaderOptions, "workerUrl" | "glueUrl" | "wasmUrl" | "dataUrl">>;
6282
+ static set DefaultConfiguration(configuration: Required<Pick<USDFileLoaderOptions, "workerUrl" | "glueUrl" | "wasmUrl" | "dataUrl">>);
6283
+ readonly name = "usd";
6284
+ readonly extensions: {
6285
+ readonly ".usd": {
6286
+ readonly isBinary: true;
6287
+ };
6288
+ readonly ".usda": {
6289
+ readonly isBinary: true;
6290
+ };
6291
+ readonly ".usdc": {
6292
+ readonly isBinary: true;
6293
+ };
6294
+ readonly ".usdz": {
6295
+ readonly isBinary: true;
6296
+ };
6297
+ };
6298
+ private readonly _options;
6299
+ private readonly _activeLoads;
6300
+ constructor(options?: Partial<USDFileLoaderOptions>);
6301
+ createPlugin(options: {
6302
+ usd?: Partial<USDFileLoaderOptions>;
6303
+ }): USDFileLoader;
6304
+ importMeshAsync(_meshNames: string | readonly string[] | null | undefined, scene: Scene, data: unknown, _rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<USDImportResult>;
6305
+ loadAsync(scene: Scene, data: unknown, _rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<void>;
6306
+ loadAssetContainerAsync(scene: Scene, data: unknown, _rootUrl: string, onProgress?: (event: ISceneLoaderProgressEvent) => void, fileName?: string): Promise<AssetContainer>;
6307
+ dispose(): void;
6308
+ private _load;
6158
6309
  }
6159
6310
 
6160
6311
  export declare interface USDFileLoaderOptions {
@@ -6170,38 +6321,24 @@ export declare interface USDFileLoaderOptions {
6170
6321
  onComplete?: (diagnostics: USDImportDiagnostics) => void;
6171
6322
  }
6172
6323
 
6173
- export declare interface USDImportDiagnostics {
6174
- timings: USDImportTimings;
6175
- statistics: USDImportStatistics;
6176
- missingAssets: readonly string[];
6177
- }
6324
+ export declare type USDImportDiagnostics = UsdDiagnostics;
6178
6325
 
6179
- export declare interface USDImportStatistics {
6180
- nodes: number;
6181
- meshes: number;
6182
- analyticPrimitives: number;
6183
- instances: number;
6184
- materials: number;
6185
- vertices: number;
6186
- triangles: number;
6187
- commandBytes: number;
6188
- dataBytes: number;
6326
+ declare interface USDImportResult {
6327
+ meshes: Mesh[];
6328
+ particleSystems: unknown[];
6329
+ skeletons: Skeleton[];
6330
+ animationGroups: AnimationGroup_2[];
6331
+ transformNodes: unknown[];
6332
+ lights: unknown[];
6189
6333
  }
6190
6334
 
6191
- export declare interface USDImportTimings {
6192
- totalMs: number;
6193
- stageOpenMs: number;
6194
- stageReadMs: number;
6195
- preparationMs: number;
6196
- packingMs: number;
6197
- heapCopyMs: number;
6198
- materializeMs: number;
6199
- }
6335
+ export declare type USDImportStatistics = UsdDiagnostics["statistics"];
6200
6336
 
6201
- export declare interface USDLoadProgress {
6202
- phase: "initializing" | "staging" | "extracting" | "materializing";
6203
- message: string;
6204
- }
6337
+ export declare type USDImportTimings = UsdDiagnostics["timings"];
6338
+
6339
+ export declare type USDLoadProgress = Omit<UsdProgress, "phase"> & {
6340
+ phase: Exclude<UsdProgress["phase"], "fetching">;
6341
+ };
6205
6342
 
6206
6343
  export declare type USDVirtualFiles = Readonly<Record<string, USDBinaryInput>>;
6207
6344