@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/README.md +24 -22
- package/index.d.ts +293 -39
- package/index.js +737 -78
- package/index.js.map +1 -1
- package/{meshes-CgaKo90D.js → meshes-C1K63hzW.js} +60 -25
- package/meshes-C1K63hzW.js.map +1 -0
- package/navigation.d.ts +149 -26
- package/navigation.js +1 -1
- package/package.json +4 -4
- package/meshes-CgaKo90D.js.map +0 -1
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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, a as Vector2, u as unsupported, O as Observable, L as LiteCompatError, N as Node, M as Matrix, l as liteBackedVector3, C as Color3, S as StandardMaterial, b as Color4, A as AbstractMesh, c as Mesh, T as TransformNode, Q as Quaternion, P as PushMaterial } from "./meshes-
|
|
5
|
-
import { B, d, e, f, g, h, i, j, k, m, n, o, p, q, r, G, I, s, t, v, w, x, y, z, D, E, F, H, J, K, R, U } from "./meshes-
|
|
6
|
-
import { addPolarToRef, subtractPolarToRef, multiplyPolarToRef, dividePolarToRef, scalePolarToRef, polarToVec2ToRef, polarFromVec2ToRef, addSphericalToRef, subtractSphericalToRef, multiplySphericalToRef, divideSphericalToRef, scaleSphericalToRef, sphericalToVec3ToRef, sphericalFromVec3ToRef, sampleHermiteSpline, sampleCatmullRomSpline, VERSION, createEngine, onBeforeRender, stopEngine, resizeEngine, setEngineSize, disposeEngine, uploadImageToArrayLayer, enableMirroredMeshes, registerSceneWithShadowSupport, registerScene, startEngine, createNullEngine, stepScene, setPhysicsTimestep, setPhysicsGravity, disposePhysics, createHavokWorld, createPhysicsShape, createPhysicsAggregate, createPhysicsBody, setPhysicsBodyPrestepType, PhysicsPrestepType as PhysicsPrestepType$1, PhysicsMotionType as PhysicsMotionType$1, setPhysicsBodyShape, setPhysicsBodyMotionType, setPhysicsBodyMassProperties, setPhysicsBodyLinearVelocity, getPhysicsBodyLinearVelocity, setPhysicsBodyAngularVelocity, getPhysicsBodyAngularVelocity, applyPhysicsBodyImpulse, applyPhysicsBodyForce, removePhysicsBody, createPhysicsCharacterController, calculatePhysicsCharacterMovementToRef, createPhysicsConstraint, releasePhysicsConstraint, PhysicsShapeType as PhysicsShapeType$1, setPhysicsShapeFilterMembershipMask, setPhysicsShapeFilterCollideMask, setPhysicsShapeMaterial, setPhysicsShapeIsTrigger, releasePhysicsShape, CharacterSupportedState as CharacterSupportedState$1, PhysicsConstraintType as PhysicsConstraintType$1, PhysicsConstraintAxis as PhysicsConstraintAxis$1, createArcRotateCamera, attachControl, getCameraPosition, getViewMatrix, getProjectionMatrix, createBankedFreeCamera, createGeospatialCamera, setGeospatialOrientation, attachGeospatialControls, createFreeCamera, attachFreeControl, setAnimationAdditive, playAnimation, pauseAnimation, goToFrame, stopAnimation, createSceneContext, updateAnimationManager, setFog, setClipPlane, loadHdrEnvironment, loadDdsEnvironment, loadEnvironment, createDefaultCamera, addToScene, createHemisphericLight, pickMeshesWithRay, createAnimationManager, enableAnimationBlending, addAnimationGroup, disposeScene, createDirectionalLight, createPointLight, createSpotLight, createClusteredLightContainer, createClusteredPointLight,
|
|
4
|
+
import { V as Vector3, a as Vector2, u as unsupported, O as Observable, L as LiteCompatError, N as Node, M as Matrix, l as liteBackedVector3, C as Color3, S as StandardMaterial, b as Color4, A as AbstractMesh, c as Mesh, T as TransformNode, Q as Quaternion, P as PushMaterial } from "./meshes-C1K63hzW.js";
|
|
5
|
+
import { B, d, e, f, g, h, i, j, k, m, n, o, p, q, r, G, I, s, t, v, w, x, y, z, D, E, F, H, J, K, R, U } from "./meshes-C1K63hzW.js";
|
|
6
|
+
import { addPolarToRef, subtractPolarToRef, multiplyPolarToRef, dividePolarToRef, scalePolarToRef, polarToVec2ToRef, polarFromVec2ToRef, addSphericalToRef, subtractSphericalToRef, multiplySphericalToRef, divideSphericalToRef, scaleSphericalToRef, sphericalToVec3ToRef, sphericalFromVec3ToRef, sampleHermiteSpline, sampleCatmullRomSpline, VERSION, createEngine, onBeforeRender, stopEngine, resizeEngine, setEngineSize, disposeEngine, uploadImageToArrayLayer, enableMirroredMeshes, registerSceneWithShadowSupport, registerScene, startEngine, createNullEngine, stepScene, setPhysicsTimestep, setPhysicsGravity, disposePhysics, createHavokWorld, enableHavokThinInstancePhysicsSync, createPhysicsShape, createPhysicsAggregate, createPhysicsBody, setPhysicsBodyPrestepType, PhysicsPrestepType as PhysicsPrestepType$1, PhysicsMotionType as PhysicsMotionType$1, setPhysicsBodyShape, setPhysicsBodyMotionType, setPhysicsBodyMassProperties, setPhysicsBodyLinearVelocity, getPhysicsBodyLinearVelocity, setPhysicsBodyAngularVelocity, getPhysicsBodyAngularVelocity, applyPhysicsBodyImpulse, applyPhysicsBodyForce, removePhysicsBody, createPhysicsCharacterController, calculatePhysicsCharacterMovementToRef, createPhysicsConstraint, releasePhysicsConstraint, physicsRaycast, PhysicsShapeType as PhysicsShapeType$1, setPhysicsShapeFilterMembershipMask, setPhysicsShapeFilterCollideMask, setPhysicsShapeMaterial, setPhysicsShapeIsTrigger, releasePhysicsShape, CharacterSupportedState as CharacterSupportedState$1, PhysicsConstraintType as PhysicsConstraintType$1, PhysicsConstraintAxis as PhysicsConstraintAxis$1, createArcRotateCamera, attachControl, enableOrthographicCamera, disableOrthographicCamera, getCameraPosition, getViewMatrix, getProjectionMatrix, createBankedFreeCamera, createGeospatialCamera, setGeospatialOrientation, attachGeospatialControls, createFreeCamera, attachFreeControl, setAnimationAdditive, playAnimation, pauseAnimation, goToFrame, stopAnimation, createSceneContext, updateAnimationManager, setFog, setClipPlane, loadHdrEnvironment, loadDdsEnvironment, loadEnvironment, createDefaultCamera, addToScene, createHemisphericLight, resolveCameraViewport, invertMat4, multiplyMat4, createPickingRay, pickMeshesWithRay, onPhysicsAfterStep, createAnimationManager, enableAnimationBlending, addAnimationGroup, disposeScene, createDirectionalLight, removeFromScene, createPointLight, createSpotLight, createClusteredLightContainer, createClusteredPointLight, addClusteredLightContainer, markClusteredLightContainerDirty, createCsgFromMesh, csgSubtract, csgIntersect, csgUnion, createMeshFromCsg, createCsg2FromMesh, csg2Subtract, csg2Intersect, csg2Add, createMeshesFromCsg2, disposeCsg2, initializeCsg2Async, createMorphTargets, setMorphTargetWeights, createTransformNode, bakeCurrentTransformIntoVertices, loadSOG, loadSPZ, loadSplat, createDynamicTexture, updateDynamicTexture, createHtmlTexture, whenHtmlTextureReady, requestHtmlTextureUpdate, updateHtmlTexture, disposeHtmlTexture, createTexture2DFromPixels, updateTexture2DFromPixels, createTexture3DFromPixels, loadBasisTexture2D, loadKtxTexture2D, loadTexture2D, createTexture2DArrayFromUrls, createTexture2DArrayFromKtx2, loadImageToArrayLayer, createTexture2DArray, createTexture2DArrayFromPixels, updateTexture2DArrayFromPixels, setBonePosition, setBoneRotationQuaternion, setBoneScaling, clearBoneOverride, getBoneByName, enableBoneControlForSkinnedAssets, 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, setShadowTaskCasterMeshes, createCsmDirectionalShadowGenerator, createPcfSpotlightShadowGenerator, createPcfDirectionalShadowGenerator, createEsmDirectionalShadowGenerator, parseNodeMaterialFromSnippet, createGridMaterial, getByteFrequencyData, getFloatFrequencyData, getByteTimeDomainData, getFloatTimeDomainData, enableAnalyzer, setSpatialPosition, setSpatialOrientation, enableSpatial, setSpatialListenerPosition, setSpatialListener, updateSpatialAudio, enableStereo, setStereoPan, disposeAudioBus, setBusVolume, getMasterVolume, setMasterVolume, unlockAudioEngineAsync, createSoundAsync, createSoundBufferAsync, createStreamingSoundAsync, createAudioBusAsync, createSoundSourceAsync, createMicrophoneSoundSourceAsync, disposeAudioEngine, createAudioEngineAsync, disposeSoundSource, setSoundSourceVolume, playSound, pauseSound, resumeSound, stopSound, disposeSound, setSoundVolume, playStreamingSound, pauseStreamingSound, resumeStreamingSound, stopStreamingSound, preloadStreamingInstanceAsync, preloadStreamingInstancesAsync, disposeStreamingSound, setStreamingSoundVolume, startParticleSystem, animateParticleSystem, stopParticleSystem, createParticleBillboard, syncParticleBillboard, parseNodeParticleSetFromSnippet, registerNodeParticleSet } from "@babylonjs/lite";
|
|
7
7
|
const Epsilon = 1e-3;
|
|
8
8
|
const ToRadians = Math.PI / 180;
|
|
9
9
|
const ToDegrees = 180 / Math.PI;
|
|
@@ -146,7 +146,7 @@ class Ray {
|
|
|
146
146
|
return temp <= rr;
|
|
147
147
|
}
|
|
148
148
|
static Zero() {
|
|
149
|
-
return new Ray(Vector3.Zero(),
|
|
149
|
+
return new Ray(Vector3.Zero(), Vector3.Zero(), Number.MAX_VALUE);
|
|
150
150
|
}
|
|
151
151
|
static CreateNew(x2, y2, z2, dx, dy, dz, length = Number.MAX_VALUE) {
|
|
152
152
|
return new Ray(new Vector3(x2, y2, z2), new Vector3(dx, dy, dz), length);
|
|
@@ -1423,6 +1423,79 @@ var CharacterSupportedState = /* @__PURE__ */ ((CharacterSupportedState2) => {
|
|
|
1423
1423
|
CharacterSupportedState2[CharacterSupportedState2["SUPPORTED"] = 2] = "SUPPORTED";
|
|
1424
1424
|
return CharacterSupportedState2;
|
|
1425
1425
|
})(CharacterSupportedState || {});
|
|
1426
|
+
class CastingResult {
|
|
1427
|
+
constructor() {
|
|
1428
|
+
__publicField(this, "_hitNormal", Vector3.Zero());
|
|
1429
|
+
__publicField(this, "_hitPoint", Vector3.Zero());
|
|
1430
|
+
__publicField(this, "_hasHit", false);
|
|
1431
|
+
__publicField(this, "_triangleIndex", -1);
|
|
1432
|
+
__publicField(this, "body");
|
|
1433
|
+
__publicField(this, "bodyIndex");
|
|
1434
|
+
__publicField(this, "shape");
|
|
1435
|
+
}
|
|
1436
|
+
get hitPoint() {
|
|
1437
|
+
return this._hitPoint;
|
|
1438
|
+
}
|
|
1439
|
+
get hitNormal() {
|
|
1440
|
+
return this._hitNormal;
|
|
1441
|
+
}
|
|
1442
|
+
get hasHit() {
|
|
1443
|
+
return this._hasHit;
|
|
1444
|
+
}
|
|
1445
|
+
get triangleIndex() {
|
|
1446
|
+
return this._triangleIndex;
|
|
1447
|
+
}
|
|
1448
|
+
setHitData(hitNormal, hitPoint, triangleIndex) {
|
|
1449
|
+
this._hasHit = true;
|
|
1450
|
+
this._hitNormal.copyFromFloats(hitNormal.x, hitNormal.y, hitNormal.z);
|
|
1451
|
+
this._hitPoint.copyFromFloats(hitPoint.x, hitPoint.y, hitPoint.z);
|
|
1452
|
+
this._triangleIndex = triangleIndex ?? -1;
|
|
1453
|
+
}
|
|
1454
|
+
reset() {
|
|
1455
|
+
this._hasHit = false;
|
|
1456
|
+
this._hitNormal.setAll(0);
|
|
1457
|
+
this._hitPoint.setAll(0);
|
|
1458
|
+
this._triangleIndex = -1;
|
|
1459
|
+
this.body = void 0;
|
|
1460
|
+
this.bodyIndex = void 0;
|
|
1461
|
+
this.shape = void 0;
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
class PhysicsRaycastResult extends CastingResult {
|
|
1465
|
+
constructor() {
|
|
1466
|
+
super(...arguments);
|
|
1467
|
+
__publicField(this, "_hitDistance", 0);
|
|
1468
|
+
__publicField(this, "_rayFromWorld", Vector3.Zero());
|
|
1469
|
+
__publicField(this, "_rayToWorld", Vector3.Zero());
|
|
1470
|
+
}
|
|
1471
|
+
get hitDistance() {
|
|
1472
|
+
return this._hitDistance;
|
|
1473
|
+
}
|
|
1474
|
+
get hitNormalWorld() {
|
|
1475
|
+
return this._hitNormal;
|
|
1476
|
+
}
|
|
1477
|
+
get hitPointWorld() {
|
|
1478
|
+
return this._hitPoint;
|
|
1479
|
+
}
|
|
1480
|
+
get rayFromWorld() {
|
|
1481
|
+
return this._rayFromWorld;
|
|
1482
|
+
}
|
|
1483
|
+
get rayToWorld() {
|
|
1484
|
+
return this._rayToWorld;
|
|
1485
|
+
}
|
|
1486
|
+
setHitDistance(distance) {
|
|
1487
|
+
this._hitDistance = distance;
|
|
1488
|
+
}
|
|
1489
|
+
calculateHitDistance() {
|
|
1490
|
+
this._hitDistance = Vector3.Distance(this._rayFromWorld, this._hitPoint);
|
|
1491
|
+
}
|
|
1492
|
+
reset(from = Vector3.Zero(), to = Vector3.Zero()) {
|
|
1493
|
+
super.reset();
|
|
1494
|
+
this._rayFromWorld.copyFrom(from);
|
|
1495
|
+
this._rayToWorld.copyFrom(to);
|
|
1496
|
+
this._hitDistance = 0;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1426
1499
|
class Physics6DoFLimit {
|
|
1427
1500
|
constructor() {
|
|
1428
1501
|
__publicField(this, "axis");
|
|
@@ -2203,17 +2276,12 @@ class PhysicsAggregate {
|
|
|
2203
2276
|
}
|
|
2204
2277
|
}
|
|
2205
2278
|
function assertPhysicsNodeSupported(transformNode) {
|
|
2206
|
-
var _a;
|
|
2207
2279
|
if (transformNode.physicsBody) {
|
|
2208
2280
|
unsupported("PhysicsBody", "Babylon Lite synchronizes one physics body per scene node; dispose the existing TransformNode.physicsBody before attaching another.");
|
|
2209
2281
|
}
|
|
2210
2282
|
if (transformNode.parent || transformNode._node.parent) {
|
|
2211
2283
|
unsupported("PhysicsBody", "Babylon Lite physics bodies currently consume local transforms, so parented TransformNodes cannot be synchronized in Babylon.js world space.");
|
|
2212
2284
|
}
|
|
2213
|
-
const mesh = transformNode._node;
|
|
2214
|
-
if ((_a = mesh.thinInstances) == null ? void 0 : _a.count) {
|
|
2215
|
-
unsupported("PhysicsBody", "Babylon Lite exposes one physics body per scene node and has no per-thin-instance body representation.");
|
|
2216
|
-
}
|
|
2217
2285
|
}
|
|
2218
2286
|
class HavokPlugin {
|
|
2219
2287
|
constructor(useDeltaForWorldStep = true, hpInjection) {
|
|
@@ -2288,6 +2356,7 @@ class HavokPlugin {
|
|
|
2288
2356
|
return unsupported("HavokPlugin", "The Havok module is not ready. `await HavokPhysics()` before constructing the plugin.");
|
|
2289
2357
|
}
|
|
2290
2358
|
this.world = createHavokWorld(liteScene, this._hknp, gravity);
|
|
2359
|
+
enableHavokThinInstancePhysicsSync(this.world);
|
|
2291
2360
|
if (!this._useDeltaForWorldStep) {
|
|
2292
2361
|
setPhysicsTimestep(this.world, this._fixedTimeStep);
|
|
2293
2362
|
}
|
|
@@ -2323,15 +2392,54 @@ class PhysicsEngine {
|
|
|
2323
2392
|
getTimeStep() {
|
|
2324
2393
|
return this._plugin.getTimeStep();
|
|
2325
2394
|
}
|
|
2395
|
+
/** Cast a ray through the active Lite Havok world. */
|
|
2396
|
+
raycast(from, to, query) {
|
|
2397
|
+
const result = new PhysicsRaycastResult();
|
|
2398
|
+
this.raycastToRef(from, to, result, query);
|
|
2399
|
+
return result;
|
|
2400
|
+
}
|
|
2401
|
+
/** Cast a ray through the active Lite Havok world and write into `result`. */
|
|
2402
|
+
raycastToRef(from, to, result, query) {
|
|
2403
|
+
var _a;
|
|
2404
|
+
if (query == null ? void 0 : query.ignoreBody) {
|
|
2405
|
+
return unsupported(
|
|
2406
|
+
"PhysicsEngine.raycast.ignoreBody",
|
|
2407
|
+
"Lite's public raycast query does not accept an ignored body, and adding it would modify the shared Havok query hot path already used by scene bundles."
|
|
2408
|
+
);
|
|
2409
|
+
}
|
|
2410
|
+
const world = this._plugin.world;
|
|
2411
|
+
if (!world) {
|
|
2412
|
+
return unsupported("PhysicsEngine.raycast", "Call `scene.enablePhysics(...)` before issuing physics queries.");
|
|
2413
|
+
}
|
|
2414
|
+
const liteQuery = {
|
|
2415
|
+
membership: query == null ? void 0 : query.membership,
|
|
2416
|
+
collideWith: query == null ? void 0 : query.collideWith,
|
|
2417
|
+
shouldHitTriggers: query == null ? void 0 : query.shouldHitTriggers
|
|
2418
|
+
};
|
|
2419
|
+
const hit = physicsRaycast(world, from, to, liteQuery);
|
|
2420
|
+
result.reset(from, to);
|
|
2421
|
+
if (!hit.hasHit) {
|
|
2422
|
+
return;
|
|
2423
|
+
}
|
|
2424
|
+
result.setHitData(hit.hitNormal, hit.hitPoint, hit.triangleIndex);
|
|
2425
|
+
result.setHitDistance(hit.hitDistance);
|
|
2426
|
+
result.body = hit.body ? getPhysicsBodyWrappers().get(hit.body) : void 0;
|
|
2427
|
+
result.shape = ((_a = result.body) == null ? void 0 : _a.shape) ?? void 0;
|
|
2428
|
+
result.bodyIndex = hit.bodyIndex;
|
|
2429
|
+
}
|
|
2326
2430
|
/** Release the underlying physics world. */
|
|
2327
2431
|
dispose() {
|
|
2328
2432
|
this._plugin.dispose();
|
|
2329
2433
|
}
|
|
2330
2434
|
}
|
|
2331
|
-
class
|
|
2435
|
+
const _Camera = class _Camera extends Node {
|
|
2332
2436
|
constructor(name, scene) {
|
|
2333
2437
|
super(name, scene);
|
|
2334
2438
|
__publicField(this, "_detach");
|
|
2439
|
+
__publicField(this, "_orthoLeft", null);
|
|
2440
|
+
__publicField(this, "_orthoRight", null);
|
|
2441
|
+
__publicField(this, "_orthoBottom", null);
|
|
2442
|
+
__publicField(this, "_orthoTop", null);
|
|
2335
2443
|
scene == null ? void 0 : scene._registerCamera(this);
|
|
2336
2444
|
}
|
|
2337
2445
|
getClassName() {
|
|
@@ -2355,6 +2463,80 @@ class Camera extends Node {
|
|
|
2355
2463
|
set maxZ(value) {
|
|
2356
2464
|
this._lite.farPlane = value;
|
|
2357
2465
|
}
|
|
2466
|
+
get orthoLeft() {
|
|
2467
|
+
return this._lite.ortho ? this._lite.ortho.left : this._orthoLeft;
|
|
2468
|
+
}
|
|
2469
|
+
set orthoLeft(value) {
|
|
2470
|
+
this._orthoLeft = value;
|
|
2471
|
+
if (this._lite.ortho) {
|
|
2472
|
+
this._lite.ortho.left = value;
|
|
2473
|
+
}
|
|
2474
|
+
}
|
|
2475
|
+
get orthoRight() {
|
|
2476
|
+
return this._lite.ortho ? this._lite.ortho.right : this._orthoRight;
|
|
2477
|
+
}
|
|
2478
|
+
set orthoRight(value) {
|
|
2479
|
+
this._orthoRight = value;
|
|
2480
|
+
if (this._lite.ortho) {
|
|
2481
|
+
this._lite.ortho.right = value;
|
|
2482
|
+
}
|
|
2483
|
+
}
|
|
2484
|
+
get orthoBottom() {
|
|
2485
|
+
return this._lite.ortho ? this._lite.ortho.bottom : this._orthoBottom;
|
|
2486
|
+
}
|
|
2487
|
+
set orthoBottom(value) {
|
|
2488
|
+
this._orthoBottom = value;
|
|
2489
|
+
if (this._lite.ortho) {
|
|
2490
|
+
this._lite.ortho.bottom = value;
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
get orthoTop() {
|
|
2494
|
+
return this._lite.ortho ? this._lite.ortho.top : this._orthoTop;
|
|
2495
|
+
}
|
|
2496
|
+
set orthoTop(value) {
|
|
2497
|
+
this._orthoTop = value;
|
|
2498
|
+
if (this._lite.ortho) {
|
|
2499
|
+
this._lite.ortho.top = value;
|
|
2500
|
+
}
|
|
2501
|
+
}
|
|
2502
|
+
get mode() {
|
|
2503
|
+
return this._lite.ortho ? _Camera.ORTHOGRAPHIC_CAMERA : _Camera.PERSPECTIVE_CAMERA;
|
|
2504
|
+
}
|
|
2505
|
+
set mode(value) {
|
|
2506
|
+
if (value === this.mode) {
|
|
2507
|
+
return;
|
|
2508
|
+
}
|
|
2509
|
+
if (value === _Camera.ORTHOGRAPHIC_CAMERA) {
|
|
2510
|
+
enableOrthographicCamera(this._lite, {
|
|
2511
|
+
left: this._orthoLeft,
|
|
2512
|
+
right: this._orthoRight,
|
|
2513
|
+
bottom: this._orthoBottom,
|
|
2514
|
+
top: this._orthoTop
|
|
2515
|
+
});
|
|
2516
|
+
return;
|
|
2517
|
+
}
|
|
2518
|
+
if (value === _Camera.PERSPECTIVE_CAMERA) {
|
|
2519
|
+
this._orthoLeft = this.orthoLeft;
|
|
2520
|
+
this._orthoRight = this.orthoRight;
|
|
2521
|
+
this._orthoBottom = this.orthoBottom;
|
|
2522
|
+
this._orthoTop = this.orthoTop;
|
|
2523
|
+
disableOrthographicCamera(this._lite);
|
|
2524
|
+
return;
|
|
2525
|
+
}
|
|
2526
|
+
unsupported("Camera.mode", `Projection mode ${value} is not supported.`);
|
|
2527
|
+
}
|
|
2528
|
+
get viewport() {
|
|
2529
|
+
const viewport = this._lite.viewport;
|
|
2530
|
+
if (viewport instanceof Viewport) {
|
|
2531
|
+
return viewport;
|
|
2532
|
+
}
|
|
2533
|
+
const compatViewport = viewport ? new Viewport(viewport.x, viewport.y, viewport.width, viewport.height) : new Viewport(0, 0, 1, 1);
|
|
2534
|
+
this._lite.viewport = compatViewport;
|
|
2535
|
+
return compatViewport;
|
|
2536
|
+
}
|
|
2537
|
+
set viewport(value) {
|
|
2538
|
+
this._lite.viewport = value;
|
|
2539
|
+
}
|
|
2358
2540
|
/** World-space position of the camera. */
|
|
2359
2541
|
get globalPosition() {
|
|
2360
2542
|
const p2 = getCameraPosition(this._lite);
|
|
@@ -2373,7 +2555,8 @@ class Camera extends Node {
|
|
|
2373
2555
|
const canvas = scene == null ? void 0 : scene.getEngine().getRenderingCanvas();
|
|
2374
2556
|
const w2 = (canvas == null ? void 0 : canvas.width) ?? 1;
|
|
2375
2557
|
const h2 = (canvas == null ? void 0 : canvas.height) ?? 1;
|
|
2376
|
-
|
|
2558
|
+
const viewport = this._lite.viewport;
|
|
2559
|
+
return h2 !== 0 && (!viewport || viewport.height !== 0) ? w2 / h2 * (viewport ? viewport.width / viewport.height : 1) : 1;
|
|
2377
2560
|
}
|
|
2378
2561
|
detachControl() {
|
|
2379
2562
|
if (this._detach) {
|
|
@@ -2390,7 +2573,10 @@ class Camera extends Node {
|
|
|
2390
2573
|
scene.activeCamera = this;
|
|
2391
2574
|
}
|
|
2392
2575
|
}
|
|
2393
|
-
}
|
|
2576
|
+
};
|
|
2577
|
+
__publicField(_Camera, "PERSPECTIVE_CAMERA", 0);
|
|
2578
|
+
__publicField(_Camera, "ORTHOGRAPHIC_CAMERA", 1);
|
|
2579
|
+
let Camera = _Camera;
|
|
2394
2580
|
class ArcRotateCamera extends Camera {
|
|
2395
2581
|
constructor(name, alpha, beta, radius, target, scene, adoptLite) {
|
|
2396
2582
|
super(name, scene);
|
|
@@ -3140,9 +3326,129 @@ class AnimationGroup {
|
|
|
3140
3326
|
}
|
|
3141
3327
|
}
|
|
3142
3328
|
}
|
|
3329
|
+
var ScenePerformancePriority = /* @__PURE__ */ ((ScenePerformancePriority2) => {
|
|
3330
|
+
ScenePerformancePriority2[ScenePerformancePriority2["BackwardCompatible"] = 0] = "BackwardCompatible";
|
|
3331
|
+
ScenePerformancePriority2[ScenePerformancePriority2["Intermediate"] = 1] = "Intermediate";
|
|
3332
|
+
ScenePerformancePriority2[ScenePerformancePriority2["Aggressive"] = 2] = "Aggressive";
|
|
3333
|
+
return ScenePerformancePriority2;
|
|
3334
|
+
})(ScenePerformancePriority || {});
|
|
3335
|
+
var ShaderLanguage = /* @__PURE__ */ ((ShaderLanguage2) => {
|
|
3336
|
+
ShaderLanguage2[ShaderLanguage2["GLSL"] = 0] = "GLSL";
|
|
3337
|
+
ShaderLanguage2[ShaderLanguage2["WGSL"] = 1] = "WGSL";
|
|
3338
|
+
return ShaderLanguage2;
|
|
3339
|
+
})(ShaderLanguage || {});
|
|
3340
|
+
class ImageProcessingConfiguration {
|
|
3341
|
+
constructor() {
|
|
3342
|
+
__publicField(this, "_backing", {
|
|
3343
|
+
exposure: 1,
|
|
3344
|
+
contrast: 1,
|
|
3345
|
+
toneMappingEnabled: false
|
|
3346
|
+
});
|
|
3347
|
+
}
|
|
3348
|
+
/** @internal Attach this facade to a scene's Babylon Lite state. */
|
|
3349
|
+
_attach(backing) {
|
|
3350
|
+
this._backing = backing;
|
|
3351
|
+
return this;
|
|
3352
|
+
}
|
|
3353
|
+
get exposure() {
|
|
3354
|
+
return this._backing.exposure;
|
|
3355
|
+
}
|
|
3356
|
+
set exposure(value) {
|
|
3357
|
+
this._backing.exposure = value;
|
|
3358
|
+
}
|
|
3359
|
+
get contrast() {
|
|
3360
|
+
return this._backing.contrast;
|
|
3361
|
+
}
|
|
3362
|
+
set contrast(value) {
|
|
3363
|
+
this._backing.contrast = value;
|
|
3364
|
+
}
|
|
3365
|
+
get toneMappingEnabled() {
|
|
3366
|
+
return this._backing.toneMappingEnabled;
|
|
3367
|
+
}
|
|
3368
|
+
set toneMappingEnabled(value) {
|
|
3369
|
+
this._backing.toneMappingEnabled = value;
|
|
3370
|
+
}
|
|
3371
|
+
get whiteBalanceEnabled() {
|
|
3372
|
+
return false;
|
|
3373
|
+
}
|
|
3374
|
+
set whiteBalanceEnabled(value) {
|
|
3375
|
+
if (value) {
|
|
3376
|
+
unsupported("ImageProcessingConfiguration.whiteBalanceEnabled", WHITE_BALANCE_UNSUPPORTED$1);
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
get temperature() {
|
|
3380
|
+
return 6500;
|
|
3381
|
+
}
|
|
3382
|
+
set temperature(value) {
|
|
3383
|
+
if (value !== 6500) {
|
|
3384
|
+
unsupported("ImageProcessingConfiguration.temperature", WHITE_BALANCE_UNSUPPORTED$1);
|
|
3385
|
+
}
|
|
3386
|
+
}
|
|
3387
|
+
get tint() {
|
|
3388
|
+
return 0;
|
|
3389
|
+
}
|
|
3390
|
+
set tint(value) {
|
|
3391
|
+
if (value !== 0) {
|
|
3392
|
+
unsupported("ImageProcessingConfiguration.tint", WHITE_BALANCE_UNSUPPORTED$1);
|
|
3393
|
+
}
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
__publicField(ImageProcessingConfiguration, "TONEMAPPING_STANDARD", 0);
|
|
3397
|
+
__publicField(ImageProcessingConfiguration, "TONEMAPPING_ACES", 1);
|
|
3398
|
+
__publicField(ImageProcessingConfiguration, "TONEMAPPING_KHR_PBR_NEUTRAL", 2);
|
|
3399
|
+
const WHITE_BALANCE_UNSUPPORTED$1 = "White balance requires color-temperature math, a shader uniform, material/post-process defines, and pipeline invalidation that Babylon Lite does not expose; adding it needs a cross-cutting Lite subsystem design.";
|
|
3400
|
+
function RegisterImageProcessingConfiguration() {
|
|
3401
|
+
return unsupported("RegisterImageProcessingConfiguration", "Babylon Lite has no Babylon.js SerializationHelper parser registry to install ImageProcessingConfiguration into.");
|
|
3402
|
+
}
|
|
3403
|
+
function RegisterAbstractEngineTextureLoaders() {
|
|
3404
|
+
}
|
|
3405
|
+
const Constants = {
|
|
3406
|
+
MATERIAL_ClockWiseSideOrientation: 0,
|
|
3407
|
+
MATERIAL_CounterClockWiseSideOrientation: 1,
|
|
3408
|
+
MATERIAL_TriangleFillMode: 0,
|
|
3409
|
+
MATERIAL_WireFrameFillMode: 1,
|
|
3410
|
+
MATERIAL_PointFillMode: 2,
|
|
3411
|
+
ALPHA_DISABLE: 0,
|
|
3412
|
+
ALPHA_ADD: 1,
|
|
3413
|
+
ALPHA_COMBINE: 2,
|
|
3414
|
+
ALPHA_ONEONE: 6,
|
|
3415
|
+
ALPHA_PREMULTIPLIED: 7,
|
|
3416
|
+
ALPHA_REPLACE_COLOR: 21,
|
|
3417
|
+
MATERIAL_OPAQUE: 0,
|
|
3418
|
+
MATERIAL_ALPHATEST: 1,
|
|
3419
|
+
MATERIAL_ALPHABLEND: 2,
|
|
3420
|
+
TEXTURE_CLAMP_ADDRESSMODE: 0,
|
|
3421
|
+
TEXTURE_WRAP_ADDRESSMODE: 1,
|
|
3422
|
+
TEXTURE_MIRROR_ADDRESSMODE: 2,
|
|
3423
|
+
TEXTURE_NEAREST_SAMPLINGMODE: 1,
|
|
3424
|
+
TEXTURE_BILINEAR_SAMPLINGMODE: 2,
|
|
3425
|
+
TEXTURE_TRILINEAR_SAMPLINGMODE: 3,
|
|
3426
|
+
TEXTUREFORMAT_RGBA: 5,
|
|
3427
|
+
TEXTURETYPE_UNSIGNED_BYTE: 0
|
|
3428
|
+
};
|
|
3429
|
+
class PointerEventTypes {
|
|
3430
|
+
}
|
|
3431
|
+
__publicField(PointerEventTypes, "POINTERDOWN", 1);
|
|
3432
|
+
__publicField(PointerEventTypes, "POINTERUP", 2);
|
|
3433
|
+
__publicField(PointerEventTypes, "POINTERMOVE", 4);
|
|
3434
|
+
__publicField(PointerEventTypes, "POINTERWHEEL", 8);
|
|
3435
|
+
__publicField(PointerEventTypes, "POINTERPICK", 16);
|
|
3436
|
+
__publicField(PointerEventTypes, "POINTERTAP", 32);
|
|
3437
|
+
__publicField(PointerEventTypes, "POINTERDOUBLETAP", 64);
|
|
3438
|
+
class PointerInfo {
|
|
3439
|
+
constructor(type, event, _pickInfo) {
|
|
3440
|
+
this.type = type;
|
|
3441
|
+
this.event = event;
|
|
3442
|
+
this._pickInfo = _pickInfo;
|
|
3443
|
+
}
|
|
3444
|
+
get pickInfo() {
|
|
3445
|
+
return this._pickInfo;
|
|
3446
|
+
}
|
|
3447
|
+
}
|
|
3143
3448
|
const DEFAULT_SKYBOX_URL = "https://assets.babylonjs.com/core/environments/backgroundSkybox.dds";
|
|
3144
3449
|
const DEFAULT_GROUND_URL = "https://assets.babylonjs.com/core/environments/backgroundGround.png";
|
|
3145
3450
|
const DEFAULT_ENV_URL = "https://assets.babylonjs.com/environments/environmentSpecular.env";
|
|
3451
|
+
const FLUID_RENDERER_UNSUPPORTED$1 = "Fluid rendering requires dedicated depth, thickness, and diffuse passes plus render-target lifecycle and composition policies that Babylon Lite does not define.";
|
|
3146
3452
|
async function getBrdfLutUrl() {
|
|
3147
3453
|
return (await import("./brdf-lut-data-BFfYlW71.js")).BRDF_LUT_DATA_URL;
|
|
3148
3454
|
}
|
|
@@ -3157,10 +3463,21 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
3157
3463
|
__publicField(this, "onBeforeAnimationsObservable", new Observable());
|
|
3158
3464
|
/** Fires after each scene render. */
|
|
3159
3465
|
__publicField(this, "onAfterRenderObservable", new Observable());
|
|
3466
|
+
/** Fires after each Lite Havok simulation step. */
|
|
3467
|
+
__publicField(this, "onAfterPhysicsObservable", new Observable());
|
|
3160
3468
|
/** Fires once when the scene is disposed. */
|
|
3161
3469
|
__publicField(this, "onDisposeObservable", new Observable());
|
|
3470
|
+
/** Babylon.js scene-level pointer events from the engine rendering canvas. */
|
|
3471
|
+
__publicField(this, "onPointerObservable", new Observable());
|
|
3472
|
+
/** @internal Callbacks that must run after Babylon.js-compatible before-render observers. */
|
|
3473
|
+
__publicField(this, "_beforeRenderFlushCallbacks", /* @__PURE__ */ new Set());
|
|
3474
|
+
/** @internal Canvas target that owns this scene's pointer listeners. */
|
|
3475
|
+
__publicField(this, "_pointerEventTarget", null);
|
|
3476
|
+
/** @internal Shared listener registered for each supported DOM pointer event. */
|
|
3477
|
+
__publicField(this, "_pointerEventListener", null);
|
|
3162
3478
|
__publicField(this, "_engine");
|
|
3163
3479
|
__publicField(this, "_activeCamera", null);
|
|
3480
|
+
__publicField(this, "cameraToUseForPointers", null);
|
|
3164
3481
|
__publicField(this, "_defaultMaterial", null);
|
|
3165
3482
|
__publicField(this, "_fogMode", 0);
|
|
3166
3483
|
__publicField(this, "_fogStart", 0);
|
|
@@ -3191,6 +3508,7 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
3191
3508
|
__publicField(this, "_blendManager", null);
|
|
3192
3509
|
__publicField(this, "_ambientColor", new Color3(0, 0, 0));
|
|
3193
3510
|
__publicField(this, "_environmentIntensity", 1);
|
|
3511
|
+
__publicField(this, "_imageProcessingConfiguration", null);
|
|
3194
3512
|
/** @internal Tracks whether at least one frame has ticked (gates `onAfterRenderObservable`). */
|
|
3195
3513
|
__publicField(this, "_renderedAFrame", false);
|
|
3196
3514
|
/** @internal `NodeMaterial`s whose async parse the engine drives after shadow generators are built. */
|
|
@@ -3212,6 +3530,7 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
3212
3530
|
/** @internal The active Physics V2 engine, once `enablePhysics` has wired one. */
|
|
3213
3531
|
__publicField(this, "_physicsEngine", null);
|
|
3214
3532
|
this._engine = engine;
|
|
3533
|
+
this._attachPointerEvents();
|
|
3215
3534
|
if (engine._headless) {
|
|
3216
3535
|
this._lite = createSceneContext(engine._lite, { defaultRenderTask: false });
|
|
3217
3536
|
onBeforeRender(this._lite, (deltaMs) => this._tick(deltaMs));
|
|
@@ -3247,6 +3566,46 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
3247
3566
|
get animatables() {
|
|
3248
3567
|
return this._runningAnimatables;
|
|
3249
3568
|
}
|
|
3569
|
+
_attachPointerEvents() {
|
|
3570
|
+
const canvas = this._engine.getRenderingCanvas();
|
|
3571
|
+
if (typeof canvas.addEventListener !== "function" || typeof canvas.removeEventListener !== "function") {
|
|
3572
|
+
return;
|
|
3573
|
+
}
|
|
3574
|
+
this._pointerEventTarget = canvas;
|
|
3575
|
+
this._pointerEventListener = (event) => {
|
|
3576
|
+
let type;
|
|
3577
|
+
switch (event.type) {
|
|
3578
|
+
case "pointerdown":
|
|
3579
|
+
type = PointerEventTypes.POINTERDOWN;
|
|
3580
|
+
break;
|
|
3581
|
+
case "pointermove":
|
|
3582
|
+
type = PointerEventTypes.POINTERMOVE;
|
|
3583
|
+
break;
|
|
3584
|
+
case "pointerup":
|
|
3585
|
+
type = PointerEventTypes.POINTERUP;
|
|
3586
|
+
break;
|
|
3587
|
+
case "wheel":
|
|
3588
|
+
type = PointerEventTypes.POINTERWHEEL;
|
|
3589
|
+
break;
|
|
3590
|
+
default:
|
|
3591
|
+
return;
|
|
3592
|
+
}
|
|
3593
|
+
this.onPointerObservable.notifyObservers(new PointerInfo(type, event, null), type);
|
|
3594
|
+
};
|
|
3595
|
+
for (const type of ["pointerdown", "pointermove", "pointerup", "wheel"]) {
|
|
3596
|
+
this._pointerEventTarget.addEventListener(type, this._pointerEventListener);
|
|
3597
|
+
}
|
|
3598
|
+
}
|
|
3599
|
+
_detachPointerEvents() {
|
|
3600
|
+
if (!this._pointerEventTarget || !this._pointerEventListener) {
|
|
3601
|
+
return;
|
|
3602
|
+
}
|
|
3603
|
+
for (const type of ["pointerdown", "pointermove", "pointerup", "wheel"]) {
|
|
3604
|
+
this._pointerEventTarget.removeEventListener(type, this._pointerEventListener);
|
|
3605
|
+
}
|
|
3606
|
+
this._pointerEventTarget = null;
|
|
3607
|
+
this._pointerEventListener = null;
|
|
3608
|
+
}
|
|
3250
3609
|
/**
|
|
3251
3610
|
* @internal Per-frame update: advance CPU animations and fire the render
|
|
3252
3611
|
* observables. Driven by Babylon Lite's before-render hook for GPU engines, or
|
|
@@ -3272,6 +3631,16 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
3272
3631
|
}
|
|
3273
3632
|
this._renderedAFrame = true;
|
|
3274
3633
|
this.onBeforeRenderObservable.notifyObservers(this);
|
|
3634
|
+
for (const callback of this._beforeRenderFlushCallbacks) {
|
|
3635
|
+
callback();
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
/** @internal Register work that must observe all compat before-render mutations before Lite renders. */
|
|
3639
|
+
_registerBeforeRenderFlush(callback) {
|
|
3640
|
+
this._beforeRenderFlushCallbacks.add(callback);
|
|
3641
|
+
return () => {
|
|
3642
|
+
this._beforeRenderFlushCallbacks.delete(callback);
|
|
3643
|
+
};
|
|
3275
3644
|
}
|
|
3276
3645
|
/**
|
|
3277
3646
|
* @internal The Lite-core-owned mesh list backing `scene.meshes`. Babylon Lite's
|
|
@@ -3480,9 +3849,23 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
3480
3849
|
}
|
|
3481
3850
|
FreeCamera._adopt("camera", this._lite.camera, this);
|
|
3482
3851
|
}
|
|
3483
|
-
/**
|
|
3852
|
+
/** Babylon.js image-processing facade over the scene's Lite state. */
|
|
3484
3853
|
get imageProcessingConfiguration() {
|
|
3485
|
-
|
|
3854
|
+
this._imageProcessingConfiguration ?? (this._imageProcessingConfiguration = new ImageProcessingConfiguration()._attach(this._lite.imageProcessing));
|
|
3855
|
+
return this._imageProcessingConfiguration;
|
|
3856
|
+
}
|
|
3857
|
+
get fluidRenderer() {
|
|
3858
|
+
return null;
|
|
3859
|
+
}
|
|
3860
|
+
set fluidRenderer(value) {
|
|
3861
|
+
if (value !== null) {
|
|
3862
|
+
unsupported("Scene.fluidRenderer", FLUID_RENDERER_UNSUPPORTED$1);
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
enableFluidRenderer() {
|
|
3866
|
+
return unsupported("Scene.enableFluidRenderer", FLUID_RENDERER_UNSUPPORTED$1);
|
|
3867
|
+
}
|
|
3868
|
+
disableFluidRenderer() {
|
|
3486
3869
|
}
|
|
3487
3870
|
/**
|
|
3488
3871
|
* Babylon.js `scene.ambientColor` — the scene-wide ambient term multiplied into
|
|
@@ -3753,12 +4136,51 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
3753
4136
|
isReady() {
|
|
3754
4137
|
return true;
|
|
3755
4138
|
}
|
|
3756
|
-
/**
|
|
3757
|
-
pick() {
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
4139
|
+
/** Babylon.js synchronous screen-coordinate picking over Lite's CPU ray picker. */
|
|
4140
|
+
pick(x2, y2, predicate, fastCheck = false, camera = null, trianglePredicate) {
|
|
4141
|
+
if (fastCheck || trianglePredicate) {
|
|
4142
|
+
return unsupported(
|
|
4143
|
+
"Scene.pick",
|
|
4144
|
+
"Babylon Lite's synchronous picker returns the nearest bounding-box hit and does not expose fast-first-hit or per-triangle predicate modes."
|
|
4145
|
+
);
|
|
4146
|
+
}
|
|
4147
|
+
const cameraToUse = camera ?? this.activeCamera ?? this.cameraToUseForPointers;
|
|
4148
|
+
if (!cameraToUse) {
|
|
4149
|
+
return new PickingInfo();
|
|
4150
|
+
}
|
|
4151
|
+
return this.pickWithRay(this.createPickingRay(x2, y2, null, cameraToUse), predicate);
|
|
4152
|
+
}
|
|
4153
|
+
/**
|
|
4154
|
+
* Babylon.js `Scene.createPickingRay` — translate CSS coordinates and camera
|
|
4155
|
+
* transforms into Lite's reverse-Z unprojection helper.
|
|
4156
|
+
*/
|
|
4157
|
+
createPickingRay(x2, y2, world = null, camera = null, cameraViewSpace = false) {
|
|
4158
|
+
const cameraToUse = camera ?? this.activeCamera ?? this.cameraToUseForPointers;
|
|
4159
|
+
if (!cameraToUse) {
|
|
4160
|
+
return Ray.Zero();
|
|
4161
|
+
}
|
|
4162
|
+
const scale = this._engine.getHardwareScalingLevel();
|
|
4163
|
+
const width = this._engine.getRenderWidth();
|
|
4164
|
+
const height = this._engine.getRenderHeight();
|
|
4165
|
+
const viewport = resolveCameraViewport(cameraToUse._lite, width, height);
|
|
4166
|
+
const worldMatrix = (world ?? Matrix.Identity()).m;
|
|
4167
|
+
const projectionMatrix = cameraToUse.getProjectionMatrix().m;
|
|
4168
|
+
let viewMatrix = Matrix.Identity().m;
|
|
4169
|
+
if (!cameraViewSpace && cameraToUse._lite._useFloatingOrigin) {
|
|
4170
|
+
const absoluteView = invertMat4(cameraToUse._lite.worldMatrix);
|
|
4171
|
+
if (!absoluteView) {
|
|
4172
|
+
return Ray.Zero();
|
|
4173
|
+
}
|
|
4174
|
+
viewMatrix = absoluteView;
|
|
4175
|
+
} else if (!cameraViewSpace) {
|
|
4176
|
+
viewMatrix = cameraToUse.getViewMatrix().m;
|
|
4177
|
+
}
|
|
4178
|
+
const transform = multiplyMat4(projectionMatrix, multiplyMat4(viewMatrix, worldMatrix));
|
|
4179
|
+
const liteRay = createPickingRay(x2 / scale - viewport.x, y2 / scale - viewport.y, transform, viewport.width, viewport.height);
|
|
4180
|
+
if (!liteRay) {
|
|
4181
|
+
return Ray.Zero();
|
|
4182
|
+
}
|
|
4183
|
+
return new Ray(new Vector3(liteRay.origin[0], liteRay.origin[1], liteRay.origin[2]), new Vector3(liteRay.direction[0], liteRay.direction[1], liteRay.direction[2]));
|
|
3762
4184
|
}
|
|
3763
4185
|
/** Synchronous CPU ray picking over Babylon Lite's scene-mesh picker. */
|
|
3764
4186
|
pickWithRay(ray, predicate, fastCheck = false, trianglePredicate) {
|
|
@@ -3823,6 +4245,7 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
3823
4245
|
}
|
|
3824
4246
|
const g2 = gravity ?? { x: 0, y: -9.81, z: 0 };
|
|
3825
4247
|
plugin._attachToLiteScene(this._lite, g2);
|
|
4248
|
+
onPhysicsAfterStep(plugin.world, () => this.onAfterPhysicsObservable.notifyObservers(this));
|
|
3826
4249
|
this._physicsEngine = new PhysicsEngine(plugin, g2);
|
|
3827
4250
|
return true;
|
|
3828
4251
|
}
|
|
@@ -3896,7 +4319,10 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
3896
4319
|
return this.beginDirectAnimation(target, target.animations ?? [], from, to, loop, speedRatio);
|
|
3897
4320
|
}
|
|
3898
4321
|
dispose() {
|
|
4322
|
+
this._detachPointerEvents();
|
|
3899
4323
|
this.onDisposeObservable.notifyObservers(this);
|
|
4324
|
+
this.onPointerObservable.clear();
|
|
4325
|
+
this._beforeRenderFlushCallbacks.clear();
|
|
3900
4326
|
disposeScene(this._lite);
|
|
3901
4327
|
}
|
|
3902
4328
|
};
|
|
@@ -3987,9 +4413,13 @@ class Light extends Node {
|
|
|
3987
4413
|
this._lite.shadowGenerator = void 0;
|
|
3988
4414
|
}
|
|
3989
4415
|
}
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
4416
|
+
/** @internal Detach Lite-owned state when this node is disposed directly or through an ancestor. */
|
|
4417
|
+
_disposeSelf(_doNotRecurse) {
|
|
4418
|
+
if (this._scene) {
|
|
4419
|
+
removeFromScene(this._scene._lite, this._lite);
|
|
4420
|
+
} else {
|
|
4421
|
+
this._lite.shadowGenerator = void 0;
|
|
4422
|
+
}
|
|
3993
4423
|
}
|
|
3994
4424
|
}
|
|
3995
4425
|
function ensureLightVersionBump(lite) {
|
|
@@ -4822,6 +5252,85 @@ class BaseTexture {
|
|
|
4822
5252
|
dispose() {
|
|
4823
5253
|
}
|
|
4824
5254
|
}
|
|
5255
|
+
class HtmlTexture extends BaseTexture {
|
|
5256
|
+
constructor(name, element, options) {
|
|
5257
|
+
var _a, _b;
|
|
5258
|
+
super();
|
|
5259
|
+
__publicField(this, "element");
|
|
5260
|
+
__publicField(this, "host");
|
|
5261
|
+
__publicField(this, "onLoadObservable", new Observable(void 0, true));
|
|
5262
|
+
__publicField(this, "_engine");
|
|
5263
|
+
__publicField(this, "_textureMatrix", Matrix.Identity());
|
|
5264
|
+
__publicField(this, "_ready");
|
|
5265
|
+
__publicField(this, "_htmlTexture");
|
|
5266
|
+
__publicField(this, "_disposed", false);
|
|
5267
|
+
this.name = name;
|
|
5268
|
+
this.element = element;
|
|
5269
|
+
this._engine = ((_a = options.scene) == null ? void 0 : _a.getEngine()) ?? options.engine ?? null;
|
|
5270
|
+
this.host = ((_b = this._engine) == null ? void 0 : _b.getRenderingCanvas()) ?? null;
|
|
5271
|
+
if (!this._engine || !element) {
|
|
5272
|
+
this._ready = Promise.reject(new Error("HtmlTexture requires an engine and HTML element."));
|
|
5273
|
+
void this._ready.catch(() => void 0);
|
|
5274
|
+
return;
|
|
5275
|
+
}
|
|
5276
|
+
if (options.format !== void 0 && options.format !== 5) {
|
|
5277
|
+
unsupported("HtmlTexture.format", "Babylon Lite HTML textures use RGBA8; alternate Babylon.js texture formats require a new native upload/storage contract.");
|
|
5278
|
+
}
|
|
5279
|
+
const nearest = options.samplingMode === Texture.NEAREST_SAMPLINGMODE || options.samplingMode === Texture.NEAREST_NEAREST;
|
|
5280
|
+
const htmlTexture = createHtmlTexture(this._engine._lite, element, {
|
|
5281
|
+
width: options.width,
|
|
5282
|
+
height: options.height,
|
|
5283
|
+
mipMaps: options.generateMipMaps ?? false,
|
|
5284
|
+
autoUpdate: options.autoUpdate ?? true,
|
|
5285
|
+
useSvgFallback: options.useSvgFallback ?? true,
|
|
5286
|
+
minFilter: nearest ? "nearest" : "linear",
|
|
5287
|
+
magFilter: nearest ? "nearest" : "linear",
|
|
5288
|
+
invertY: true
|
|
5289
|
+
});
|
|
5290
|
+
this._htmlTexture = htmlTexture;
|
|
5291
|
+
this._ready = whenHtmlTextureReady(htmlTexture).then(() => {
|
|
5292
|
+
if (this._disposed) {
|
|
5293
|
+
throw new Error("HtmlTexture was disposed before its first upload completed.");
|
|
5294
|
+
}
|
|
5295
|
+
this._lite = htmlTexture;
|
|
5296
|
+
try {
|
|
5297
|
+
this.onLoadObservable.notifyObservers(this);
|
|
5298
|
+
} finally {
|
|
5299
|
+
this._notifyReady();
|
|
5300
|
+
}
|
|
5301
|
+
});
|
|
5302
|
+
void this._ready.catch(() => void 0);
|
|
5303
|
+
}
|
|
5304
|
+
getTextureMatrix() {
|
|
5305
|
+
return this._textureMatrix;
|
|
5306
|
+
}
|
|
5307
|
+
requestUpdate() {
|
|
5308
|
+
if (this._engine && this._htmlTexture) {
|
|
5309
|
+
requestHtmlTextureUpdate(this._engine._lite, this._htmlTexture);
|
|
5310
|
+
}
|
|
5311
|
+
}
|
|
5312
|
+
update(invertY = true) {
|
|
5313
|
+
if (this._engine && this._htmlTexture) {
|
|
5314
|
+
updateHtmlTexture(this._engine._lite, this._htmlTexture, invertY);
|
|
5315
|
+
}
|
|
5316
|
+
}
|
|
5317
|
+
getClassName() {
|
|
5318
|
+
return "HtmlTexture";
|
|
5319
|
+
}
|
|
5320
|
+
whenReadyAsync() {
|
|
5321
|
+
return this._ready;
|
|
5322
|
+
}
|
|
5323
|
+
dispose() {
|
|
5324
|
+
this._disposed = true;
|
|
5325
|
+
if (this._htmlTexture) {
|
|
5326
|
+
disposeHtmlTexture(this._htmlTexture);
|
|
5327
|
+
this._htmlTexture = void 0;
|
|
5328
|
+
}
|
|
5329
|
+
this._lite = void 0;
|
|
5330
|
+
this.onLoadObservable.clear();
|
|
5331
|
+
this.onLoadObservable.cleanLastNotifiedState();
|
|
5332
|
+
}
|
|
5333
|
+
}
|
|
4825
5334
|
const _Texture = class _Texture extends BaseTexture {
|
|
4826
5335
|
constructor(url, sceneOrEngine, noMipmapOrOptions, invertY, _samplingMode, onLoad) {
|
|
4827
5336
|
var _a;
|
|
@@ -5169,46 +5678,6 @@ class RenderTargetTexture {
|
|
|
5169
5678
|
unsupported("RenderTargetTexture", "Offscreen rendering uses Babylon Lite's frame-graph render-target APIs (`createRenderTargetTexture` / render tasks).");
|
|
5170
5679
|
}
|
|
5171
5680
|
}
|
|
5172
|
-
var ScenePerformancePriority = /* @__PURE__ */ ((ScenePerformancePriority2) => {
|
|
5173
|
-
ScenePerformancePriority2[ScenePerformancePriority2["BackwardCompatible"] = 0] = "BackwardCompatible";
|
|
5174
|
-
ScenePerformancePriority2[ScenePerformancePriority2["Intermediate"] = 1] = "Intermediate";
|
|
5175
|
-
ScenePerformancePriority2[ScenePerformancePriority2["Aggressive"] = 2] = "Aggressive";
|
|
5176
|
-
return ScenePerformancePriority2;
|
|
5177
|
-
})(ScenePerformancePriority || {});
|
|
5178
|
-
var ShaderLanguage = /* @__PURE__ */ ((ShaderLanguage2) => {
|
|
5179
|
-
ShaderLanguage2[ShaderLanguage2["GLSL"] = 0] = "GLSL";
|
|
5180
|
-
ShaderLanguage2[ShaderLanguage2["WGSL"] = 1] = "WGSL";
|
|
5181
|
-
return ShaderLanguage2;
|
|
5182
|
-
})(ShaderLanguage || {});
|
|
5183
|
-
class ImageProcessingConfiguration {
|
|
5184
|
-
}
|
|
5185
|
-
__publicField(ImageProcessingConfiguration, "TONEMAPPING_STANDARD", 0);
|
|
5186
|
-
__publicField(ImageProcessingConfiguration, "TONEMAPPING_ACES", 1);
|
|
5187
|
-
__publicField(ImageProcessingConfiguration, "TONEMAPPING_KHR_PBR_NEUTRAL", 2);
|
|
5188
|
-
const Constants = {
|
|
5189
|
-
MATERIAL_ClockWiseSideOrientation: 0,
|
|
5190
|
-
MATERIAL_CounterClockWiseSideOrientation: 1,
|
|
5191
|
-
MATERIAL_TriangleFillMode: 0,
|
|
5192
|
-
MATERIAL_WireFrameFillMode: 1,
|
|
5193
|
-
MATERIAL_PointFillMode: 2,
|
|
5194
|
-
ALPHA_DISABLE: 0,
|
|
5195
|
-
ALPHA_ADD: 1,
|
|
5196
|
-
ALPHA_COMBINE: 2,
|
|
5197
|
-
ALPHA_ONEONE: 6,
|
|
5198
|
-
ALPHA_PREMULTIPLIED: 7,
|
|
5199
|
-
ALPHA_REPLACE_COLOR: 21,
|
|
5200
|
-
MATERIAL_OPAQUE: 0,
|
|
5201
|
-
MATERIAL_ALPHATEST: 1,
|
|
5202
|
-
MATERIAL_ALPHABLEND: 2,
|
|
5203
|
-
TEXTURE_CLAMP_ADDRESSMODE: 0,
|
|
5204
|
-
TEXTURE_WRAP_ADDRESSMODE: 1,
|
|
5205
|
-
TEXTURE_MIRROR_ADDRESSMODE: 2,
|
|
5206
|
-
TEXTURE_NEAREST_SAMPLINGMODE: 1,
|
|
5207
|
-
TEXTURE_BILINEAR_SAMPLINGMODE: 2,
|
|
5208
|
-
TEXTURE_TRILINEAR_SAMPLINGMODE: 3,
|
|
5209
|
-
TEXTUREFORMAT_RGBA: 5,
|
|
5210
|
-
TEXTURETYPE_UNSIGNED_BYTE: 0
|
|
5211
|
-
};
|
|
5212
5681
|
class RawTexture2DArray extends BaseTexture {
|
|
5213
5682
|
constructor(data, width, height, depth, format, scene, generateMipMaps = true, _invertY = false, _samplingMode = 3, _textureType, _creationFlags, _mipLevelCount) {
|
|
5214
5683
|
super();
|
|
@@ -6684,6 +7153,10 @@ class ShadowGenerator {
|
|
|
6684
7153
|
__publicField(this, "_mapSize");
|
|
6685
7154
|
__publicField(this, "_light");
|
|
6686
7155
|
__publicField(this, "_casters", []);
|
|
7156
|
+
__publicField(this, "_casterDisposeObservers", /* @__PURE__ */ new Map());
|
|
7157
|
+
__publicField(this, "_casterSyncScheduled", false);
|
|
7158
|
+
__publicField(this, "_casterSyncDirty", false);
|
|
7159
|
+
__publicField(this, "_disposeBeforeRenderFlush");
|
|
6687
7160
|
/** @internal The built Lite shadow generator (set in `_build`). Used to wire NME receivers. */
|
|
6688
7161
|
__publicField(this, "_liteGen");
|
|
6689
7162
|
// ── BJS technique flags / tunables (read at build time) ──
|
|
@@ -6714,26 +7187,91 @@ class ShadowGenerator {
|
|
|
6714
7187
|
const scene = light.getScene();
|
|
6715
7188
|
if (scene) {
|
|
6716
7189
|
scene._registerShadowGenerator(this);
|
|
7190
|
+
this._disposeBeforeRenderFlush = scene._registerBeforeRenderFlush(() => this._flushCasterSync());
|
|
6717
7191
|
}
|
|
6718
7192
|
}
|
|
6719
7193
|
getClassName() {
|
|
6720
7194
|
return "ShadowGenerator";
|
|
6721
7195
|
}
|
|
6722
7196
|
/** Babylon.js `addShadowCaster(mesh, includeDescendants?)`. */
|
|
6723
|
-
addShadowCaster(mesh,
|
|
6724
|
-
|
|
6725
|
-
|
|
7197
|
+
addShadowCaster(mesh, includeDescendants = true) {
|
|
7198
|
+
let changed = false;
|
|
7199
|
+
for (const caster of this._casterTree(mesh, includeDescendants)) {
|
|
7200
|
+
if (!this._casters.some((existing) => existing._lite === caster._lite)) {
|
|
7201
|
+
this._casters.push(caster);
|
|
7202
|
+
this._detachCasterDisposeObserver(caster._lite);
|
|
7203
|
+
const observer = () => this._removeCaster(caster._lite, true, observer);
|
|
7204
|
+
caster.onDisposeObservable.add(observer);
|
|
7205
|
+
this._casterDisposeObservers.set(caster._lite, { caster, observer });
|
|
7206
|
+
changed = true;
|
|
7207
|
+
}
|
|
7208
|
+
}
|
|
7209
|
+
if (changed) {
|
|
7210
|
+
this._scheduleCasterSync();
|
|
6726
7211
|
}
|
|
6727
7212
|
return this;
|
|
6728
7213
|
}
|
|
6729
|
-
/** Babylon.js `removeShadowCaster(mesh)`. */
|
|
6730
|
-
removeShadowCaster(mesh) {
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
this.
|
|
7214
|
+
/** Babylon.js `removeShadowCaster(mesh, includeDescendants?)`. */
|
|
7215
|
+
removeShadowCaster(mesh, includeDescendants = true) {
|
|
7216
|
+
let changed = false;
|
|
7217
|
+
for (const caster of this._casterTree(mesh, includeDescendants)) {
|
|
7218
|
+
changed = this._removeCaster(caster._lite, false) || changed;
|
|
7219
|
+
}
|
|
7220
|
+
if (changed) {
|
|
7221
|
+
this._scheduleCasterSync();
|
|
6734
7222
|
}
|
|
6735
7223
|
return this;
|
|
6736
7224
|
}
|
|
7225
|
+
_casterTree(mesh, includeDescendants) {
|
|
7226
|
+
return includeDescendants ? [mesh, ...mesh.getChildMeshes()] : [mesh];
|
|
7227
|
+
}
|
|
7228
|
+
_detachCasterDisposeObserver(liteMesh) {
|
|
7229
|
+
const registration = this._casterDisposeObservers.get(liteMesh);
|
|
7230
|
+
if (registration) {
|
|
7231
|
+
registration.caster.onDisposeObservable.remove(registration.observer);
|
|
7232
|
+
this._casterDisposeObservers.delete(liteMesh);
|
|
7233
|
+
}
|
|
7234
|
+
}
|
|
7235
|
+
_removeCaster(liteMesh, scheduleSync = true, expectedObserver) {
|
|
7236
|
+
const registration = this._casterDisposeObservers.get(liteMesh);
|
|
7237
|
+
if (expectedObserver && (registration == null ? void 0 : registration.observer) !== expectedObserver) {
|
|
7238
|
+
return false;
|
|
7239
|
+
}
|
|
7240
|
+
const index = this._casters.findIndex((existing) => existing._lite === liteMesh);
|
|
7241
|
+
const changed = index !== -1;
|
|
7242
|
+
if (changed) {
|
|
7243
|
+
this._casters.splice(index, 1);
|
|
7244
|
+
}
|
|
7245
|
+
this._detachCasterDisposeObserver(liteMesh);
|
|
7246
|
+
if (changed && scheduleSync) {
|
|
7247
|
+
this._scheduleCasterSync();
|
|
7248
|
+
}
|
|
7249
|
+
return changed;
|
|
7250
|
+
}
|
|
7251
|
+
_scheduleCasterSync() {
|
|
7252
|
+
if (!this._liteGen) {
|
|
7253
|
+
return;
|
|
7254
|
+
}
|
|
7255
|
+
this._casterSyncDirty = true;
|
|
7256
|
+
if (this._casterSyncScheduled) {
|
|
7257
|
+
return;
|
|
7258
|
+
}
|
|
7259
|
+
this._casterSyncScheduled = true;
|
|
7260
|
+
queueMicrotask(() => {
|
|
7261
|
+
this._casterSyncScheduled = false;
|
|
7262
|
+
this._flushCasterSync();
|
|
7263
|
+
});
|
|
7264
|
+
}
|
|
7265
|
+
_flushCasterSync() {
|
|
7266
|
+
if (!this._casterSyncDirty || !this._liteGen) {
|
|
7267
|
+
return;
|
|
7268
|
+
}
|
|
7269
|
+
this._casterSyncDirty = false;
|
|
7270
|
+
setShadowTaskCasterMeshes(
|
|
7271
|
+
this._liteGen,
|
|
7272
|
+
this._casters.map((caster) => caster._lite)
|
|
7273
|
+
);
|
|
7274
|
+
}
|
|
6737
7275
|
/** Babylon.js `getShadowMap()` — returns a minimal render-list holder for parity. */
|
|
6738
7276
|
getShadowMap() {
|
|
6739
7277
|
return { renderList: this._casters };
|
|
@@ -6749,6 +7287,15 @@ class ShadowGenerator {
|
|
|
6749
7287
|
return this._light;
|
|
6750
7288
|
}
|
|
6751
7289
|
dispose() {
|
|
7290
|
+
var _a;
|
|
7291
|
+
(_a = this._disposeBeforeRenderFlush) == null ? void 0 : _a.call(this);
|
|
7292
|
+
for (const { caster, observer } of this._casterDisposeObservers.values()) {
|
|
7293
|
+
caster.onDisposeObservable.remove(observer);
|
|
7294
|
+
}
|
|
7295
|
+
this._casterDisposeObservers.clear();
|
|
7296
|
+
this._casterSyncScheduled = false;
|
|
7297
|
+
this._casterSyncDirty = false;
|
|
7298
|
+
this._liteGen = void 0;
|
|
6752
7299
|
this._light._lite.shadowGenerator = void 0;
|
|
6753
7300
|
}
|
|
6754
7301
|
/**
|
|
@@ -6803,6 +7350,7 @@ class ShadowGenerator {
|
|
|
6803
7350
|
}
|
|
6804
7351
|
liteLight.shadowGenerator = liteGen;
|
|
6805
7352
|
this._liteGen = liteGen;
|
|
7353
|
+
this._casterSyncDirty = false;
|
|
6806
7354
|
const casterMeshes = this._casters.map((m2) => m2._lite);
|
|
6807
7355
|
setShadowTaskCasterMeshes(liteGen, casterMeshes);
|
|
6808
7356
|
}
|
|
@@ -8485,6 +9033,59 @@ function CreateSoundSourceAsync(name, source, options, engine) {
|
|
|
8485
9033
|
function CreateMicrophoneSoundSourceAsync(name, options, engine) {
|
|
8486
9034
|
return resolveEngine(engine).createMicrophoneSoundSourceAsync(name, options);
|
|
8487
9035
|
}
|
|
9036
|
+
const WHITE_BALANCE_UNSUPPORTED = "White balance requires color-temperature math, a shader uniform, material/post-process defines, and pipeline invalidation that Babylon Lite does not expose; adding it needs a cross-cutting Lite subsystem design.";
|
|
9037
|
+
const FLUID_RENDERER_UNSUPPORTED = "Fluid rendering requires dedicated depth, thickness, and diffuse passes plus render-target lifecycle and composition policies that Babylon Lite does not define.";
|
|
9038
|
+
const USD_LOADER_UNSUPPORTED = "OpenUSD loading requires an OpenUSD WebAssembly worker, virtual-file staging, command-buffer extraction, and a USD-to-Lite scene/material materializer; those form a new loader subsystem with unresolved ownership and material-mapping design.";
|
|
9039
|
+
class USDFileLoader {
|
|
9040
|
+
constructor(_options = {}) {
|
|
9041
|
+
unsupported("USDFileLoader", USD_LOADER_UNSUPPORTED);
|
|
9042
|
+
}
|
|
9043
|
+
}
|
|
9044
|
+
function RegisterUSDFileLoader() {
|
|
9045
|
+
return unsupported("RegisterUSDFileLoader", USD_LOADER_UNSUPPORTED);
|
|
9046
|
+
}
|
|
9047
|
+
const MinTemperatureKelvin = 1e6 / 600;
|
|
9048
|
+
const MaxTintMagnitude = 150;
|
|
9049
|
+
function TemperatureTintToXyz(_temperatureKelvin, _tint) {
|
|
9050
|
+
return unsupported("TemperatureTintToXyz", WHITE_BALANCE_UNSUPPORTED);
|
|
9051
|
+
}
|
|
9052
|
+
function GetWhiteBalanceMatrix(_temperatureKelvin, _tint) {
|
|
9053
|
+
return unsupported("GetWhiteBalanceMatrix", WHITE_BALANCE_UNSUPPORTED);
|
|
9054
|
+
}
|
|
9055
|
+
class FluidRenderingObject {
|
|
9056
|
+
constructor(_scene, _shaderLanguage) {
|
|
9057
|
+
unsupported("FluidRenderingObject", FLUID_RENDERER_UNSUPPORTED);
|
|
9058
|
+
}
|
|
9059
|
+
}
|
|
9060
|
+
__publicField(FluidRenderingObject, "UsePerParticleSizeAttribute", false);
|
|
9061
|
+
class FluidRenderingObjectParticleSystem extends FluidRenderingObject {
|
|
9062
|
+
constructor(scene, _particleSystem, shaderLanguage) {
|
|
9063
|
+
super(scene, shaderLanguage);
|
|
9064
|
+
}
|
|
9065
|
+
}
|
|
9066
|
+
class FluidRenderingObjectCustomParticles extends FluidRenderingObject {
|
|
9067
|
+
constructor(scene, _buffers, _numParticles, shaderLanguage) {
|
|
9068
|
+
super(scene, shaderLanguage);
|
|
9069
|
+
}
|
|
9070
|
+
}
|
|
9071
|
+
class FluidRenderingTargetRenderer {
|
|
9072
|
+
constructor(_scene, _camera, _shaderLanguage) {
|
|
9073
|
+
unsupported("FluidRenderingTargetRenderer", FLUID_RENDERER_UNSUPPORTED);
|
|
9074
|
+
}
|
|
9075
|
+
}
|
|
9076
|
+
class FluidRenderer {
|
|
9077
|
+
constructor(_scene) {
|
|
9078
|
+
unsupported("FluidRenderer", FLUID_RENDERER_UNSUPPORTED);
|
|
9079
|
+
}
|
|
9080
|
+
}
|
|
9081
|
+
class FluidRendererSceneComponent {
|
|
9082
|
+
constructor(_scene) {
|
|
9083
|
+
unsupported("FluidRendererSceneComponent", FLUID_RENDERER_UNSUPPORTED);
|
|
9084
|
+
}
|
|
9085
|
+
}
|
|
9086
|
+
function RegisterFluidRenderer() {
|
|
9087
|
+
unsupported("RegisterFluidRenderer", FLUID_RENDERER_UNSUPPORTED);
|
|
9088
|
+
}
|
|
8488
9089
|
class MultiMaterial {
|
|
8489
9090
|
constructor() {
|
|
8490
9091
|
unsupported("MultiMaterial", "Babylon Lite uses one material per renderable. Split the mesh geometry by material into separate meshes instead.");
|
|
@@ -8770,11 +9371,6 @@ class MirrorTexture {
|
|
|
8770
9371
|
unsupported("MirrorTexture", "Mirror/reflection textures are not implemented in Babylon Lite. Build one from a native render-target texture + clip plane if required.");
|
|
8771
9372
|
}
|
|
8772
9373
|
}
|
|
8773
|
-
class HtmlTexture {
|
|
8774
|
-
constructor() {
|
|
8775
|
-
unsupported("HtmlTexture", "Rendering a live DOM element into a texture is a host-page/DOM feature with no Babylon Lite equivalent.");
|
|
8776
|
-
}
|
|
8777
|
-
}
|
|
8778
9374
|
class HtmlInteractionManager {
|
|
8779
9375
|
constructor() {
|
|
8780
9376
|
unsupported("HtmlInteractionManager", "HTML overlay interaction is not part of Babylon Lite's WebGPU renderer.");
|
|
@@ -8785,8 +9381,11 @@ class HtmlRaycastInteractionManager {
|
|
|
8785
9381
|
unsupported("HtmlRaycastInteractionManager", "HTML overlay raycast interaction is not part of Babylon Lite's WebGPU renderer.");
|
|
8786
9382
|
}
|
|
8787
9383
|
}
|
|
8788
|
-
function IsHtmlInCanvasUploadSupported() {
|
|
8789
|
-
return unsupported(
|
|
9384
|
+
function IsHtmlInCanvasUploadSupported(engine) {
|
|
9385
|
+
return unsupported(
|
|
9386
|
+
"IsHtmlInCanvasUploadSupported",
|
|
9387
|
+
"Lite's HTML texture owns its element and texture together; it cannot back BJS's arbitrary InternalTexture upload contract."
|
|
9388
|
+
);
|
|
8790
9389
|
}
|
|
8791
9390
|
function UploadHtmlElementToTexture() {
|
|
8792
9391
|
return unsupported("UploadHtmlElementToTexture", "HTML-element texture upload is not supported by Babylon Lite.");
|
|
@@ -8901,6 +9500,46 @@ const gltf2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
8901
9500
|
__proto__: null,
|
|
8902
9501
|
OpenPBRMaterialLoadingAdapter
|
|
8903
9502
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
9503
|
+
const GLTF1_UNSUPPORTED = "Babylon Lite only implements glTF 2.0; glTF 1.0 needs a separate parser, extension registry, and material conversion subsystem.";
|
|
9504
|
+
class GLTFLoaderBase {
|
|
9505
|
+
constructor(..._args) {
|
|
9506
|
+
unsupported("GLTF1.GLTFLoaderBase", GLTF1_UNSUPPORTED);
|
|
9507
|
+
}
|
|
9508
|
+
}
|
|
9509
|
+
class GLTFLoader {
|
|
9510
|
+
constructor(..._args) {
|
|
9511
|
+
unsupported("GLTF1.GLTFLoader", GLTF1_UNSUPPORTED);
|
|
9512
|
+
}
|
|
9513
|
+
}
|
|
9514
|
+
class GLTFBinaryExtension {
|
|
9515
|
+
constructor(..._args) {
|
|
9516
|
+
unsupported("GLTF1.GLTFBinaryExtension", GLTF1_UNSUPPORTED);
|
|
9517
|
+
}
|
|
9518
|
+
}
|
|
9519
|
+
class GLTFMaterialsCommonExtension {
|
|
9520
|
+
constructor(..._args) {
|
|
9521
|
+
unsupported("GLTF1.GLTFMaterialsCommonExtension", GLTF1_UNSUPPORTED);
|
|
9522
|
+
}
|
|
9523
|
+
}
|
|
9524
|
+
function RegisterGLTF1Loader() {
|
|
9525
|
+
unsupported("GLTF1.RegisterGLTF1Loader", GLTF1_UNSUPPORTED);
|
|
9526
|
+
}
|
|
9527
|
+
function RegisterGLTFBinaryExtension() {
|
|
9528
|
+
unsupported("GLTF1.RegisterGLTFBinaryExtension", GLTF1_UNSUPPORTED);
|
|
9529
|
+
}
|
|
9530
|
+
function RegisterGLTFMaterialsCommonExtension() {
|
|
9531
|
+
unsupported("GLTF1.RegisterGLTFMaterialsCommonExtension", GLTF1_UNSUPPORTED);
|
|
9532
|
+
}
|
|
9533
|
+
const gltf1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9534
|
+
__proto__: null,
|
|
9535
|
+
GLTFBinaryExtension,
|
|
9536
|
+
GLTFLoader,
|
|
9537
|
+
GLTFLoaderBase,
|
|
9538
|
+
GLTFMaterialsCommonExtension,
|
|
9539
|
+
RegisterGLTF1Loader,
|
|
9540
|
+
RegisterGLTFBinaryExtension,
|
|
9541
|
+
RegisterGLTFMaterialsCommonExtension
|
|
9542
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
8904
9543
|
class ReflectionProbe {
|
|
8905
9544
|
constructor() {
|
|
8906
9545
|
unsupported("ReflectionProbe", "Dynamic reflection probes are not implemented in Babylon Lite.");
|
|
@@ -9446,6 +10085,7 @@ export {
|
|
|
9446
10085
|
CameraGizmo,
|
|
9447
10086
|
CannonJSPlugin,
|
|
9448
10087
|
CascadedShadowGenerator,
|
|
10088
|
+
CastingResult,
|
|
9449
10089
|
CharacterSupportedState,
|
|
9450
10090
|
ChromaticAberrationPostProcess,
|
|
9451
10091
|
CircleEase,
|
|
@@ -9508,6 +10148,12 @@ export {
|
|
|
9508
10148
|
FSR1RenderingPipeline,
|
|
9509
10149
|
FactorGradient,
|
|
9510
10150
|
FadeInOutBehavior,
|
|
10151
|
+
FluidRenderer,
|
|
10152
|
+
FluidRendererSceneComponent,
|
|
10153
|
+
FluidRenderingObject,
|
|
10154
|
+
FluidRenderingObjectCustomParticles,
|
|
10155
|
+
FluidRenderingObjectParticleSystem,
|
|
10156
|
+
FluidRenderingTargetRenderer,
|
|
9511
10157
|
FlyCamera,
|
|
9512
10158
|
FollowBehavior,
|
|
9513
10159
|
FollowCamera,
|
|
@@ -9515,6 +10161,7 @@ export {
|
|
|
9515
10161
|
FreeCamera,
|
|
9516
10162
|
Frustum,
|
|
9517
10163
|
FxaaPostProcess,
|
|
10164
|
+
gltf1 as GLTF1,
|
|
9518
10165
|
gltf2 as GLTF2,
|
|
9519
10166
|
GPUParticleSystem,
|
|
9520
10167
|
GPUPicker,
|
|
@@ -9528,6 +10175,7 @@ export {
|
|
|
9528
10175
|
GetElementPixelFromUv,
|
|
9529
10176
|
GetPointsCount,
|
|
9530
10177
|
GetSupportedSimultaneousLights,
|
|
10178
|
+
GetWhiteBalanceMatrix,
|
|
9531
10179
|
GizmoManager,
|
|
9532
10180
|
GlowLayer,
|
|
9533
10181
|
GreasedLineBaseMesh,
|
|
@@ -9577,9 +10225,11 @@ export {
|
|
|
9577
10225
|
t as Material,
|
|
9578
10226
|
MaterialGreasedLineDefines,
|
|
9579
10227
|
Matrix,
|
|
10228
|
+
MaxTintMagnitude,
|
|
9580
10229
|
Mesh,
|
|
9581
10230
|
v as MeshBuilder,
|
|
9582
10231
|
MeshoptCompression,
|
|
10232
|
+
MinTemperatureKelvin,
|
|
9583
10233
|
MirrorTexture,
|
|
9584
10234
|
MorphTarget,
|
|
9585
10235
|
MorphTargetManager,
|
|
@@ -9619,6 +10269,7 @@ export {
|
|
|
9619
10269
|
PhysicsEngine,
|
|
9620
10270
|
PhysicsMotionType,
|
|
9621
10271
|
PhysicsPrestepType,
|
|
10272
|
+
PhysicsRaycastResult,
|
|
9622
10273
|
PhysicsShape,
|
|
9623
10274
|
PhysicsShapeType,
|
|
9624
10275
|
PickingInfo,
|
|
@@ -9627,6 +10278,8 @@ export {
|
|
|
9627
10278
|
PlaneRotationGizmo,
|
|
9628
10279
|
PointLight,
|
|
9629
10280
|
PointerDragBehavior,
|
|
10281
|
+
PointerEventTypes,
|
|
10282
|
+
PointerInfo,
|
|
9630
10283
|
PointsCloudSystem,
|
|
9631
10284
|
Polar,
|
|
9632
10285
|
PositionGizmo,
|
|
@@ -9647,8 +10300,12 @@ export {
|
|
|
9647
10300
|
RecastJSPlugin,
|
|
9648
10301
|
RectAreaLight,
|
|
9649
10302
|
ReflectionProbe,
|
|
10303
|
+
RegisterAbstractEngineTextureLoaders,
|
|
10304
|
+
RegisterFluidRenderer,
|
|
9650
10305
|
RegisterGreasedLinePluginMaterial,
|
|
10306
|
+
RegisterImageProcessingConfiguration,
|
|
9651
10307
|
RegisterOpenpbrMaterial,
|
|
10308
|
+
RegisterUSDFileLoader,
|
|
9652
10309
|
RenderTargetTexture,
|
|
9653
10310
|
RotationGizmo,
|
|
9654
10311
|
SSAO2RenderingPipeline,
|
|
@@ -9692,6 +10349,7 @@ export {
|
|
|
9692
10349
|
SurfaceMagnetismBehavior,
|
|
9693
10350
|
Tags,
|
|
9694
10351
|
TargetCamera,
|
|
10352
|
+
TemperatureTintToXyz,
|
|
9695
10353
|
Texture,
|
|
9696
10354
|
ThinEngine,
|
|
9697
10355
|
ThinFSR1SharpenPostProcess,
|
|
@@ -9702,6 +10360,7 @@ export {
|
|
|
9702
10360
|
Tools,
|
|
9703
10361
|
TouchCamera,
|
|
9704
10362
|
TransformNode,
|
|
10363
|
+
USDFileLoader,
|
|
9705
10364
|
UninstallHtmlInCanvasPolyfill,
|
|
9706
10365
|
UniversalCamera,
|
|
9707
10366
|
UploadHtmlElementToTexture,
|