@babylonjs/lite-compat 1.28.0-preview → 1.29.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
@@ -227,7 +227,6 @@ declare class AbstractMesh extends TransformNode {
227
227
  private _material;
228
228
  * reset: the supplied matrix is independent of the node transform.
229
229
  */
230
230
  bakeTransformIntoVertices(transform: Matrix): this;
231
- dispose(): void;
232
231
  }
233
232
 
234
233
  declare abstract class AbstractScene {
235
234
  /**
@@ -486,7 +485,13 @@ declare class BoundingSphere {
486
485
  }
487
486
 
488
487
  /** Babylon.js `Camera` — base class for all cameras (derives from `Node`). */
489
- declare abstract class Camera extends Node_2 {
490
488
  private _detach;
489
+ declare abstract class Camera extends Node_2 {
490
+ static readonly PERSPECTIVE_CAMERA = 0;
491
+ static readonly ORTHOGRAPHIC_CAMERA = 1;
491
492
  private _detach;
493
+ private _orthoLeft;
494
+ private _orthoRight;
495
+ private _orthoBottom;
496
+ private _orthoTop;
492
497
  protected constructor(name: string, scene?: Scene);
493
498
  getClassName(): string;
494
499
  get fov(): number;
@@ -495,6 +500,18 @@ declare abstract class Camera extends Node_2 {
495
500
  private _detach;
496
501
  set minZ(value: number);
497
502
  get maxZ(): number;
498
503
  set maxZ(value: number);
504
+ get orthoLeft(): number | null;
505
+ set orthoLeft(value: number | null);
506
+ get orthoRight(): number | null;
507
+ set orthoRight(value: number | null);
508
+ get orthoBottom(): number | null;
509
+ set orthoBottom(value: number | null);
510
+ get orthoTop(): number | null;
511
+ set orthoTop(value: number | null);
512
+ get mode(): number;
513
+ set mode(value: number);
514
+ get viewport(): Viewport;
515
+ set viewport(value: Viewport);
499
516
  /** World-space position of the camera. */
500
517
  get globalPosition(): Vector3;
501
518
  /** Babylon.js `camera.getViewMatrix()` — the camera's view matrix. */
@@ -506,6 +523,23 @@ declare abstract class Camera extends Node_2 {
506
523
  private _detach;
507
524
  detachControl(): void;
508
525
  protected _makeActive(scene: Scene | undefined): void;
509
526
  }
510
527
 
528
+ /** Base result shared by Babylon.js physics casting queries. */
529
+ declare class CastingResult {
530
+ protected readonly _hitNormal: Vector3;
531
+ protected readonly _hitPoint: Vector3;
532
+ private _hasHit;
533
+ private _triangleIndex;
534
+ body?: PhysicsBody;
535
+ bodyIndex?: number;
536
+ shape?: PhysicsShape;
537
+ get hitPoint(): Vector3;
538
+ get hitNormal(): Vector3;
539
+ get hasHit(): boolean;
540
+ get triangleIndex(): number;
541
+ setHitData(hitNormal: Vec3Like_2, hitPoint: Vec3Like_2, triangleIndex?: number): void;
542
+ reset(): void;
543
+ }
544
+
511
545
  /**
512
546
  * Babylon.js-compatible colour classes (`Color3`, `Color4`).
513
547
  *
@@ -613,6 +647,10 @@ declare interface DefaultEnvironmentOptions {
613
647
  /** Babylon.js EnvironmentHelper tone-mapping toggle (default true). */
614
648
  toneMappingEnabled?: boolean;
615
649
 
650
+ declare class FluidRenderer {
651
+ constructor(_scene: Scene);
652
+ }
653
+
616
654
  declare class GridMaterial {
617
655
  name: string;
618
656
  /** Background color between the lines (Babylon.js default black). */
@@ -726,6 +764,36 @@ declare interface IAnimationKey {
726
764
  interpolation?: number;
727
765
  }
728
766
 
767
+ /**
768
+ * Minimal Babylon.js `ImageProcessingConfiguration` facade over Lite's image
769
+ * processing state.
770
+ */
771
+ declare class ImageProcessingConfiguration {
772
+ static readonly TONEMAPPING_STANDARD = 0;
773
+ static readonly TONEMAPPING_ACES = 1;
774
+ static readonly TONEMAPPING_KHR_PBR_NEUTRAL = 2;
775
+ private _backing;
729
776
  get exposure(): number;
777
+ set exposure(value: number);
778
+ get contrast(): number;
779
+ set contrast(value: number);
780
+ get toneMappingEnabled(): boolean;
781
+ set toneMappingEnabled(value: boolean);
782
+ get whiteBalanceEnabled(): boolean;
783
+ set whiteBalanceEnabled(value: boolean);
784
+ get temperature(): number;
785
+ set temperature(value: number);
786
+ get tint(): number;
787
+ set tint(value: number);
788
+ }
789
+
790
+ /** Babylon.js raycast collision-filter options. */
791
+ declare interface IRaycastQuery {
792
+ membership?: number;
793
+ collideWith?: number;
794
+ shouldHitTriggers?: boolean;
795
+ ignoreBody?: PhysicsBody;
796
+ }
797
+
730
798
  /** Babylon.js `Light` — base class for all lights (derives from `Node`). */
731
799
  declare abstract class Light extends Node_2 {
732
800
  protected constructor(name: string, scene?: Scene);
733
801
  getClassName(): string;
734
802
  /**
@@ -734,9 +802,7 @@ declare abstract class Light extends Node_2 {
734
802
  protected constructor(name: st
735
803
  */
736
804
  get intensity(): number;
737
805
  set intensity(value: number);
738
806
  /** Detach this light's shadow generator (compat for `light.shadowEnabled = false`). */
739
- set shadowEnabled(enabled: boolean);
740
- dispose(): void;
741
- }
807
+ set shadowEnabled(enabled: boolean);
742
808
 
743
809
  declare class LinesMaterial extends Material {
744
810
  readonly _lite: LineMaterial;
@@ -780,6 +846,8 @@ declare class Matrix {
780
846
  constructor();
781
847
  set(index: number, value: number): this;
782
848
  copyFrom(source: Matrix): this;
849
+ /** Set only this matrix's translation components. */
850
+ setTranslationFromFloats(x: number, y: number, z: number): this;
783
851
  maximizeInPlace(other: Matrix): this;
784
852
  maximizeInPlaceFromFloats(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): this;
785
853
  clone(): Matrix;
@@ -800,7 +868,7 @@ declare class Matrix {
800
868
  * TRS matrix into its scale, rotation (quaternion), and translation parts,
801
869
  * writing into any provided out-params. Returns `false` (matching BJS) when a
802
870
  * scale axis is zero. The rotation extraction is backed by Lite's
803
- * `quatFromRotationMatrix` (via `Quaternion.FromRotationMatrixToRef`); the
871
+ * `createQuatFromRotationMat4` (via `Quaternion.FromRotationMatrixToRef`); the
804
872
  * negative-determinant `scale.y` flip matches Babylon.js exactly.
805
873
  */
806
874
  decompose(scale?: Vector3, rotation?: Quaternion, translation?: Vector3): boolean;
@@ -1014,12 +1082,13 @@ declare class Observable<T> {
1014
1082
  private _observers;
1015
1083
  private _hasNotified;
1016
1084
  private _lastNotifiedValue;
1085
+ private _lastNotifiedMask;
1017
1086
  constructor(_onObserverAdded?: ((observer: ObserverCallback<T>) => void) | undefined, notifyIfTriggered?: boolean);
1018
- add(callback: ObserverCallback<T>): ObserverCallback<T>;
1019
- addOnce(callback: ObserverCallback<T>): ObserverCallback<T>;
1087
+ add(callback: ObserverCallback<T>, mask?: number): ObserverCallback<T>;
1088
+ addOnce(callback: ObserverCallback<T>, mask?: number): ObserverCallback<T>;
1020
1089
  remove(callback: ObserverCallback<T> | null | undefined): boolean;
1021
1090
  removeCallback(callback: ObserverCallback<T>): boolean;
1022
- notifyObservers(eventData?: T): void;
1091
+ notifyObservers(eventData?: T, mask?: number): void;
1023
1092
  hasObservers(): boolean;
1024
1093
  clear(): void;
1025
1094
  cleanLastNotifiedState(): void;
@@ -1282,6 +1351,10 @@ declare class PhysicsEngine {
1282
1351
  /** Current world gravity. */
1283
1352
  setTimeStep(newTimeStep: number): void;
1284
1353
  /** Get the fixed timestep. */
1285
1354
  getTimeStep(): number;
1355
+ /** Cast a ray through the active Lite Havok world. */
1356
+ raycast(from: Vector3, to: Vector3, query?: IRaycastQuery): PhysicsRaycastResult;
1357
+ /** Cast a ray through the active Lite Havok world and write into `result`. */
1358
+ raycastToRef(from: Vector3, to: Vector3, result: PhysicsRaycastResult, query?: IRaycastQuery): void;
1286
1359
  /** Release the underlying physics world. */
1287
1360
  dispose(): void;
1288
1361
  }
@@ -1312,6 +1385,21 @@ declare enum PhysicsPrestepType {
1312
1385
  ACTION = 2
1313
1386
  }
1314
1387
 
1388
+ /** Babylon.js raycast result backed by Lite's native Havok query result. */
1389
+ declare class PhysicsRaycastResult extends CastingResult {
1390
+ private _hitDistance;
1391
+ private readonly _rayFromWorld;
1392
+ private readonly _rayToWorld;
1393
+ get hitDistance(): number;
1394
+ get hitNormalWorld(): Vector3;
1395
+ get hitPointWorld(): Vector3;
1396
+ get rayFromWorld(): Vector3;
1397
+ get rayToWorld(): Vector3;
1398
+ setHitDistance(distance: number): void;
1399
+ calculateHitDistance(): void;
1400
+ reset(from?: Vector3, to?: Vector3): void;
1401
+ }
1402
+
1315
1403
  /** Babylon.js-shaped collision shape backed by a Babylon Lite physics shape. */
1316
1404
  declare class PhysicsShape {
1317
1405
  constructor(options: PhysicShapeOptions, scene: Scene);
1318
1406
  getClassName(): string;
1319
1407
  get type(): PhysicsShapeType;
@@ -1378,6 +1466,15 @@ declare class Plane {
1378
1466
  transform(transformation: Matrix): Plane;
1379
1467
  }
1380
1468
 
1469
+ /** Babylon.js-shaped payload emitted by `Scene.onPointerObservable`. */
1470
+ declare class PointerInfo {
1471
+ type: number;
1472
+ event: PointerEvent | WheelEvent;
1473
+ private readonly _pickInfo;
1474
+ constructor(type: number, event: PointerEvent | WheelEvent, _pickInfo: PickingInfo | null);
1475
+ get pickInfo(): PickingInfo | null;
1476
+ }
1477
+
1381
1478
  /** Babylon.js `PushMaterial` — intermediate base; behaves like {@link Material} here. */
1382
1479
  declare abstract class PushMaterial extends Material {
1383
1480
  getClassName(): string;
@@ -1397,7 +1494,7 @@ declare class Quaternion {
1397
1494
  conjugate(): Quaternion;
1398
1495
  /**
1399
1496
  * Babylon.js `Quaternion.fromRotationMatrix` — update this quaternion in place
1400
- * from the rotation part of `matrix`. Backed by Lite's `quatFromRotationMatrix`.
1497
+ * from the rotation part of `matrix`. Backed by Lite's `createQuatFromRotationMat4`.
1401
1498
  */
1402
1499
  fromRotationMatrix(matrix: Matrix): this;
1403
1500
  /**
@@ -1412,12 +1509,12 @@ declare class Quaternion {
1412
1509
  static Identity(): Quaternion;
1413
1510
  /**
1414
1511
  * Babylon.js `Quaternion.FromRotationMatrix` — create a new quaternion from the
1415
- * rotation part of `matrix`. Backed by Lite's `quatFromRotationMatrix`.
1512
+ * rotation part of `matrix`. Backed by Lite's `createQuatFromRotationMat4`.
1416
1513
  */
1417
1514
  static FromRotationMatrix(matrix: Matrix): Quaternion;
1418
1515
  /**
1419
1516
  * Babylon.js `Quaternion.FromRotationMatrixToRef` — write the rotation part of
1420
- * `matrix` into `result`. Backed by Lite's `quatFromRotationMatrix`.
1517
+ * `matrix` into `result`. Backed by Lite's `createQuatFromRotationMat4`.
1421
1518
  */
1422
1519
  static FromRotationMatrixToRef(matrix: Matrix, result: Quaternion): Quaternion;
1423
1520
  static FromEulerAngles(x: number, y: number, z: number): Quaternion;
@@ -1509,9 +1606,12 @@ declare class Scene extends AbstractScene {
1509
1606
  /** Babylon.js fog-mode constant
1510
1607
  readonly onBeforeAnimationsObservable: Observable<Scene>;
1511
1608
  /** Fires after each scene render. */
1512
1609
  readonly onAfterRenderObservable: Observable<Scene>;
1610
+ /** Fires after each Lite Havok simulation step. */
1611
+ readonly onAfterPhysicsObservable: Observable<Scene>;
1513
1612
  /** Fires once when the scene is disposed. */
1514
1613
  readonly onDisposeObservable: Observable<Scene>;
1515
- /**
1614
+ /** Babylon.js scene-level pointer events from the engine rendering canvas. */
1615
+ readonly onPointerObservable: Observable<PointerInfo>;
1516
1616
  /**
1517
1617
  * Babylon.js `scene.animationGroups` / `scene.animatables`. Loaded glTF /
1518
1618
  * `.babylon` animation clips live on the Lite scene; `animationGroups` returns
1519
1619
  * BJS-shaped `AnimationGroup`s over them (so scenes can `goToFrame`/`pause`/`stop`
@@ -1524,6 +1624,7 @@ declare class Scene extends AbstractScene {
1524
1624
  /** Babylon.js fog-mode constant
1525
1625
  get animatables(): Animatable_2[];
1526
1626
  private readonly _engine;
1527
1627
  private _activeCamera;
1628
+ cameraToUseForPointers: Camera | null;
1528
1629
  private _defaultMaterial;
1529
1630
  private _fogMode;
1530
1631
  private _fogStart;
@@ -1539,9 +1640,12 @@ declare class Scene extends AbstractScene {
1539
1640
  /** Babylon.js fog-mode constant
1540
1641
  private readonly _pendingMorphBuilds;
1541
1642
  private readonly _runningAnimatables;
1542
1643
  private readonly _animationGroupCache;
1543
1644
  private _ambientColor;
1544
- private _environmentIntensity;
1545
1645
  /** Babylon.js `scene.uniqueId` — a process-unique numeric id. */
1646
+ private _environmentIntensity;
1647
+ private _imageProcessingConfiguration;
1546
1648
  /** Babylon.js `scene.uniqueId` — a process-unique numeric id. */
1547
1649
  readonly uniqueId: number;
1548
- constructor(engine: WebGPUEngine);
1549
1650
  getEngine(): WebGPUEngine;
1651
+ constructor(engine: WebGPUEngine);
1652
+ private _attachPointerEvents;
1653
+ private _detachPointerEvents;
1550
1654
  getEngine(): WebGPUEngine;
1551
1655
  /** Babylon.js `scene.getClassName()`. */
1552
1656
  getClassName(): string;
1553
1657
  /** Babylon.js `scene.getUniqueId()` — the process-unique scene id. */
@@ -1556,12 +1660,12 @@ declare class Scene extends AbstractScene {
1556
1660
  /** Babylon.js fog-mode constant
1557
1661
  get clearColor(): Color4;
1558
1662
  set clearColor(value: Color4);
1559
1663
  get activeCamera(): Camera | null;
1560
- set activeCamera(camera: Camera | null);
1561
1664
  /** Image-processing exposure proxy (Babylon.js `imageProcessingConfiguration.exposure`). */
1562
- get imageProcessingConfiguration(): {
1563
- exposure: number;
1564
- contrast: number;
1565
- toneMappingEnabled: boolean;
1566
- };
1665
+ set activeCamera(camera: Camera | null);
1567
1666
  /** Babylon.js image-processing facade over the scene's Lite state. */
1667
+ get imageProcessingConfiguration(): ImageProcessingConfiguration;
1668
+ get fluidRenderer(): FluidRenderer | null;
1669
+ set fluidRenderer(value: FluidRenderer | null);
1670
+ enableFluidRenderer(): FluidRenderer | null;
1671
+ disableFluidRenderer(): void;
1568
1672
  /** Babylon.js `scene.performancePriority` — accepted for parity; Babylon Lite tunes its own pipeline. */
1569
1673
  performancePriority: number;
1570
1674
  /**
@@ -1665,10 +1769,15 @@ declare class Scene extends AbstractScene {
1665
1769
  /** Babylon.js fog-mode constant
1666
1770
  whenReadyAsync(): Promise<void>;
1667
1771
  /** Babylon.js synchronous readiness check — always ready in the compat layer. */
1668
1772
  isReady(): boolean;
1669
- /** Synchronous CPU picking — unsupported. Babylon Lite uses async GPU picking. */
1670
- pick(): never;
1773
+ /** Babylon.js synchronous screen-coordinate picking over Lite's CPU ray picker. */
1774
+ pick(x: number, y: number, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, camera?: Camera | null, trianglePredicate?: (p0: Vector3, p1: Vector3, p2: Vector3, ray: Ray) => boolean): PickingInfo;
1775
+ /**
1776
+ * Babylon.js `Scene.createPickingRay` — translate CSS coordinates and camera
1777
+ * transforms into Lite's reverse-Z unprojection helper.
1778
+ */
1779
+ createPickingRay(x: number, y: number, world?: Matrix | null, camera?: Camera | null, cameraViewSpace?: boolean): Ray;
1671
1780
  /** Synchronous CPU ray picking over Babylon Lite's scene-mesh picker. */
1672
- pickWithRay(ray: Ray, predicate?: (mesh: TransformNode) => boolean, fastCheck?: boolean, trianglePredicate?: (p0: Vector3, p1: Vector3, p2: Vector3, ray: Ray) => boolean): PickingInfo;
1673
1781
  /**
1782
+ pickWithRay(ray: Ray, predicate?: (mesh: AbstractMesh) => boolean, fastCheck?: boolean, trianglePredicate?: (p0: Vector3, p1: Vector3, p2: Vector3, ray: Ray) => boolean): PickingInfo;
1674
1783
  /**
1675
1784
  * Babylon.js `scene.enablePhysics(gravity, plugin)`. Wires the given Havok V2
1676
1785
  * {@link HavokPlugin} to this scene, creating the native Lite physics world and
1677
1786
  * registering per-frame stepping. The plugin's `useDeltaForWorldStep` flag
@@ -1783,8 +1892,7 @@ declare class TransformNode extends Node_2 {
1783
1892
  physicsBody: PhysicsBody | null
1784
1893
  * setter, which keeps the local transform and lets the world move.
1785
1894
  */
1786
1895
  setParent(parent: Node_2 | null): TransformNode;
1787
- protected _applyParent(parent: Node_2 | null): void;
1788
- }
1896
+ protected _applyParent(parent: Node_2 | null): void;
1789
1897
 
1790
1898
  declare interface Vec3Like {
1791
1899
  x: number;
@@ -1882,6 +1990,10 @@ declare class Vector3 {
1882
1990
  static NormalizeToRef<T extends Vector3>(vector: Vector3, result: T): T;
1883
1991
  static Minimize(a: Vector3, b: Vector3): Vector3;
1884
1992
  static Maximize(a: Vector3, b: Vector3): Vector3;
1993
+ /** Project a world-space point into a Babylon.js viewport. */
1994
+ static Project(vector: Vector3, world: Matrix, transform: Matrix, viewport: Viewport): Vector3;
1995
+ /** Project a world-space point into a Babylon.js viewport, writing into `result`. */
1996
+ static ProjectToRef<T extends Vector3>(vector: Vector3, world: Matrix, transform: Matrix, viewport: Viewport, result: T): T;
1885
1997
  /** Transform a coordinate (point) by a matrix using the row-vector convention. */
1886
1998
  static TransformCoordinates(vector: Vector3, transformation: Matrix): Vector3;
1887
1999
  /** Transform a coordinate (point) by a matrix using the row-vector convention. */
@@ -1892,6 +2004,17 @@ declare class Vector3 {
1892
2004
  static TransformNormalToRef<T extends Vector3>(vector: Vector3, transformation: Matrix, result: T): T;
1893
2005
  }
1894
2006
 
2007
+ declare class Viewport {
2008
+ x: number;
2009
+ y: number;
2010
+ width: number;
2011
+ height: number;
2012
+ constructor(x: number, y: number, width: number, height: number);
2013
+ /** Resolve this normalized viewport to pixel coordinates for a render target. */
2014
+ toGlobal(renderWidth: number, renderHeight: number): Viewport;
2015
+ clone(): Viewport;
2016
+ }
2017
+
1895
2018
  /**
1896
2019
  * Babylon.js `@babylonjs/addons/navigation/common/tile-cache`
1897
2020
  * `WaitForFullTileCacheUpdate(navMesh, tileCache)` — block until pending
package/navigation.js CHANGED
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { createNavigationPluginAsync, updateNavCrowd, getAgentPosition, addAgent, agentGoto, createNavMesh, addCylinderObstacle, addBoxObstacle, removeObstacle, updateNavMeshObstacles, createDebugNavMeshGeometry, createMeshFromData, addToScene, getClosestPoint, computePath, raycast, createNavCrowd } from "@babylonjs/lite";
5
- import { V as Vector3, c as Mesh } from "./meshes-CgaKo90D.js";
5
+ import { V as Vector3, c as Mesh } from "./meshes-C1K63hzW.js";
6
6
  class RecastJSCrowd {
7
7
  constructor(lite, plugin, scene) {
8
8
  /** @internal */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/lite-compat",
3
- "version": "1.28.0-preview",
3
+ "version": "1.29.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": "59051",
51
- "sourceVersion": "64710b56f9dfe175d919c635812f84c8872d467c",
52
- "builtAgainstLite": "1.28.0"
50
+ "azureBuildId": "59365",
51
+ "sourceVersion": "fbbf158d48f07b5b3e278e62616d2c463e5df609",
52
+ "builtAgainstLite": "1.29.0"
53
53
  }
54
54
  }