@babylonjs/lite-compat 1.38.2-preview → 1.39.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/navigation.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { AnisotropyProps } from '@babylonjs/lite';
2
2
  import { ClearCoatProps } from '@babylonjs/lite';
3
+ import { EngineContext } from '@babylonjs/lite';
3
4
  import { EngineOptions } from '@babylonjs/lite';
4
5
  import { IridescenceProps } from '@babylonjs/lite';
5
6
  import { LineMaterial } from '@babylonjs/lite';
@@ -494,6 +495,19 @@ declare abstract class BaseTexture {
494
495
  dispose(): void;
495
496
  }
496
497
 
498
+ declare class Bone {
499
+ private _enabled;
500
+ readonly name: string;
501
+ readonly parent: Bone | null;
497
502
  constructor(_name?: string, _skeleton?: Skeleton);
498
503
  getName(): string;
504
+ getSkeleton(): Skeleton;
505
+ setPosition(position: Vector3, space?: number): this;
506
+ setRotationQuaternion(rotation: Quaternion, space?: number): this;
507
+ setScale(scale: Vector3): this;
508
+ setEnabled(value: boolean): void;
509
+ isEnabled(): boolean;
510
+ returnToRest(): void;
511
+ }
512
+
499
513
  declare class BoundingBox {
500
514
  readonly minimum: Vector3;
501
515
  readonly maximum: Vector3;
@@ -560,6 +574,12 @@ declare abstract class Camera extends Node_2 {
560
574
  private _orthoTop;
561
575
  protected constructor(name: string, scene?: Scene);
562
576
  getClassName(): string;
577
+ /**
578
+ * Babylon.js `Camera.resetViewHistory()` invalidates temporal history owned by
579
+ * every render pass using this camera. Lite's TAA/history state is owned by
580
+ * independently-created frame-graph tasks, with no camera-to-task registry.
581
+ */
582
+ resetViewHistory(): never;
563
583
  get fov(): number;
564
584
  set fov(value: number);
565
585
  get minZ(): number;
@@ -1118,6 +1138,8 @@ declare class Matrix {
1118
1138
  declare class Mesh_2 extends AbstractMesh {
1119
1139
  constructor(name: string, sceneOrLite?: Scene | Mesh, scene?: Scene);
1120
1140
  getClassName(): string;
1121
1141
  private _morphTargetManager;
1142
+ private readonly _ownedMorphTargetManagers;
1143
+ private _retainMorphTargetManagerOwnership;
1122
1144
  /**
1123
1145
  * Babylon.js `mesh.morphTargetManager`. Babylon Lite builds morph GPU data via
1124
1146
  * `createMorphTargets` and stores it on the Lite mesh; the compat manager is
@@ -1125,8 +1147,7 @@ declare class Mesh_2 extends AbstractMesh {
1125
1147
  * CPU geometry exists) and assigns it onto the Lite mesh before registration.
1126
1148
  */
1127
1149
  get morphTargetManager(): MorphTargetManager | null;
1128
- set morphTargetManager(value: MorphTargetManager | null);
1129
- /** Legacy `Mesh.CreateSphere(name, segments, diameter, scene)`. */
1150
+ set morphTargetManager(value: MorphTargetManager | null);
1130
1151
  /** Legacy `Mesh.CreateSphere(name, segments, diameter, scene)`. */
1131
1152
  static CreateSphere(name: string, segments: number, diameter: number, scene: Scene): Mesh_2;
1132
1153
  /** Legacy `Mesh.CreateBox(name, size, scene)`. */
1133
1154
  static CreateBox(name: string, size: number, scene: Scene): Mesh_2;
@@ -1204,16 +1225,16 @@ declare class MorphTarget {
1204
1225
  /** Babylon.js `MorphTarget.setNormals(data)` — absolute target normals. */
1205
1226
  setNormals(data: Float32Array | number[] | null): void;
1206
1227
  /** Babylon.js `MorphTarget.getNormals()`. */
1207
- getNormals(): Float32Array | null;
1208
- }
1228
+ getNormals(): Float32Array | null;
1209
1229
 
1210
1230
  /** Babylon.js `MorphTargetManager` — owns a mesh's morph targets (Babylon Lite supports up to 4). */
1211
1231
  declare class MorphTargetManager {
1212
1232
  private readonly _targets;
1213
- constructor(_scene?: Scene);
1214
- get numTargets(): number;
1233
+ constructor(_scene?: Scene);
1215
1234
  get numTargets(): number;
1216
1235
  getTarget(index: number): MorphTarget;
1217
1236
  /** Babylon.js `MorphTargetManager.addTarget(target)`. */
1218
- addTarget(target: MorphTarget): void;
1237
+ addTarget(target: MorphTarget): void;
1219
1238
  /** Babylon.js `MorphTargetManager.dispose()` — release this manager's morph-resource claim. */
1239
+ dispose(): void;
1240
+ }
1220
1241
 
1221
1242
  /**
1222
1243
  * Result of {@link RecastNavigationJSPluginV2.createNavMesh}. Babylon.js's
@@ -1332,6 +1353,74 @@ declare class Observable<T> {
1332
1353
  */
1333
1354
  declare type ObserverCallback<T> = (eventData: T) => void;
1334
1355
 
1356
+ /**
1357
+ * Babylon.js `ParticleSystem` — the built output of one NPE graph system. Backed
1358
+ * by a Lite `ParticleSystem`; the deterministic prewarm-and-freeze pattern used by
1359
+ * ported parity scenes (seed RNG → `start()` → N × `animate()` → `updateSpeed = 0`)
1360
+ * maps directly onto Lite's `startParticleSystem` / `animateParticleSystem`, with a
1361
+ * camera-facing billboard built and synced once the scene starts.
1362
+ */
1363
+ declare class ParticleSystem {
1364
+ name: string;
1335
1365
  /**
1366
+ * Babylon.js `ParticleSystem.preWarmStepOffset` — the step ratio applied during
1367
+ * prewarm cycles. Multiplies {@link updateSpeed} on every `animate(true)` call,
1368
+ * matching Babylon.js (which uses `updateSpeed * preWarmStepOffset` while
1369
+ * prewarming and the regular animation ratio otherwise).
1370
+ */
1371
+ preWarmStepOffset: number;
1372
+ private _texture;
1373
+ private _billboardScheduled;
1374
+ private _billboardOwnedBySet;
1375
+ private _started;
1376
+ /**
1377
+ * Babylon.js `new ParticleSystem(name, capacity, scene)`. The imperative
1378
+ * construction API (emitters, over-lifetime gradients, `minEmitBox`, a
1379
+ * GPU-compute path) is not backed: Babylon Lite builds particle systems only
1380
+ * from a serialized Node Particle Editor graph. Load a graph via
1381
+ * `NodeParticleSystemSet.Parse` / `ParseFromSnippetAsync` → `buildAsync` and read
1382
+ * its {@link ParticleSystemSet.systems} instead.
1383
+ */
1384
+ constructor();
1336
1385
  getClassName(): string;
1386
+ /** Babylon.js `ParticleSystem.updateSpeed` — simulation advance per frame. Proxies the Lite system. */
1387
+ get updateSpeed(): number;
1388
+ set updateSpeed(value: number);
1389
+ /**
1390
+ * Babylon.js `ParticleSystem.particleTexture` — the sprite texture. Recorded and
1391
+ * bound onto the Lite system when the billboard is built at engine start (the
1392
+ * compat `Texture` loads asynchronously, so its GPU handle is read after the
1393
+ * scene's pending texture loads settle).
1394
+ */
1395
+ get particleTexture(): Texture | null;
1396
+ set particleTexture(value: Texture | null);
1397
+ /**
1398
+ * Babylon.js `ParticleSystem.start()` — begin emission. Forwards to Lite
1399
+ * `startParticleSystem` (which clears the stopped flag and resets the frame
1400
+ * counter, so `start()` → `stop()` → `start()` resumes emission) and schedules
1401
+ * the camera-facing billboard build for engine start. The billboard build is
1402
+ * separately guarded, so it happens exactly once however often `start()` runs.
1403
+ */
1404
+ start(): void;
1405
+ /**
1406
+ * Babylon.js `ParticleSystem.animate(preWarmOnly?)` — advance the simulation by
1407
+ * one deterministic step. Forwards to Lite `animateParticleSystem` with Babylon.js's
1408
+ * step ratio: {@link preWarmStepOffset} while prewarming, otherwise the ratio `1`
1409
+ * used by the parity ports' seeded step loop.
1410
+ */
1411
+ animate(preWarmOnly?: boolean): void;
1412
+ /** Babylon.js `ParticleSystem.stop()` — stop emission; live particles drain. Forwards to Lite `stopParticleSystem`. */
1413
+ stop(): void;
1414
+ /** Babylon.js `ParticleSystem.isStarted()` — whether the system is currently emitting. */
1415
+ isStarted(): boolean;
1416
+ /** Babylon.js `ParticleSystem.dispose()` — stop the system. */
1417
+ dispose(): void;
1337
1418
  /**
1419
+ * Schedule the one-time billboard build. Deferred to engine start (via the
1420
+ * scene's `_deferAdd`, which runs after pending texture loads settle), so the
1421
+ * particle system is already prewarmed/frozen and its texture GPU handle is
1422
+ * ready. Mirrors the native Lite port's build → sync → add sequence.
1423
+ */
1424
+ private _scheduleBillboard;
1425
+ }
1426
+
1338
1427
  /** Babylon.js `PBRAnisotropicConfiguration` — the `pbr.anisotropy` sub-object over Lite `AnisotropyProps`. */
1339
1428
  declare class PBRAnisotropicConfiguration {
1340
1429
  private readonly _props;
@@ -1882,6 +1971,10 @@ declare class Scene extends AbstractScene {
1882
1971
  /** Babylon.js fog-mode constant
1883
1972
  /** Babylon.js `scene.getAnimationGroupByName(name)` — first loaded animation group with a matching name, else `null`. */
1884
1973
  getAnimationGroupByName(name: string): AnimationGroup | null;
1885
1974
  get animatables(): Animatable_2[];
1975
+ /** Babylon.js `scene.skeletons` — loader-produced skeletons currently used by scene meshes. */
1976
+ get skeletons(): Skeleton[];
1977
+ /** Babylon.js `scene.particleSystems` — registered Lite node-particle systems in scene order. */
1978
+ get particleSystems(): ParticleSystem[];
1886
1979
  private readonly _engine;
1887
1980
  private _activeCamera;
1888
1981
  cameraToUseForPointers: Camera | null;
@@ -1903,9 +1996,16 @@ declare class Scene extends AbstractScene {
1903
1996
  /** Babylon.js fog-mode constant
1904
1997
  private readonly _pendingTextures;
1905
1998
  private readonly _pendingGroundBakes;
1906
1999
  private readonly _pendingMorphBuilds;
2000
+ private readonly _ownedMorphTargetManagers;
1907
2001
  private _materialPluginsRequested;
1908
2002
  private readonly _pendingMaterialPluginReconciliations;
1909
- private readonly _runningAnimatables;
1910
2003
  private readonly _animationGroupCache;
1911
2004
  private _ambientColor;
2005
+ private readonly _runningAnimatables;
1912
2006
  private readonly _animationGroupCache;
2007
+ private readonly _skeletonCache;
2008
+ private readonly _skeletons;
2009
+ private readonly _particleSystemCache;
2010
+ private readonly _particleSystems;
2011
+ private readonly _retiredParticleSystems;
2012
+ private _disposed;
1913
2013
  private _ambientColor;
1914
2014
  private _environmentIntensity;
1915
2015
  private _imageProcessingConfiguration;
1916
2016
  /** Babylon.js `scene.uniqueId` — a process-unique numeric id. */
1917
2017
  readonly uniqueId: number;
@@ -2105,6 +2205,17 @@ declare enum ShaderLanguage {
2105
2205
  WGSL = 1
2106
2206
  }
2107
2207
 
2208
+ declare class Skeleton {
2209
+ readonly name: string;
2210
+ readonly id: string;
2211
+ readonly bones: Bone[];
2108
2212
  constructor(_name?: string, _id?: string, _scene?: Scene);
2109
2213
  getBoneIndexByName(name: string): number;
2214
+ getBoneByName(name: string): Bone | null;
2215
+ /** Babylon.js `Skeleton.returnToRest()` — clear every compat bone override. */
2216
+ returnToRest(): void;
2217
+ /** Babylon.js `Skeleton.prepare()` — Lite keeps loaded/evaluated bone matrices ready, so no additional bake is needed. */
2218
+ prepare(_dontCheckFrameId?: boolean): void;
2219
+ }
2220
+
2110
2221
  /**
2111
2222
  * Babylon.js-compatible Misc utilities — the pure-JS subset that has no Babylon
2112
2223
  * Lite or GPU dependency: `SmartArray`, `StringDictionary`, `Tags`,
@@ -2183,6 +2294,47 @@ declare class StandardMaterial extends PushMaterial {
2183
2294
  /** Diffuse colour as
2184
2295
  clone(name: string): StandardMaterial;
2185
2296
  }
2186
2297
 
2298
+ declare class Texture extends BaseTexture {
2299
+ private readonly _ready;
2300
+ private _onLoadObservable;
2301
+ /** Babylon.js sampling-mode constants (numeric parity). */
2302
+ static readonly NEAREST_SAMPLINGMODE = 1;
2303
+ static readonly BILINEAR_SAMPLINGMODE = 2;
2304
+ static readonly TRILINEAR_SAMPLINGMODE = 3;
2305
+ static readonly NEAREST_NEAREST = 8;
2306
+ static readonly LINEAR_LINEAR = 11;
2307
+ /** Babylon.js coordinate-mode constants (numeric parity). */
2308
+ static readonly CLAMP_ADDRESSMODE = 0;
2309
+ static readonly WRAP_ADDRESSMODE = 1;
2310
+ static readonly MIRROR_ADDRESSMODE = 2;
2311
+ /** Babylon.js texture UV tiling (applied to the Lite material at bind time). */
2312
+ uScale: number;
2313
+ vScale: number;
2314
+ uOffset: number;
2315
+ vOffset: number;
2316
+ hasAlpha: boolean;
2317
+ coordinatesIndex: number;
2318
+ /** Babylon.js sampling mode passed at construction (`NEAREST_SAMPLINGMODE` = 1, etc.). */
2319
+ readonly samplingMode: number;
2187
2320
  constructor(url: string, sceneOrEngine: Scene | {
2321
+ _lite: EngineContext;
2322
+ }, noMipmapOrOptions?: unknown, invertY?: boolean, _samplingMode?: number, onLoad?: (() => void) | null);
2188
2323
  private readonly _noMipmap;
2324
+ getClassName(): string;
2325
+ /**
2326
+ * Babylon.js `texture.clone()` — a new `Texture` over the same source URL.
2327
+ * UV tiling/offset and sampling are copied; the clone re-resolves the GPU
2328
+ * handle (tracked against the same scene so it is ready at build).
2329
+ */
2330
+ clone(): Texture;
2331
+ whenReadyAsync(): Promise<void>;
2332
+ /** Babylon.js `Texture.onLoadObservable`, allocated only when code subscribes. */
2333
+ get onLoadObservable(): Observable<Texture>;
2334
+ private _notifyLoadObservable;
2335
+ /** Babylon.js `BaseTexture.isReady()` — true once the GPU handle has resolved. */
2336
+ isReady(): boolean;
2337
+ /** Load a texture and resolve once its GPU handle is available. */
2338
+ static LoadAsync(url: string, scene: Scene): Promise<Texture>;
2339
+ }
2340
+
2189
2341
  declare interface TextureLike {
2190
2342
  _lite?: Texture2D;
2191
2343
  whenReadyAsync?(): Promise<void>;
@@ -2193,22 +2345,29 @@ declare interface TextureLike {
2193
2345
  * Wraps a Lite scene node (`_node`): either a standalone Lite transform node, or
2194
2346
  * (for meshes) the Lite mesh itself, which also carries the transform.
2195
2347
  */
2196
- declare class TransformNode extends Node_2 {
2197
2348
  physicsBody: PhysicsBody | null;
2198
2349
  constructor(name: string, scene?: Scene, liteNode?: SceneNode);
2350
+ declare class TransformNode extends Node_2 {
2199
2351
  physicsBody: PhysicsBody | null;
2352
+ private _rotation;
2353
+ private _rotationBinding;
2354
+ private _rotationQuaternion;
2355
+ private _rotationQuaternionBinding?;
2356
+ private _nativeRotationVersion;
2357
+ private readonly _nativeRotationValues;
2358
+ private _isSyncingRotationFromNative;
2359
+ private _sceneDisposeObserver?;
2200
2360
  constructor(name: string, scene?: Scene, liteNode?: SceneNode);
2201
2361
  getClassName(): string;
2202
2362
  get position(): Vector3;
2203
2363
  set position(value: Vector3);
2204
2364
  get rotation(): Vector3;
2205
2365
  set rotation(value: Vector3);
2206
2366
  get scaling(): Vector3;
2207
- set scaling(value: Vector3);
2208
2367
  /**
2209
- * Babylon.js `rotationQuaternion`. Babylon Lite always drives a node's world
2210
- * matrix from a quaternion (its euler `rotation` is a proxy over the same
2211
- * quaternion), so this reads/writes that quaternion. Returns `null` until
2212
- * explicitly assigned, matching Babylon.js's euler-by-default convention.
2213
- */
2368
+ set scaling(value: Vector3);
2369
+ /** Babylon.js `rotationQuaternion`, kept live while Lite receives translated component writes. */
2214
2370
  get rotationQuaternion(): Quaternion | null;
2215
2371
  set rotationQuaternion(value: Quaternion | null);
2216
- /**
2372
+ private _applyEulerRotation;
2373
+ private _applyQuaternionRotation;
2374
+ private _markNativeRotationSynced;
2375
+ private _syncRotationFromNative;
2217
2376
  /**
2218
2377
  * Babylon.js `getChildTransformNodes(directDescendantsOnly?, predicate?)` — the descendants that are transform nodes
2219
2378
  * (meshes included). As in Babylon.js, `predicate` is called on every evaluated descendant.
2220
2379
  */
@@ -2219,7 +2378,9 @@ declare class TransformNode extends Node_2 {
2219
2378
  physicsBody: PhysicsBody | null
2220
2379
  * setter, which keeps the local transform and lets the world move.
2221
2380
  */
2222
2381
  setParent(parent: Node_2 | null): TransformNode;
2223
- protected _applyParent(parent: Node_2 | null): void;
2382
+ protected _applyParent(parent: Node_2 | null): void;
2224
2383
  private _bindRotationSceneDisposal;
2384
+ protected _retireFromScene(): void;
2385
+ }
2225
2386
 
2226
2387
  declare type TrianglePickingPredicate = (p0: Vector3, p1: Vector3, p2: Vector3, ray: Ray, i0: number, i1: number, i2: number) => boolean;
2227
2388
 
package/navigation.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as registerMeshAtStart, Q as Vector3, b as Mesh } from "./meshes-Bt_UAqXU.js";
1
+ import { D as registerMeshAtStart, b as Mesh, et as Vector3 } from "./meshes-C-PkzbPM.js";
2
2
  import { addAgent, addBoxObstacle, addCylinderObstacle, agentGoto, computePath, createDebugNavMeshGeometry, createMeshFromData, createNavCrowd, createNavMesh, createNavigationPluginAsync, getAgentPosition, getClosestPoint, raycast, removeObstacle, updateNavCrowd, updateNavMeshObstacles } from "@babylonjs/lite";
3
3
  // src/navigation/navigation.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/lite-compat",
3
- "version": "1.38.2-preview",
3
+ "version": "1.39.0-preview",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Opt-in Babylon.js-shaped compatibility layer implemented on top of the Babylon Lite public API. Provides a migration runway from Babylon.js to Babylon Lite.",
@@ -47,8 +47,8 @@
47
47
  }
48
48
  },
49
49
  "babylonLiteRelease": {
50
- "azureBuildId": "62175",
51
- "sourceVersion": "bc317f91a55b2af616abf487812ac6d4888151f7",
52
- "builtAgainstLite": "1.38.2"
50
+ "azureBuildId": "62229",
51
+ "sourceVersion": "2dddc888f6695e433ab29ae5918bee221375d86f",
52
+ "builtAgainstLite": "1.39.0"
53
53
  }
54
54
  }