@babylonjs/lite-compat 1.2.0-preview → 1.5.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 +28 -28
- package/index.d.ts +37 -1
- package/index.js +4 -7
- package/index.js.map +1 -1
- package/{meshes-BQZyNGmT.js → meshes-a59_KvbH.js} +161 -10
- package/meshes-a59_KvbH.js.map +1 -0
- package/navigation.d.ts +37 -1
- package/navigation.js +1 -1
- package/package.json +4 -4
- package/meshes-BQZyNGmT.js.map +0 -1
package/README.md
CHANGED
|
@@ -108,52 +108,52 @@ overloads within a supported area may still be absent.
|
|
|
108
108
|
|
|
109
109
|
| Status | Meaning |
|
|
110
110
|
| ------ | ----------------------------------------------------------------------- |
|
|
111
|
-
| ✅
|
|
112
|
-
| ⚡
|
|
113
|
-
| ❌
|
|
111
|
+
| ✅ | Common surface implemented and tested where possible |
|
|
112
|
+
| ⚡ | A practical subset works; some properties/overloads are absent or throw |
|
|
113
|
+
| ❌ | Not supported on the current Lite API (throws `LiteCompatError`) |
|
|
114
114
|
|
|
115
115
|
### `@babylonjs/core`
|
|
116
116
|
|
|
117
117
|
| Feature area | Status | Notes |
|
|
118
118
|
| ------------------------------------------------------------------------------------------------------- | :----: | -------------------------------------------------------------------------------------------------------- |
|
|
119
|
-
| Math (`Vector*`, `Color*`, `Quaternion`, `Matrix`, `Plane`, `Ray`, `Frustum`, `Scalar`, `Axis`/`Space`) | ✅
|
|
120
|
-
| Engine (`WebGPUEngine`, `Engine`, `ThinEngine`, `NullEngine`) | ⚡
|
|
121
|
-
| Scene (clear color, cameras/lights, fog, environment, observables, ready state) | ⚡
|
|
122
|
-
| Cameras (`ArcRotateCamera`, `FreeCamera`/`Universal`/`Target`, `FollowCamera`, `GeospatialCamera`) | ✅
|
|
123
|
-
| Lights (`Hemispheric`, `Directional`, `Point`, `Spot`) | ✅
|
|
124
|
-
| Shadows (`ShadowGenerator` directional ESM/PCF, spot PCF) | ⚡
|
|
125
|
-
| Meshes & geometry (class chain, `MeshBuilder` primitives, transforms, thin instances, `VertexData`) | ⚡
|
|
126
|
-
| CSG / CSG2 | ✅
|
|
127
|
-
| Gizmos (position/rotation/scale/bounding-box/light/camera + `GizmoManager`) | ⚡
|
|
128
|
-
| Materials (`StandardMaterial`, `PBRMaterial`, metallic-rough / spec-gloss, `NodeMaterial`) | ⚡
|
|
129
|
-
| Textures (`Texture`, `RawTexture`, `DynamicTexture`, `CubeTexture`) | ⚡
|
|
130
|
-
| Animation (keyframe `Animation`, easing, `Animatable`, `AnimationGroup` incl. weighted/additive blend) | ⚡
|
|
131
|
-
| Morph targets (`MorphTarget` / `MorphTargetManager`) | ✅
|
|
132
|
-
| Sprites (`SpriteManager` / `Sprite`) | ⚡
|
|
133
|
-
| Behaviors / Actions (`AutoRotation`, `Framing`, `ActionManager`, conditions) | ⚡
|
|
134
|
-
| Misc (`Observable`, `Tools`, `SmartArray`, `Tags`, gradients, `PerformanceMonitor`) | ✅
|
|
135
|
-
| Particles, post-processes, layers (glow/highlight), probes, physics, audio, WebXR | ❌
|
|
119
|
+
| Math (`Vector*`, `Color*`, `Quaternion`, `Matrix`, `Plane`, `Ray`, `Frustum`, `Scalar`, `Axis`/`Space`) | ✅ | `Angle` / `Curve3` / `Path3D` partial |
|
|
120
|
+
| Engine (`WebGPUEngine`, `Engine`, `ThinEngine`, `NullEngine`) | ⚡ | async startup + render loop; `beginFrame`/`endFrame` and manual `scene.render()` unsupported |
|
|
121
|
+
| Scene (clear color, cameras/lights, fog, environment, observables, ready state) | ⚡ | sync `scene.pick` unsupported (use async `GPUPicker`); some scene enumeration needs Lite core |
|
|
122
|
+
| Cameras (`ArcRotateCamera`, `FreeCamera`/`Universal`/`Target`, `FollowCamera`, `GeospatialCamera`) | ✅ | XR / device-orientation / stereoscopic rigs unsupported |
|
|
123
|
+
| Lights (`Hemispheric`, `Directional`, `Point`, `Spot`) | ✅ | `RectAreaLight` / clustered lights unsupported |
|
|
124
|
+
| Shadows (`ShadowGenerator` directional ESM/PCF, spot PCF) | ⚡ | `CascadedShadowGenerator` falls back to single cascade |
|
|
125
|
+
| Meshes & geometry (class chain, `MeshBuilder` primitives, transforms, thin instances, `VertexData`) | ⚡ | `CreateLines`/`CreateDecal`/`CreateText`, `InstancedMesh`, LOD/edges/outline, clone/instance unsupported |
|
|
126
|
+
| CSG / CSG2 | ✅ | over Lite boolean ops |
|
|
127
|
+
| Gizmos (position/rotation/scale/bounding-box/light/camera + `GizmoManager`) | ⚡ | over Lite gizmo suite |
|
|
128
|
+
| Materials (`StandardMaterial`, `PBRMaterial`, metallic-rough / spec-gloss, `NodeMaterial`) | ⚡ | `ShaderMaterial` (GLSL), `MultiMaterial`, `BackgroundMaterial` unsupported |
|
|
129
|
+
| Textures (`Texture`, `RawTexture`, `DynamicTexture`, `CubeTexture`) | ⚡ | `HDRCubeTexture` / `RenderTargetTexture` / `MirrorTexture` unsupported |
|
|
130
|
+
| Animation (keyframe `Animation`, easing, `Animatable`, `AnimationGroup` incl. weighted/additive blend) | ⚡ | CPU evaluation; loaded glTF skeletal blending supported |
|
|
131
|
+
| Morph targets (`MorphTarget` / `MorphTargetManager`) | ✅ | over Lite morph targets |
|
|
132
|
+
| Sprites (`SpriteManager` / `Sprite`) | ⚡ | camera-facing billboards; `SpriteMap` / packed atlas unsupported |
|
|
133
|
+
| Behaviors / Actions (`AutoRotation`, `Framing`, `ActionManager`, conditions) | ⚡ | `ActionManager` is manual-dispatch; drag behaviors need Lite core |
|
|
134
|
+
| Misc (`Observable`, `Tools`, `SmartArray`, `Tags`, gradients, `PerformanceMonitor`) | ✅ | |
|
|
135
|
+
| Particles, post-processes, layers (glow/highlight), probes, physics, audio, WebXR | ❌ | not in Babylon Lite — use native Lite `create*Task` / Havok-V2 functions |
|
|
136
136
|
|
|
137
137
|
### `@babylonjs/loaders`
|
|
138
138
|
|
|
139
139
|
| Feature area | Status | Notes |
|
|
140
140
|
| ---------------------------------------------------------------------------------------------- | :----: | --------------------------------------------------------------- |
|
|
141
|
-
| glTF 2.0 (+ extensions), `.babylon` | ✅
|
|
142
|
-
| `SceneLoader` (`ImportMeshAsync` / `AppendAsync` / `LoadAssetContainerAsync`), `AssetsManager` | ⚡
|
|
143
|
-
| Gaussian Splatting (`.ply` / `.splat` / `.sog` / `.spz`) | ⚡
|
|
144
|
-
| `OBJ` / `STL` / `FBX` / `BVH` | ❌
|
|
141
|
+
| glTF 2.0 (+ extensions), `.babylon` | ✅ | via Lite `loadGltf` / `loadBabylon` |
|
|
142
|
+
| `SceneLoader` (`ImportMeshAsync` / `AppendAsync` / `LoadAssetContainerAsync`), `AssetsManager` | ⚡ | `AssetContainer` partial |
|
|
143
|
+
| Gaussian Splatting (`.ply` / `.splat` / `.sog` / `.spz`) | ⚡ | via `GaussianSplattingMesh`; LOD-streaming variants unsupported |
|
|
144
|
+
| `OBJ` / `STL` / `FBX` / `BVH` | ❌ | not in Lite — convert to glTF |
|
|
145
145
|
|
|
146
146
|
### `@babylonjs/addons` · `@recast-navigation/*`
|
|
147
147
|
|
|
148
|
-
| Feature area
|
|
149
|
-
|
|
|
150
|
-
| `RecastJSPlugin` (navmesh, crowd, path, raycast, off-mesh links, tile-cache obstacles) | ✅
|
|
148
|
+
| Feature area | Status | Notes |
|
|
149
|
+
| -------------------------------------------------------------------------------------- | :----: | -------------------------------- |
|
|
150
|
+
| `RecastJSPlugin` (navmesh, crowd, path, raycast, off-mesh links, tile-cache obstacles) | ✅ | over Lite's native Recast-V2 API |
|
|
151
151
|
|
|
152
152
|
### `@babylonjs/materials`
|
|
153
153
|
|
|
154
154
|
| Feature area | Status | Notes |
|
|
155
155
|
| ----------------- | :----: | ---------------------------------------------------------------------------------------------- |
|
|
156
|
-
| Library materials | ⚡
|
|
156
|
+
| Library materials | ⚡ | mapped onto the compat material surface where a Lite equivalent exists; unsupported ones throw |
|
|
157
157
|
|
|
158
158
|
> Specifiers outside the supported surface (e.g. `@babylonjs/gui`,
|
|
159
159
|
> `@babylonjs/inspector`) are left untouched by the bundler plugins and resolve to
|
package/index.d.ts
CHANGED
|
@@ -764,7 +764,6 @@ export declare class Color4 {
|
|
|
764
764
|
add(other: Color4): Color4;
|
|
765
765
|
clone(): Color4;
|
|
766
766
|
equals(other: Color4): boolean;
|
|
767
|
-
toColor3(): Color3;
|
|
768
767
|
asArray(): [number, number, number, number];
|
|
769
768
|
static FromArray(array: ArrayLike<number>, offset?: number): Color4;
|
|
770
769
|
static FromInts(r: number, g: number, b: number, a: number): Color4;
|
|
@@ -1544,6 +1543,15 @@ export declare class Matrix {
|
|
|
1544
1543
|
invert(): Matrix;
|
|
1545
1544
|
invertToRef(result: Matrix): Matrix;
|
|
1546
1545
|
getTranslation(): Vector3;
|
|
1546
|
+
/**
|
|
1547
|
+
* Babylon.js `Matrix.decompose(scale?, rotation?, translation?)` — split this
|
|
1548
|
+
* TRS matrix into its scale, rotation (quaternion), and translation parts,
|
|
1549
|
+
* writing into any provided out-params. Returns `false` (matching BJS) when a
|
|
1550
|
+
* scale axis is zero. The rotation extraction is backed by Lite's
|
|
1551
|
+
* `quatFromRotationMatrix` (via `Quaternion.FromRotationMatrixToRef`); the
|
|
1552
|
+
* negative-determinant `scale.y` flip matches Babylon.js exactly.
|
|
1553
|
+
*/
|
|
1554
|
+
decompose(scale?: Vector3, rotation?: Quaternion, translation?: Vector3): boolean;
|
|
1547
1555
|
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;
|
|
1548
1556
|
static FromArray(array: ArrayLike<number>, offset?: number): Matrix;
|
|
1549
1557
|
static Identity(): Matrix;
|
|
@@ -2164,11 +2172,26 @@ export declare class Quaternion {
|
|
|
2164
2172
|
length(): number;
|
|
2165
2173
|
normalize(): this;
|
|
2166
2174
|
conjugate(): Quaternion;
|
|
2175
|
+
/**
|
|
2176
|
+
* Babylon.js `Quaternion.fromRotationMatrix` — update this quaternion in place
|
|
2177
|
+
* from the rotation part of `matrix`. Backed by Lite's `quatFromRotationMatrix`.
|
|
2178
|
+
*/
|
|
2179
|
+
fromRotationMatrix(matrix: Matrix): this;
|
|
2167
2180
|
clone(): Quaternion;
|
|
2168
2181
|
equals(other: Quaternion): boolean;
|
|
2169
2182
|
asArray(): [number, number, number, number];
|
|
2170
2183
|
toEulerAngles(): Vector3;
|
|
2171
2184
|
static Identity(): Quaternion;
|
|
2185
|
+
/**
|
|
2186
|
+
* Babylon.js `Quaternion.FromRotationMatrix` — create a new quaternion from the
|
|
2187
|
+
* rotation part of `matrix`. Backed by Lite's `quatFromRotationMatrix`.
|
|
2188
|
+
*/
|
|
2189
|
+
static FromRotationMatrix(matrix: Matrix): Quaternion;
|
|
2190
|
+
/**
|
|
2191
|
+
* Babylon.js `Quaternion.FromRotationMatrixToRef` — write the rotation part of
|
|
2192
|
+
* `matrix` into `result`. Backed by Lite's `quatFromRotationMatrix`.
|
|
2193
|
+
*/
|
|
2194
|
+
static FromRotationMatrixToRef(matrix: Matrix, result: Quaternion): Quaternion;
|
|
2172
2195
|
static FromEulerAngles(x: number, y: number, z: number): Quaternion;
|
|
2173
2196
|
static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Quaternion;
|
|
2174
2197
|
static RotationAxis(axis: Vector3, angle: number): Quaternion;
|
|
@@ -3035,6 +3058,10 @@ export declare class Vector3 {
|
|
|
3035
3058
|
scale(scale: number): Vector3;
|
|
3036
3059
|
scaleInPlace(scale: number): this;
|
|
3037
3060
|
negate(): Vector3;
|
|
3061
|
+
minimizeInPlace(other: Vector3): this;
|
|
3062
|
+
maximizeInPlace(other: Vector3): this;
|
|
3063
|
+
minimizeInPlaceFromFloats(x: number, y: number, z: number): this;
|
|
3064
|
+
maximizeInPlaceFromFloats(x: number, y: number, z: number): this;
|
|
3038
3065
|
length(): number;
|
|
3039
3066
|
lengthSquared(): number;
|
|
3040
3067
|
normalize(): this;
|
|
@@ -3052,22 +3079,31 @@ export declare class Vector3 {
|
|
|
3052
3079
|
static Right(): Vector3;
|
|
3053
3080
|
static Left(): Vector3;
|
|
3054
3081
|
static FromArray(array: ArrayLike<number>, offset?: number): Vector3;
|
|
3082
|
+
static FromArrayToRef<T extends Vector3>(array: ArrayLike<number>, offset: number, result: T): T;
|
|
3083
|
+
static FromFloatsToRef<T extends Vector3>(x: number, y: number, z: number, result: T): T;
|
|
3055
3084
|
static Dot(a: Vector3, b: Vector3): number;
|
|
3056
3085
|
static Cross(a: Vector3, b: Vector3): Vector3;
|
|
3086
|
+
static CrossToRef<T extends Vector3>(a: Vector3, b: Vector3, result: T): T;
|
|
3057
3087
|
static Distance(a: Vector3, b: Vector3): number;
|
|
3058
3088
|
static DistanceSquared(a: Vector3, b: Vector3): number;
|
|
3059
3089
|
static Lerp(start: Vector3, end: Vector3, amount: number): Vector3;
|
|
3090
|
+
static LerpToRef<T extends Vector3>(start: Vector3, end: Vector3, amount: number, result: T): T;
|
|
3060
3091
|
/** Midpoint between two vectors. */
|
|
3061
3092
|
static Center(a: Vector3, b: Vector3): Vector3;
|
|
3062
3093
|
/** Midpoint between two vectors, written into `ref`. */
|
|
3063
3094
|
static CenterToRef(a: Vector3, b: Vector3, ref: Vector3): Vector3;
|
|
3064
3095
|
static Normalize(vector: Vector3): Vector3;
|
|
3096
|
+
static NormalizeToRef<T extends Vector3>(vector: Vector3, result: T): T;
|
|
3065
3097
|
static Minimize(a: Vector3, b: Vector3): Vector3;
|
|
3066
3098
|
static Maximize(a: Vector3, b: Vector3): Vector3;
|
|
3067
3099
|
/** Transform a coordinate (point) by a matrix using the row-vector convention. */
|
|
3068
3100
|
static TransformCoordinates(vector: Vector3, transformation: Matrix): Vector3;
|
|
3101
|
+
/** Transform a coordinate (point) by a matrix using the row-vector convention. */
|
|
3102
|
+
static TransformCoordinatesToRef<T extends Vector3>(vector: Vector3, transformation: Matrix, result: T): T;
|
|
3069
3103
|
/** Transform a direction (normal) by a matrix, ignoring translation. */
|
|
3070
3104
|
static TransformNormal(vector: Vector3, transformation: Matrix): Vector3;
|
|
3105
|
+
/** Transform a direction (normal) by a matrix, ignoring translation. */
|
|
3106
|
+
static TransformNormalToRef<T extends Vector3>(vector: Vector3, transformation: Matrix, result: T): T;
|
|
3071
3107
|
}
|
|
3072
3108
|
|
|
3073
3109
|
export declare class Vector4 {
|
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
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
|
-
import { V as Vector3, u as unsupported, L as LiteCompatError, N as Node, M as Matrix, a as Mesh, T as TransformNode, l as liteBackedVector3 } from "./meshes-
|
|
5
|
-
import { A, C, b, c, d, e, f, g, G, I, h, Q, i, j, k, m, t, n } from "./meshes-
|
|
4
|
+
import { V as Vector3, u as unsupported, L as LiteCompatError, N as Node, M as Matrix, a as Mesh, T as TransformNode, l as liteBackedVector3 } from "./meshes-a59_KvbH.js";
|
|
5
|
+
import { A, C, b, c, d, e, f, g, G, I, h, Q, i, j, k, m, t, n } from "./meshes-a59_KvbH.js";
|
|
6
6
|
import { createEngine, onBeforeRender, stopEngine, resizeEngine, setEngineSize, disposeEngine, registerSceneWithShadowSupport, registerScene, startEngine, createArcRotateCamera, attachControl, getCameraPosition, getViewMatrix, getProjectionMatrix, createGeospatialCamera, setGeospatialOrientation, attachGeospatialControls, createFreeCamera, attachFreeControl, markMaterialUboDirty, createPbrMaterial, createSolidTexture2D, createStandardMaterial, setAnimationAdditive, playAnimation, pauseAnimation, goToFrame, stopAnimation, createSceneContext, updateAnimationManager, setFog, setClipPlane, loadDdsEnvironment, loadEnvironment, createDefaultCamera, addToScene, createHemisphericLight, createAnimationManager, enableAnimationBlending, addAnimationGroup, disposeScene, createDirectionalLight, createPointLight, createSpotLight, createCsgFromMesh, csgSubtract, csgIntersect, csgUnion, createMeshFromCsg, createCsg2FromMesh, csg2Subtract, csg2Intersect, csg2Add, createMeshesFromCsg2, disposeCsg2, initializeCsg2Async, createMorphTargets, setMorphTargetWeights, createTransformNode, bakeCurrentTransformIntoVertices, loadSOG, loadSPZ, loadSplat, createTexture2DFromPixels, updateTexture2DFromPixels, loadBasisTexture2D, loadKtxTexture2D, loadTexture2D, getContainerMeshes, loadBabylon, loadGltf, resetVariant, getVariantNames, selectVariant, disposePicker, createGpuPicker, pickAsync, createAxisDragGizmo, attachAxisDragGizmoToNode, disposeAxisDragGizmo, createAxisScaleGizmo, attachAxisScaleGizmoToNode, disposeAxisScaleGizmo, createBoundingBoxGizmo, attachBoundingBoxGizmoToNode, disposeBoundingBoxGizmo, createCameraGizmo, attachCameraGizmoToCamera, disposeCameraGizmo, createLightGizmo, attachLightGizmoToLight, disposeLightGizmo, createPlaneDragGizmo, attachPlaneDragGizmoToNode, disposePlaneDragGizmo, createPlaneRotationGizmo, attachPlaneRotationGizmoToNode, disposePlaneRotationGizmo, createPositionGizmo, setPositionGizmoLocalCoordinates, attachPositionGizmoToNode, disposePositionGizmo, createRotationGizmo, setRotationGizmoLocalCoordinates, attachRotationGizmoToNode, disposeRotationGizmo, createScaleGizmo, setScaleGizmoLocalCoordinates, attachScaleGizmoToNode, disposeScaleGizmo, createUtilityLayer, registerUtilityLayer, disposeUtilityLayer, addBillboardSpriteIndex, updateBillboardSpriteIndex, loadSpriteAtlas, createFacingBillboardSystem, addFacingBillboardSystem, billboardBlendAdditive, billboardBlendAlpha, spriteBlendPremultiplied, spriteBlendAdditive, spriteBlendAlpha, createSprite2DLayer, addSprite2DIndex, createSpriteRenderer, registerSpriteRenderer, updateSprite2DIndex, createPcfSpotlightShadowGenerator, createPcfDirectionalShadowGenerator, createEsmDirectionalShadowGenerator, setShadowTaskCasterMeshes, parseNodeMaterialFromSnippet, createGridMaterial } from "@babylonjs/lite";
|
|
7
7
|
class Color3 {
|
|
8
8
|
constructor(r = 0, g2 = 0, b2 = 0) {
|
|
@@ -122,9 +122,6 @@ class Color4 {
|
|
|
122
122
|
equals(other) {
|
|
123
123
|
return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
|
|
124
124
|
}
|
|
125
|
-
toColor3() {
|
|
126
|
-
return new Color3(this.r, this.g, this.b);
|
|
127
|
-
}
|
|
128
125
|
asArray() {
|
|
129
126
|
return [this.r, this.g, this.b, this.a];
|
|
130
127
|
}
|
|
@@ -2135,7 +2132,7 @@ class AnimationGroup {
|
|
|
2135
2132
|
get animatables() {
|
|
2136
2133
|
if (this._lite) {
|
|
2137
2134
|
const frameRate = this._lite.frameRate ?? 60;
|
|
2138
|
-
return [{ masterFrame: this._lite.
|
|
2135
|
+
return [{ masterFrame: this._lite.currentTime * frameRate }];
|
|
2139
2136
|
}
|
|
2140
2137
|
return [];
|
|
2141
2138
|
}
|
|
@@ -2160,7 +2157,7 @@ class AnimationGroup {
|
|
|
2160
2157
|
if (this._lite) {
|
|
2161
2158
|
const frameRate = this._lite.frameRate ?? 60;
|
|
2162
2159
|
if (from !== void 0) {
|
|
2163
|
-
this._lite.
|
|
2160
|
+
this._lite.currentTime = from / frameRate;
|
|
2164
2161
|
}
|
|
2165
2162
|
this._lite.speedRatio = speedRatio;
|
|
2166
2163
|
this._lite.loopAnimation = loop;
|