@babylonjs/lite-compat 1.23.0-preview → 1.25.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
@@ -134,7 +134,7 @@ overloads within a supported area may still be absent.
134
134
  | Behaviors / Actions (`AutoRotation`, `Framing`, `ActionManager`, conditions) | ⚡ | `ActionManager` is manual-dispatch; drag / six-DoF / XR-oriented mesh behaviors throw |
135
135
  | Misc (`Observable`, `Tools`, `SmartArray`, `Tags`, gradients, `PerformanceMonitor`) | ✅ | |
136
136
  | Audio V2 (`AudioEngineV2`, `StaticSound`, `StreamingSound`, `AudioBus`, buses/sources/analyzer) | ⚡ | over Lite's AudioV2 port; `MainAudioBus` spatial/analyzer and a second main bus unsupported |
137
- | Physics (`HavokPlugin`, `scene.enablePhysics`/`getPhysicsEngine`, `PhysicsShapeType`/`PhysicsMotionType`) | ⚡ | Havok V2 over Lite `createHavokWorld`; refresh-rate-independent `useDeltaForWorldStep`. Bodies via native `createPhysicsAggregate` (`PhysicsAggregate` class not wrapped) |
137
+ | Physics (`HavokPlugin`, `scene.enablePhysics`/`getPhysicsEngine`, `PhysicsAggregate`/`PhysicsBody`/`PhysicsShape`) | ⚡ | Native Havok V2 forwarding for common body/shape operations; unrecognized shape/motion/prestep enum values throw at the compat boundary |
138
138
  | Particles (`NodeParticleSystemSet` / `ParticleSystemSet` — Node Particle Editor) | ⚡ | NPE snippet/JSON graphs: `Parse`/`ParseFromSnippetAsync` → `buildAsync` → `start`, incl. per-system `set.systems[i]` runtime (`start`/`animate`/`updateSpeed`/`particleTexture`). Imperative classic/GPU/solid `ParticleSystem` construction + programmatic block authoring unsupported |
139
139
  | Post-processes, layers (glow/highlight), probes, WebXR | ❌ | not in Babylon Lite — use native Lite `create*Task` functions |
140
140
 
package/index.d.ts CHANGED
@@ -8,6 +8,9 @@ import { EngineOptions } from '@babylonjs/lite';
8
8
  import { IridescenceProps } from '@babylonjs/lite';
9
9
  import { LineMaterial } from '@babylonjs/lite';
10
10
  import { Mesh as Mesh_2 } from '@babylonjs/lite';
11
+ import { PhysicsMassProperties } from '@babylonjs/lite';
12
+ import { PhysicsShape as PhysicsShape_2 } from '@babylonjs/lite';
13
+ import { PhysicsShapeParameters } from '@babylonjs/lite';
11
14
  import { PhysicsWorld } from '@babylonjs/lite';
12
15
  import { RenderCanvas } from '@babylonjs/lite';
13
16
  import { SceneNode } from '@babylonjs/lite';
@@ -243,6 +246,8 @@ export declare class AbstractMesh extends TransformNode {
243
246
  private _material;
244
247
  set material(value: CompatMaterial | null);
245
248
  get isVisible(): boolean;
246
249
  set isVisible(value: boolean);
250
+ get isPickable(): boolean;
251
+ set isPickable(value: boolean);
247
252
  get receiveShadows(): boolean;
248
253
  set receiveShadows(value: boolean);
249
254
  protected _onEffectiveEnabledStateChanged(enabled: boolean): void;
250
255
  /**
@@ -795,6 +800,7 @@ export declare class AssetContainer {
795
800
  constructor(lite: AssetContainer_2);
796
801
  * same handles `scene.meshes` exposes.
797
802
  */
798
803
  get meshes(): Mesh[];
804
+ get skeletons(): Skeleton[];
799
805
  /** Add every entity, animation group, camera, and clear colour to the scene. */
800
806
  addAllToScene(scene: Scene): void;
801
807
  dispose(): void;
@@ -1014,7 +1020,15 @@ export declare const BloomEffect: new () => never;
1014
1020
  export declare const BlurPostProcess: new () => never;
1015
1021
 
1016
1022
  export declare class Bone {
1017
- constructor();
1023
+ private _enabled;
1024
+ readonly name: string;
1018
1025
  constructor(_name?: string, _skeleton?: Skeleton);
1019
1026
  getName(): string;
1027
+ getSkeleton(): Skeleton;
1028
+ setPosition(position: Vector3, space?: number): this;
1029
+ setRotationQuaternion(rotation: Quaternion, space?: number): this;
1030
+ setScale(scale: Vector3): this;
1031
+ setEnabled(value: boolean): void;
1032
+ isEnabled(): boolean;
1033
+ returnToRest(): void;
1020
1034
  }
1021
1035
 
1022
1036
  export declare class BounceEase extends EasingFunction {
@@ -1106,7 +1120,8 @@ export declare class BoundingSphere {
1106
1120
  private _worldMatrix;
1107
1121
  constructor(min: Vector3, max: Vector3, worldMatrix?: Matrix);
1108
1122
  reConstruct(min: Vector3, max: Vector3, worldMatrix?: Matrix): void;
1109
- getWorldMatrix(): Matrix;
1110
1123
  intersectsPoint(point: Vector3): boolean;
1124
+ getWorldMatrix(): Matrix;
1125
+ scale(factor: number): this;
1111
1126
  intersectsPoint(point: Vector3): boolean;
1112
1127
  static Intersects(a: BoundingSphere, b: BoundingSphere): boolean;
1113
1128
  }
1114
1129
 
@@ -1525,6 +1540,8 @@ export declare class Curve3 {
1525
1540
  static CreateQuadraticBezier(v0: Vector3, v1: Vector3, v2: Vector3, nbPoints: number): Curve3;
1526
1541
  /** Cubic Bézier from `v0` → `v3` with controls `v1`, `v2`, sampled `nbPoints` times. */
1527
1542
  static CreateCubicBezier(v0: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, nbPoints: number): Curve3;
1543
+ static CreateHermiteSpline(p1: Vector3, t1: Vector3, p2: Vector3, t2: Vector3, nSeg: number): Curve3;
1544
+ static CreateCatmullRomSpline(points: readonly Vector3[], nbPoints: number, closed?: boolean): Curve3;
1528
1545
  }
1529
1546
 
1530
1547
  /** A task whose work is provided as a plain async function (useful for custom assets and tests). */
@@ -2353,7 +2370,7 @@ export declare function ImportMeshAsync(source: string, scene: Scene, _options?:
2353
2370
  declare interface ImportResult {
2354
2371
  meshes: TransformNode[];
2355
2372
  particleSystems: unknown[];
2356
- skeletons: unknown[];
2373
+ skeletons: Skeleton[];
2357
2374
  animationGroups: AnimationGroup_2[];
2358
2375
  transformNodes: unknown[];
2359
2376
  lights: unknown[];
@@ -2733,6 +2750,8 @@ export declare class Matrix {
2733
2750
  constructor();
2734
2751
  set(index: number, value: number): this;
2735
2752
  copyFrom(source: Matrix): this;
2753
+ maximizeInPlace(other: Matrix): this;
2754
+ 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;
2736
2755
  clone(): Matrix;
2737
2756
  asArray(): Float32Array;
2738
2757
  toArray(): number[];
@@ -2974,7 +2993,8 @@ declare abstract class Node_2 {
2974
2993
  /** Process-unique numeric id, assigned at construction. */
2975
2994
  readonly uniqueId: number;
2976
2995
  /** Free-form user data slot (Babylon.js `Node.metadata`). */
2977
- metadata: unknown;
2978
2996
  protected constructor(name: string, scene?: Scene);
2997
+ metadata: unknown;
2998
+ readonly onDisposeObservable: Observable<Node_2>;
2979
2999
  protected constructor(name: string, scene?: Scene);
2980
3000
  /** The runtime class name (overridden by each subclass). */
2981
3001
  getClassName(): string;
2982
3002
  /** The scene this node belongs to, if any. */
@@ -3451,13 +3471,63 @@ export declare class PerformanceMonitor {
3451
3471
  reset(): void;
3452
3472
  }
3453
3473
 
3474
+ /** Babylon.js aggregate convenience object backed by Lite's native aggregate factory. */
3454
3475
  export declare class PhysicsAggregate {
3455
- constructor();
3476
+ readonly transformNode: TransformNode;
3477
+ readonly type: PhysicsShapeType | PhysicsShape;
3478
+ readonly body: PhysicsBody;
3479
+ readonly shape: PhysicsShape;
3480
+ readonly material: PhysicsMaterial;
3456
3481
  constructor(transformNode: TransformNode, type: PhysicsShapeType | PhysicsShape, options?: PhysicsAggregateParameters, scene?: Scene);
3482
+ dispose(): void;
3457
3483
  }
3458
3484
 
3459
- export declare class PhysicsBody {
3460
- constructor();
3461
- }
3485
+ export declare interface PhysicsAggregateParameters {
3486
+ mass: number;
3487
+ friction?: number;
3488
+ staticFriction?: number;
3489
+ restitution?: number;
3490
+ radius?: number;
3491
+ pointA?: Vec3Like;
3492
+ pointB?: Vec3Like;
3493
+ extents?: Vec3Like;
3494
+ rotation?: {
3495
+ x: number;
3496
+ y: number;
3497
+ z: number;
3498
+ w: number;
3499
+ };
3500
+ center?: Vec3Like;
3501
+ mesh?: Mesh;
3502
+ startAsleep?: boolean;
3503
+ isTriggerShape?: boolean;
3504
+ }
3505
+
3506
+ /** Babylon.js-shaped rigid body backed by a Babylon Lite physics body. */
3507
+ export declare class PhysicsBody {
3462
3508
  readonly transformNode: TransformNode;
3509
+ private _disableSync;
3510
+ readonly startAsleep: boolean;
3511
+ constructor(transformNode: TransformNode, motionType: PhysicsMotionType, startsAsleep: boolean, scene: Scene);
3463
3512
  getClassName(): string;
3513
+ get disablePreStep(): boolean;
3514
+ set disablePreStep(value: boolean);
3515
+ get disableSync(): boolean;
3516
+ set disableSync(value: boolean);
3517
+ get motionType(): PhysicsMotionType;
3518
+ set shape(value: PhysicsShape | null);
3519
+ get shape(): PhysicsShape | null;
3520
+ setMotionType(value: PhysicsMotionType): void;
3521
+ getMotionType(): PhysicsMotionType;
3522
+ setPrestepType(value: PhysicsPrestepType): void;
3523
+ getPrestepType(): PhysicsPrestepType;
3524
+ setMassProperties(properties: PhysicsMassProperties): void;
3525
+ setLinearVelocity(value: Vec3Like): void;
3526
+ getLinearVelocity(): Vector3;
3527
+ getLinearVelocityToRef(result: Vector3): void;
3528
+ setAngularVelocity(value: Vec3Like): void;
3529
+ getAngularVelocity(): Vector3;
3530
+ getAngularVelocityToRef(result: Vector3): void;
3531
+ applyImpulse(impulse: Vec3Like, location: Vec3Like): void;
3532
+ applyForce(force: Vec3Like, location: Vec3Like): void;
3533
+ dispose(): void;
3464
3534
 
3465
3535
  /** Type of a Physics V2 constraint. Values match Babylon.js `PhysicsConstraintType`. */
3466
3536
  export declare enum PhysicsConstraintType {
@@ -3492,6 +3562,18 @@ export declare class PhysicsEngine {
3492
3562
  /** Current world gravity. */
3493
3563
  dispose(): void;
3494
3564
  }
3495
3565
 
3566
+ export declare interface PhysicShapeOptions {
3567
+ type?: PhysicsShapeType;
3568
+ parameters?: PhysicsShapeParameters;
3569
+ pluginData?: PhysicsShape_2;
3570
+ }
3571
+
3572
+ export declare interface PhysicsMaterial {
3573
+ friction?: number;
3574
+ staticFriction?: number;
3575
+ restitution?: number;
3576
+ }
3577
+
3496
3578
  /** How a body moves. Values match Babylon.js `PhysicsMotionType`. */
3497
3579
  export declare enum PhysicsMotionType {
3498
3580
  STATIC = 0,
@@ -3506,8 +3588,18 @@ export declare enum PhysicsPrestepType {
3506
3588
  ACTION = 2
3507
3589
  }
3508
3590
 
3509
- export declare class PhysicsShape {
3510
- constructor();
3591
+ /** Babylon.js-shaped collision shape backed by a Babylon Lite physics shape. */
3592
+ export declare class PhysicsShape {
3511
3593
  constructor(options: PhysicShapeOptions, scene: Scene);
3512
3594
  getClassName(): string;
3595
+ get type(): PhysicsShapeType;
3596
+ set filterMembershipMask(value: number);
3597
+ get filterMembershipMask(): number;
3598
+ set filterCollideMask(value: number);
3599
+ get filterCollideMask(): number;
3600
+ set material(value: PhysicsMaterial);
3601
+ get material(): PhysicsMaterial;
3602
+ set isTrigger(value: boolean);
3603
+ get isTrigger(): boolean;
3604
+ dispose(): void;
3513
3605
  }
3514
3606
 
3515
3607
  /** The type of a Havok physics collision shape. Values match Babylon.js `PhysicsShapeType`. */
@@ -3525,6 +3617,28 @@ export declare enum PhysicsShapeType {
3525
3617
  /** A pickable compat mesh: a regular `Mesh` or a `GaussianSplattingMesh`. */
3526
3618
  declare type PickableMesh = Mesh | GaussianSplattingMesh;
3527
3619
 
3620
+ /** Babylon.js-compatible result of a scene pick. */
3621
+ export declare class PickingInfo {
3622
+ hit: boolean;
3623
+ distance: number;
3624
+ pickedPoint: Vector3 | null;
3625
+ pickedMesh: TransformNode | null;
3626
+ bu: number;
3627
+ bv: number;
3628
+ faceId: number;
3629
+ subMeshFaceId: number;
3630
+ subMeshId: number;
3631
+ pickedSprite: null;
3632
+ thinInstanceIndex: number;
3633
+ ray: Ray | null;
3634
+ originMesh: TransformNode | null;
3635
+ aimTransform: TransformNode | null;
3636
+ gripTransform: TransformNode | null;
3637
+ private _normal;
3638
+ private _worldNormal;
3528
3639
  getNormal(useWorldCoordinates?: boolean, _useVerticesNormals?: boolean): Vector3 | null;
3640
+ getTextureCoordinates(_uvSet?: string): Vector2 | null;
3641
+ }
3642
+
3529
3643
  declare type PickListItem = PickableMesh | {
3530
3644
  mesh: PickableMesh;
3531
3645
  material?: unknown;
@@ -3598,6 +3712,44 @@ export declare class PointsCloudSystem {
3598
3712
  constructor();
3599
3713
  }
3600
3714
 
3715
+ /** Babylon.js-compatible polar-coordinate value object. */
3716
+ export declare class Polar {
3717
+ radius: number;
3718
+ theta: number;
3719
+ constructor(radius: number, theta: number);
3720
+ getClassName(): string;
3721
+ toString(): string;
3722
+ asArray(): number[];
3723
+ addToRef(polar: Polar, ref: Polar): Polar;
3724
+ add(polar: Polar): Polar;
3725
+ addInPlace(polar: Polar): this;
3726
+ addInPlaceFromFloats(radius: number, theta: number): this;
3727
+ subtractToRef(polar: Polar, ref: Polar): Polar;
3728
+ subtract(polar: Polar): Polar;
3729
+ subtractInPlace(polar: Polar): this;
3730
+ subtractFromFloatsToRef(radius: number, theta: number, ref: Polar): Polar;
3731
+ subtractFromFloats(radius: number, theta: number): Polar;
3732
+ multiplyToRef(polar: Polar, ref: Polar): Polar;
3733
+ multiply(polar: Polar): Polar;
3734
+ multiplyInPlace(polar: Polar): this;
3735
+ divideToRef(polar: Polar, ref: Polar): Polar;
3736
+ divide(polar: Polar): Polar;
3737
+ divideInPlace(polar: Polar): this;
3738
+ clone(): Polar;
3739
+ copyFrom(source: Polar): this;
3740
+ copyFromFloats(radius: number, theta: number): this;
3741
+ scaleToRef(scale: number, ref: Polar): Polar;
3742
+ scale(scale: number): Polar;
3743
+ scaleInPlace(scale: number): this;
3744
+ set(radius: number, theta: number): this;
3745
+ setAll(value: number): this;
3746
+ toVector2ToRef(ref: Vector2): Vector2;
3747
+ toVector2(): Vector2;
3748
+ static FromVector2ToRef(vector: Vector2, ref: Polar): Polar;
3749
+ static FromVector2(vector: Vector2): Polar;
3750
+ static FromArray(array: number[]): Polar;
3751
+ }
3752
+
3601
3753
  export declare class PositionGizmo extends GizmoBase {
3602
3754
  private _attached;
3603
3755
  private _xGizmo;
3604
3756
  private _yGizmo;
@@ -4050,8 +4202,8 @@ export declare class Scene extends AbstractScene {
4050
4202
  /** Babylon.js fog-mode c
4051
4203
  isReady(): boolean;
4052
4204
  /** Synchronous CPU picking — unsupported. Babylon Lite uses async GPU picking. */
4053
4205
  pick(): never;
4054
- /** Synchronous ray picking — unsupported. */
4055
- pickWithRay(): never;
4056
4206
  /**
4207
+ /** Synchronous CPU ray picking over Babylon Lite's scene-mesh picker. */
4208
+ pickWithRay(ray: Ray, predicate?: (mesh: TransformNode) => boolean, fastCheck?: boolean, trianglePredicate?: (p0: Vector3, p1: Vector3, p2: Vector3, ray: Ray) => boolean): PickingInfo;
4057
4209
  /**
4058
4210
  * Babylon.js `scene.enablePhysics(gravity, plugin)`. Wires the given Havok V2
4059
4211
  * {@link HavokPlugin} to this scene, creating the native Lite physics world and
4060
4212
  * registering per-frame stepping. The plugin's `useDeltaForWorldStep` flag
@@ -4209,18 +4361,11 @@ export declare class Size {
4209
4361
  static Zero(): Size;
4210
4362
  }
4211
4363
 
4212
- /**
4213
- * Throwing stubs for additional Babylon.js core/loaders symbols that Babylon
4214
- * Lite either does not implement, or exposes only through a different native API
4215
- * that the compat layer does not wrap 1:1.
4216
- *
4217
- * Every stub throws {@link LiteCompatError} on use with a pointer to the native
4218
- * Babylon Lite alternative where one exists. This keeps the completeness
4219
- * invariant — every core/loaders symbol resolves to an import and fails loudly
4220
- * rather than silently.
4221
- */
4222
4364
  export declare class Skeleton {
4223
- constructor();
4365
+ readonly name: string;
4366
+ readonly id: string;
4367
+ readonly bones: Bone[];
4224
4368
  constructor(_name?: string, _id?: string, _scene?: Scene);
4225
4369
  getBoneIndexByName(name: string): number;
4370
+ getBoneByName(name: string): Bone | null;
4226
4371
  }
4227
4372
 
4228
4373
  /**
@@ -4314,6 +4459,45 @@ declare interface SphereOptions {
4314
4459
  segments?: number;
4315
4460
  }
4316
4461
 
4462
+ /** Babylon.js-compatible spherical-coordinate value object. */
4463
+ export declare class Spherical {
4464
+ radius: number;
4465
+ theta: number;
4466
+ phi: number;
4467
+ constructor(radius: number, theta: number, phi: number);
4468
+ getClassName(): string;
4469
+ toString(): string;
4470
+ asArray(): number[];
4471
+ addToRef(spherical: Spherical, ref: Spherical): Spherical;
4472
+ add(spherical: Spherical): Spherical;
4473
+ addInPlace(spherical: Spherical): this;
4474
+ addInPlaceFromFloats(radius: number, theta: number, phi: number): this;
4475
+ subtractToRef(spherical: Spherical, ref: Spherical): Spherical;
4476
+ subtract(spherical: Spherical): Spherical;
4477
+ subtractInPlace(spherical: Spherical): this;
4478
+ subtractFromFloatsToRef(radius: number, theta: number, phi: number, ref: Spherical): Spherical;
4479
+ subtractFromFloats(radius: number, theta: number, phi: number): Spherical;
4480
+ multiplyToRef(spherical: Spherical, ref: Spherical): Spherical;
4481
+ multiply(spherical: Spherical): Spherical;
4482
+ multiplyInPlace(spherical: Spherical): this;
4483
+ divideToRef(spherical: Spherical, ref: Spherical): Spherical;
4484
+ divide(spherical: Spherical): Spherical;
4485
+ divideInPlace(spherical: Spherical): this;
4486
+ clone(): Spherical;
4487
+ copyFrom(source: Spherical): this;
4488
+ copyFromFloats(radius: number, theta: number, phi: number): this;
4489
+ scaleToRef(scale: number, ref: Spherical): Spherical;
4490
+ scale(scale: number): Spherical;
4491
+ scaleInPlace(scale: number): this;
4492
+ set(radius: number, theta: number, phi: number): this;
4493
+ setAll(value: number): this;
4494
+ toVector3ToRef(ref: Vector3): Vector3;
4495
+ toVector3(): Vector3;
4496
+ static FromVector3ToRef(vector: Vector3, ref: Spherical): Spherical;
4497
+ static FromVector3(vector: Vector3): Spherical;
4498
+ static FromArray(array: number[]): Spherical;
4499
+ }
4500
+
4317
4501
  export declare class SpotLight extends Light {
4318
4502
  constructor(name: string, position: Vector3, direction: Vector3, angle: number, exponent: number, scene?: Scene);
4319
4503
  getClassName(): string;
4320
4504
  get angle(): number;
@@ -4771,7 +4955,7 @@ export declare function transformCoordinates(vector: Vector3, transformation: Ma
4771
4955
  * Wraps a Lite scene node (`_node`): either a standalone Lite transform node, or
4772
4956
  * (for meshes) the Lite mesh itself, which also carries the transform.
4773
4957
  */
4774
- export declare class TransformNode extends Node_2 {
4775
4958
  constructor(name: string, scene?: Scene, liteNode?: SceneNode);
4959
+ export declare class TransformNode extends Node_2 {
4776
4960
  physicsBody: PhysicsBody | null;
4777
4961
  constructor(name: string, scene?: Scene, liteNode?: SceneNode);
4778
4962
  getClassName(): string;
4779
4963
  get position(): Vector3;
4780
4964
  set position(value: Vector3);
@@ -4863,6 +5047,10 @@ export declare class Vector2 {
4863
5047
  length(): number;
4864
5048
  lengthSquared(): number;
4865
5049
  normalize(): this;
5050
+ normalizeToRef<T extends {
5051
+ x: number;
5052
+ y: number;
5053
+ }>(result: T): T;
4866
5054
  clone(): Vector2;
4867
5055
  equals(other: Vector2): boolean;
4868
5056
  asArray(): [number, number];