@babylonjs/lite-compat 1.24.0-preview → 1.26.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 +1 -1
- package/index.d.ts +296 -23
- package/index.js +1105 -144
- package/index.js.map +1 -1
- package/{meshes-CidWpEh8.js → meshes-nWGELV98.js} +141 -37
- package/meshes-nWGELV98.js.map +1 -0
- package/navigation.d.ts +156 -5
- package/navigation.js +1 -1
- package/package.json +4 -4
- package/meshes-CidWpEh8.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, u as unsupported, L as LiteCompatError, N as Node, M as Matrix, C as Color3, S as StandardMaterial,
|
|
5
|
-
import {
|
|
6
|
-
import { sampleHermiteSpline, sampleCatmullRomSpline, VERSION, createEngine, onBeforeRender, stopEngine, resizeEngine, setEngineSize, disposeEngine, uploadImageToArrayLayer, enableMirroredMeshes, registerSceneWithShadowSupport, registerScene, startEngine, createNullEngine, stepScene, setPhysicsTimestep, setPhysicsGravity, disposePhysics, createHavokWorld, createArcRotateCamera, attachControl, getCameraPosition, getViewMatrix, getProjectionMatrix, createGeospatialCamera, setGeospatialOrientation, attachGeospatialControls, createFreeCamera, attachFreeControl, setAnimationAdditive, playAnimation, pauseAnimation, goToFrame, stopAnimation, createSceneContext, updateAnimationManager, setFog, setClipPlane, loadHdrEnvironment, loadDdsEnvironment, loadEnvironment, createDefaultCamera, addToScene, createHemisphericLight, createAnimationManager, enableAnimationBlending, addAnimationGroup, disposeScene, createDirectionalLight, createPointLight, createSpotLight, createClusteredLightContainer, createClusteredPointLight, removeFromScene, addClusteredLightContainer, markClusteredLightContainerDirty, createCsgFromMesh, csgSubtract, csgIntersect, csgUnion, createMeshFromCsg, createCsg2FromMesh, csg2Subtract, csg2Intersect, csg2Add, createMeshesFromCsg2, disposeCsg2, initializeCsg2Async, createMorphTargets, setMorphTargetWeights, createTransformNode, bakeCurrentTransformIntoVertices, loadSOG, loadSPZ, loadSplat, createDynamicTexture, updateDynamicTexture, createTexture2DFromPixels, updateTexture2DFromPixels, createTexture3DFromPixels, loadBasisTexture2D, loadKtxTexture2D, loadTexture2D, createTexture2DArrayFromUrls, createTexture2DArrayFromKtx2, loadImageToArrayLayer, createTexture2DArray, createTexture2DArrayFromPixels, updateTexture2DArrayFromPixels, 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, 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";
|
|
4
|
+
import { V as Vector3, a as Vector2, u as unsupported, O as Observable, L as LiteCompatError, N as Node, M as Matrix, C as Color3, S as StandardMaterial, b as Color4, A as AbstractMesh, c as Mesh, T as TransformNode, l as liteBackedVector3, Q as Quaternion } from "./meshes-nWGELV98.js";
|
|
5
|
+
import { B, d, e, f, g, h, i, j, k, m, n, o, p, q, r, G, I, s, t, v, P, w, x, y, z, D, E, F, H, J, K, R, U } from "./meshes-nWGELV98.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, createPhysicsShape, createPhysicsAggregate, createPhysicsBody, setPhysicsBodyPrestepType, PhysicsPrestepType as PhysicsPrestepType$1, PhysicsMotionType as PhysicsMotionType$1, setPhysicsBodyShape, setPhysicsBodyMotionType, setPhysicsBodyMassProperties, setPhysicsBodyLinearVelocity, getPhysicsBodyLinearVelocity, setPhysicsBodyAngularVelocity, getPhysicsBodyAngularVelocity, applyPhysicsBodyImpulse, applyPhysicsBodyForce, removePhysicsBody, createPhysicsCharacterController, calculatePhysicsCharacterMovementToRef, PhysicsShapeType as PhysicsShapeType$1, setPhysicsShapeFilterMembershipMask, setPhysicsShapeFilterCollideMask, setPhysicsShapeMaterial, setPhysicsShapeIsTrigger, releasePhysicsShape, createArcRotateCamera, attachControl, getCameraPosition, getViewMatrix, getProjectionMatrix, 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, removeFromScene, addClusteredLightContainer, markClusteredLightContainerDirty, createCsgFromMesh, csgSubtract, csgIntersect, csgUnion, createMeshFromCsg, createCsg2FromMesh, csg2Subtract, csg2Intersect, csg2Add, createMeshesFromCsg2, disposeCsg2, initializeCsg2Async, createMorphTargets, setMorphTargetWeights, createTransformNode, bakeCurrentTransformIntoVertices, loadSOG, loadSPZ, loadSplat, createDynamicTexture, updateDynamicTexture, 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, createPcfSpotlightShadowGenerator, createPcfDirectionalShadowGenerator, createEsmDirectionalShadowGenerator, setShadowTaskCasterMeshes, 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;
|
|
@@ -54,11 +54,11 @@ var Space = /* @__PURE__ */ ((Space2) => {
|
|
|
54
54
|
return Space2;
|
|
55
55
|
})(Space || {});
|
|
56
56
|
class Plane {
|
|
57
|
-
constructor(a, b,
|
|
57
|
+
constructor(a, b, c, d2) {
|
|
58
58
|
/** Normal x/y/z and signed distance `d` from the origin (`normal · p + d = 0`). */
|
|
59
59
|
__publicField(this, "normal");
|
|
60
60
|
__publicField(this, "d");
|
|
61
|
-
this.normal = new Vector3(a, b,
|
|
61
|
+
this.normal = new Vector3(a, b, c);
|
|
62
62
|
this.d = d2;
|
|
63
63
|
}
|
|
64
64
|
asArray() {
|
|
@@ -173,8 +173,8 @@ const Frustum = {
|
|
|
173
173
|
set(planes[5], m2[3] - m2[2], m2[7] - m2[6], m2[11] - m2[10], m2[15] - m2[14]);
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
|
-
function set(plane, a, b,
|
|
177
|
-
plane.normal.set(a, b,
|
|
176
|
+
function set(plane, a, b, c, d2) {
|
|
177
|
+
plane.normal.set(a, b, c);
|
|
178
178
|
plane.d = d2;
|
|
179
179
|
plane.normalize();
|
|
180
180
|
}
|
|
@@ -214,6 +214,220 @@ class Viewport {
|
|
|
214
214
|
return new Viewport(this.x, this.y, this.width, this.height);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
+
class Polar {
|
|
218
|
+
constructor(radius, theta) {
|
|
219
|
+
this.radius = radius;
|
|
220
|
+
this.theta = theta;
|
|
221
|
+
}
|
|
222
|
+
getClassName() {
|
|
223
|
+
return "Polar";
|
|
224
|
+
}
|
|
225
|
+
toString() {
|
|
226
|
+
return JSON.stringify(this);
|
|
227
|
+
}
|
|
228
|
+
asArray() {
|
|
229
|
+
return [this.radius, this.theta];
|
|
230
|
+
}
|
|
231
|
+
addToRef(polar, ref) {
|
|
232
|
+
return addPolarToRef(this, polar, ref);
|
|
233
|
+
}
|
|
234
|
+
add(polar) {
|
|
235
|
+
return this.addToRef(polar, new Polar(0, 0));
|
|
236
|
+
}
|
|
237
|
+
addInPlace(polar) {
|
|
238
|
+
this.addToRef(polar, this);
|
|
239
|
+
return this;
|
|
240
|
+
}
|
|
241
|
+
addInPlaceFromFloats(radius, theta) {
|
|
242
|
+
return this.addInPlace(new Polar(radius, theta));
|
|
243
|
+
}
|
|
244
|
+
subtractToRef(polar, ref) {
|
|
245
|
+
return subtractPolarToRef(this, polar, ref);
|
|
246
|
+
}
|
|
247
|
+
subtract(polar) {
|
|
248
|
+
return this.subtractToRef(polar, new Polar(0, 0));
|
|
249
|
+
}
|
|
250
|
+
subtractInPlace(polar) {
|
|
251
|
+
this.subtractToRef(polar, this);
|
|
252
|
+
return this;
|
|
253
|
+
}
|
|
254
|
+
subtractFromFloatsToRef(radius, theta, ref) {
|
|
255
|
+
return this.subtractToRef(new Polar(radius, theta), ref);
|
|
256
|
+
}
|
|
257
|
+
subtractFromFloats(radius, theta) {
|
|
258
|
+
return this.subtractFromFloatsToRef(radius, theta, new Polar(0, 0));
|
|
259
|
+
}
|
|
260
|
+
multiplyToRef(polar, ref) {
|
|
261
|
+
return multiplyPolarToRef(this, polar, ref);
|
|
262
|
+
}
|
|
263
|
+
multiply(polar) {
|
|
264
|
+
return this.multiplyToRef(polar, new Polar(0, 0));
|
|
265
|
+
}
|
|
266
|
+
multiplyInPlace(polar) {
|
|
267
|
+
this.multiplyToRef(polar, this);
|
|
268
|
+
return this;
|
|
269
|
+
}
|
|
270
|
+
divideToRef(polar, ref) {
|
|
271
|
+
return dividePolarToRef(this, polar, ref);
|
|
272
|
+
}
|
|
273
|
+
divide(polar) {
|
|
274
|
+
return this.divideToRef(polar, new Polar(0, 0));
|
|
275
|
+
}
|
|
276
|
+
divideInPlace(polar) {
|
|
277
|
+
this.divideToRef(polar, this);
|
|
278
|
+
return this;
|
|
279
|
+
}
|
|
280
|
+
clone() {
|
|
281
|
+
return new Polar(this.radius, this.theta);
|
|
282
|
+
}
|
|
283
|
+
copyFrom(source) {
|
|
284
|
+
return this.copyFromFloats(source.radius, source.theta);
|
|
285
|
+
}
|
|
286
|
+
copyFromFloats(radius, theta) {
|
|
287
|
+
this.radius = radius;
|
|
288
|
+
this.theta = theta;
|
|
289
|
+
return this;
|
|
290
|
+
}
|
|
291
|
+
scaleToRef(scale, ref) {
|
|
292
|
+
return scalePolarToRef(this, scale, ref);
|
|
293
|
+
}
|
|
294
|
+
scale(scale) {
|
|
295
|
+
return this.scaleToRef(scale, new Polar(0, 0));
|
|
296
|
+
}
|
|
297
|
+
scaleInPlace(scale) {
|
|
298
|
+
this.scaleToRef(scale, this);
|
|
299
|
+
return this;
|
|
300
|
+
}
|
|
301
|
+
set(radius, theta) {
|
|
302
|
+
return this.copyFromFloats(radius, theta);
|
|
303
|
+
}
|
|
304
|
+
setAll(value) {
|
|
305
|
+
return this.set(value, value);
|
|
306
|
+
}
|
|
307
|
+
toVector2ToRef(ref) {
|
|
308
|
+
return polarToVec2ToRef(this, ref);
|
|
309
|
+
}
|
|
310
|
+
toVector2() {
|
|
311
|
+
return this.toVector2ToRef(new Vector2());
|
|
312
|
+
}
|
|
313
|
+
static FromVector2ToRef(vector, ref) {
|
|
314
|
+
return polarFromVec2ToRef(vector, ref);
|
|
315
|
+
}
|
|
316
|
+
static FromVector2(vector) {
|
|
317
|
+
return Polar.FromVector2ToRef(vector, new Polar(0, 0));
|
|
318
|
+
}
|
|
319
|
+
static FromArray(array) {
|
|
320
|
+
return new Polar(array[0], array[1]);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
class Spherical {
|
|
324
|
+
constructor(radius, theta, phi) {
|
|
325
|
+
this.radius = radius;
|
|
326
|
+
this.theta = theta;
|
|
327
|
+
this.phi = phi;
|
|
328
|
+
}
|
|
329
|
+
getClassName() {
|
|
330
|
+
return "Spherical";
|
|
331
|
+
}
|
|
332
|
+
toString() {
|
|
333
|
+
return JSON.stringify(this);
|
|
334
|
+
}
|
|
335
|
+
asArray() {
|
|
336
|
+
return [this.radius, this.theta, this.phi];
|
|
337
|
+
}
|
|
338
|
+
addToRef(spherical, ref) {
|
|
339
|
+
return addSphericalToRef(this, spherical, ref);
|
|
340
|
+
}
|
|
341
|
+
add(spherical) {
|
|
342
|
+
return this.addToRef(spherical, new Spherical(0, 0, 0));
|
|
343
|
+
}
|
|
344
|
+
addInPlace(spherical) {
|
|
345
|
+
this.addToRef(spherical, this);
|
|
346
|
+
return this;
|
|
347
|
+
}
|
|
348
|
+
addInPlaceFromFloats(radius, theta, phi) {
|
|
349
|
+
return this.addInPlace(new Spherical(radius, theta, phi));
|
|
350
|
+
}
|
|
351
|
+
subtractToRef(spherical, ref) {
|
|
352
|
+
return subtractSphericalToRef(this, spherical, ref);
|
|
353
|
+
}
|
|
354
|
+
subtract(spherical) {
|
|
355
|
+
return this.subtractToRef(spherical, new Spherical(0, 0, 0));
|
|
356
|
+
}
|
|
357
|
+
subtractInPlace(spherical) {
|
|
358
|
+
this.subtractToRef(spherical, this);
|
|
359
|
+
return this;
|
|
360
|
+
}
|
|
361
|
+
subtractFromFloatsToRef(radius, theta, phi, ref) {
|
|
362
|
+
return this.subtractToRef(new Spherical(radius, theta, phi), ref);
|
|
363
|
+
}
|
|
364
|
+
subtractFromFloats(radius, theta, phi) {
|
|
365
|
+
return this.subtractFromFloatsToRef(radius, theta, phi, new Spherical(0, 0, 0));
|
|
366
|
+
}
|
|
367
|
+
multiplyToRef(spherical, ref) {
|
|
368
|
+
return multiplySphericalToRef(this, spherical, ref);
|
|
369
|
+
}
|
|
370
|
+
multiply(spherical) {
|
|
371
|
+
return this.multiplyToRef(spherical, new Spherical(0, 0, 0));
|
|
372
|
+
}
|
|
373
|
+
multiplyInPlace(spherical) {
|
|
374
|
+
this.multiplyToRef(spherical, this);
|
|
375
|
+
return this;
|
|
376
|
+
}
|
|
377
|
+
divideToRef(spherical, ref) {
|
|
378
|
+
return divideSphericalToRef(this, spherical, ref);
|
|
379
|
+
}
|
|
380
|
+
divide(spherical) {
|
|
381
|
+
return this.divideToRef(spherical, new Spherical(0, 0, 0));
|
|
382
|
+
}
|
|
383
|
+
divideInPlace(spherical) {
|
|
384
|
+
this.divideToRef(spherical, this);
|
|
385
|
+
return this;
|
|
386
|
+
}
|
|
387
|
+
clone() {
|
|
388
|
+
return new Spherical(this.radius, this.theta, this.phi);
|
|
389
|
+
}
|
|
390
|
+
copyFrom(source) {
|
|
391
|
+
return this.copyFromFloats(source.radius, source.theta, source.phi);
|
|
392
|
+
}
|
|
393
|
+
copyFromFloats(radius, theta, phi) {
|
|
394
|
+
this.radius = radius;
|
|
395
|
+
this.theta = theta;
|
|
396
|
+
this.phi = phi;
|
|
397
|
+
return this;
|
|
398
|
+
}
|
|
399
|
+
scaleToRef(scale, ref) {
|
|
400
|
+
return scaleSphericalToRef(this, scale, ref);
|
|
401
|
+
}
|
|
402
|
+
scale(scale) {
|
|
403
|
+
return this.scaleToRef(scale, new Spherical(0, 0, 0));
|
|
404
|
+
}
|
|
405
|
+
scaleInPlace(scale) {
|
|
406
|
+
this.scaleToRef(scale, this);
|
|
407
|
+
return this;
|
|
408
|
+
}
|
|
409
|
+
set(radius, theta, phi) {
|
|
410
|
+
return this.copyFromFloats(radius, theta, phi);
|
|
411
|
+
}
|
|
412
|
+
setAll(value) {
|
|
413
|
+
return this.set(value, value, value);
|
|
414
|
+
}
|
|
415
|
+
toVector3ToRef(ref) {
|
|
416
|
+
return sphericalToVec3ToRef(this, ref);
|
|
417
|
+
}
|
|
418
|
+
toVector3() {
|
|
419
|
+
return this.toVector3ToRef(new Vector3());
|
|
420
|
+
}
|
|
421
|
+
static FromVector3ToRef(vector, ref) {
|
|
422
|
+
return sphericalFromVec3ToRef(vector, ref);
|
|
423
|
+
}
|
|
424
|
+
static FromVector3(vector) {
|
|
425
|
+
return Spherical.FromVector3ToRef(vector, new Spherical(0, 0, 0));
|
|
426
|
+
}
|
|
427
|
+
static FromArray(array) {
|
|
428
|
+
return new Spherical(array[0], array[1], array[2]);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
217
431
|
class Angle {
|
|
218
432
|
constructor(_radians) {
|
|
219
433
|
this._radians = _radians;
|
|
@@ -317,6 +531,55 @@ class Path3D {
|
|
|
317
531
|
return this._distances;
|
|
318
532
|
}
|
|
319
533
|
}
|
|
534
|
+
class PickingInfo {
|
|
535
|
+
constructor() {
|
|
536
|
+
__publicField(this, "hit", false);
|
|
537
|
+
__publicField(this, "distance", 0);
|
|
538
|
+
__publicField(this, "pickedPoint", null);
|
|
539
|
+
__publicField(this, "pickedMesh", null);
|
|
540
|
+
__publicField(this, "bu", 0);
|
|
541
|
+
__publicField(this, "bv", 0);
|
|
542
|
+
__publicField(this, "faceId", -1);
|
|
543
|
+
__publicField(this, "subMeshFaceId", -1);
|
|
544
|
+
__publicField(this, "subMeshId", 0);
|
|
545
|
+
__publicField(this, "pickedSprite", null);
|
|
546
|
+
__publicField(this, "thinInstanceIndex", -1);
|
|
547
|
+
__publicField(this, "ray", null);
|
|
548
|
+
__publicField(this, "originMesh", null);
|
|
549
|
+
__publicField(this, "aimTransform", null);
|
|
550
|
+
__publicField(this, "gripTransform", null);
|
|
551
|
+
__publicField(this, "_normal", null);
|
|
552
|
+
__publicField(this, "_worldNormal", null);
|
|
553
|
+
}
|
|
554
|
+
/** @internal Create a compat result from Lite's synchronous CPU-picking result. */
|
|
555
|
+
static _fromLite(info, pickedMesh, ray) {
|
|
556
|
+
const result = new PickingInfo();
|
|
557
|
+
result.hit = info.hit && pickedMesh !== null;
|
|
558
|
+
result.distance = info.distance;
|
|
559
|
+
result.pickedPoint = result.hit && info.pickedPoint ? Vector3.FromArray(info.pickedPoint) : null;
|
|
560
|
+
result.pickedMesh = result.hit ? pickedMesh : null;
|
|
561
|
+
result.bu = info.bu;
|
|
562
|
+
result.bv = info.bv;
|
|
563
|
+
result.faceId = info.faceId;
|
|
564
|
+
result.subMeshFaceId = info.faceId;
|
|
565
|
+
result.subMeshId = info.subMeshId;
|
|
566
|
+
result.thinInstanceIndex = info.thinInstanceIndex;
|
|
567
|
+
result.ray = ray;
|
|
568
|
+
result._normal = info.pickedNormal ? Vector3.FromArray(info.pickedNormal) : null;
|
|
569
|
+
result._worldNormal = info.pickedNormalWorld ? Vector3.FromArray(info.pickedNormalWorld) : null;
|
|
570
|
+
return result;
|
|
571
|
+
}
|
|
572
|
+
getNormal(useWorldCoordinates = false, _useVerticesNormals = true) {
|
|
573
|
+
var _a, _b;
|
|
574
|
+
return useWorldCoordinates ? ((_a = this._worldNormal) == null ? void 0 : _a.clone()) ?? null : ((_b = this._normal) == null ? void 0 : _b.clone()) ?? null;
|
|
575
|
+
}
|
|
576
|
+
getTextureCoordinates(_uvSet) {
|
|
577
|
+
return unsupported(
|
|
578
|
+
"PickingInfo.getTextureCoordinates",
|
|
579
|
+
"Lite's synchronous CPU picker currently exposes AABB intersections only, so barycentric UV coordinates are unavailable."
|
|
580
|
+
);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
320
583
|
class SmartArray {
|
|
321
584
|
constructor(capacity) {
|
|
322
585
|
__publicField(this, "data");
|
|
@@ -515,63 +778,6 @@ const PrecisionDate = {
|
|
|
515
778
|
return now();
|
|
516
779
|
}
|
|
517
780
|
};
|
|
518
|
-
class Observable {
|
|
519
|
-
constructor(_onObserverAdded, notifyIfTriggered = false) {
|
|
520
|
-
__publicField(this, "_observers", []);
|
|
521
|
-
__publicField(this, "_hasNotified", false);
|
|
522
|
-
__publicField(this, "_lastNotifiedValue");
|
|
523
|
-
this._onObserverAdded = _onObserverAdded;
|
|
524
|
-
this.notifyIfTriggered = notifyIfTriggered;
|
|
525
|
-
}
|
|
526
|
-
add(callback) {
|
|
527
|
-
var _a;
|
|
528
|
-
this._observers.push(callback);
|
|
529
|
-
(_a = this._onObserverAdded) == null ? void 0 : _a.call(this, callback);
|
|
530
|
-
if (this._hasNotified && this.notifyIfTriggered && this._lastNotifiedValue !== void 0) {
|
|
531
|
-
callback(this._lastNotifiedValue);
|
|
532
|
-
}
|
|
533
|
-
return callback;
|
|
534
|
-
}
|
|
535
|
-
addOnce(callback) {
|
|
536
|
-
const wrapper = (eventData) => {
|
|
537
|
-
this.removeCallback(wrapper);
|
|
538
|
-
callback(eventData);
|
|
539
|
-
};
|
|
540
|
-
return this.add(wrapper);
|
|
541
|
-
}
|
|
542
|
-
remove(callback) {
|
|
543
|
-
return callback ? this.removeCallback(callback) : false;
|
|
544
|
-
}
|
|
545
|
-
removeCallback(callback) {
|
|
546
|
-
const index = this._observers.indexOf(callback);
|
|
547
|
-
if (index !== -1) {
|
|
548
|
-
this._observers.splice(index, 1);
|
|
549
|
-
return true;
|
|
550
|
-
}
|
|
551
|
-
return false;
|
|
552
|
-
}
|
|
553
|
-
notifyObservers(eventData) {
|
|
554
|
-
if (this.notifyIfTriggered) {
|
|
555
|
-
this._hasNotified = true;
|
|
556
|
-
this._lastNotifiedValue = eventData;
|
|
557
|
-
}
|
|
558
|
-
for (const observer of this._observers.slice()) {
|
|
559
|
-
observer(eventData);
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
hasObservers() {
|
|
563
|
-
return this._observers.length > 0;
|
|
564
|
-
}
|
|
565
|
-
clear() {
|
|
566
|
-
this._observers = [];
|
|
567
|
-
this._onObserverAdded = void 0;
|
|
568
|
-
this.cleanLastNotifiedState();
|
|
569
|
-
}
|
|
570
|
-
cleanLastNotifiedState() {
|
|
571
|
-
this._hasNotified = false;
|
|
572
|
-
this._lastNotifiedValue = void 0;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
781
|
async function runLateWork(work) {
|
|
576
782
|
try {
|
|
577
783
|
await work();
|
|
@@ -752,8 +958,8 @@ class AbstractEngine {
|
|
|
752
958
|
}
|
|
753
959
|
/** Babylon.js `engine.getRenderingCanvasClientRect()` — the canvas client rect, or `null` for offscreen canvases. */
|
|
754
960
|
getRenderingCanvasClientRect() {
|
|
755
|
-
const
|
|
756
|
-
return typeof
|
|
961
|
+
const c = this._canvas;
|
|
962
|
+
return typeof c.getBoundingClientRect === "function" ? c.getBoundingClientRect() : null;
|
|
757
963
|
}
|
|
758
964
|
/**
|
|
759
965
|
* Babylon.js `engine.clear(color?, backBuffer?, depth?, stencil?)`. Babylon
|
|
@@ -1107,11 +1313,11 @@ class AbstractScene {
|
|
|
1107
1313
|
}
|
|
1108
1314
|
/** Babylon.js `scene.getCameraByName(name)` — first camera with a matching name, else `null`. */
|
|
1109
1315
|
getCameraByName(name) {
|
|
1110
|
-
return this._cameras.find((
|
|
1316
|
+
return this._cameras.find((c) => c.name === name) ?? null;
|
|
1111
1317
|
}
|
|
1112
1318
|
/** Babylon.js `scene.getCameraById(id)` — first camera whose `id` matches, else `null`. */
|
|
1113
1319
|
getCameraById(id) {
|
|
1114
|
-
return this._cameras.find((
|
|
1320
|
+
return this._cameras.find((c) => c.id === id) ?? null;
|
|
1115
1321
|
}
|
|
1116
1322
|
/** Babylon.js `scene.getLightByName(name)` — first light with a matching name, else `null`. */
|
|
1117
1323
|
getLightByName(name) {
|
|
@@ -1147,14 +1353,18 @@ class AbstractScene {
|
|
|
1147
1353
|
}
|
|
1148
1354
|
/** Babylon.js `scene.getNodeByName(name)` — searches meshes, cameras, and lights. */
|
|
1149
1355
|
getNodeByName(name) {
|
|
1150
|
-
return this.meshes.find((m2) => m2.name === name) ?? this._cameras.find((
|
|
1356
|
+
return this.meshes.find((m2) => m2.name === name) ?? this._cameras.find((c) => c.name === name) ?? this._lights.find((l) => l.name === name) ?? null;
|
|
1151
1357
|
}
|
|
1152
1358
|
/** Babylon.js `scene.getNodeById(id)` — searches meshes, cameras, and lights by `id`. */
|
|
1153
1359
|
getNodeById(id) {
|
|
1154
1360
|
const byId = (n2) => n2.id === id;
|
|
1155
|
-
return this.meshes.find((m2) => byId(m2)) ?? this._cameras.find((
|
|
1361
|
+
return this.meshes.find((m2) => byId(m2)) ?? this._cameras.find((c) => byId(c)) ?? this._lights.find((l) => byId(l)) ?? null;
|
|
1156
1362
|
}
|
|
1157
1363
|
}
|
|
1364
|
+
let physicsBodyWrappers = null;
|
|
1365
|
+
function getPhysicsBodyWrappers() {
|
|
1366
|
+
return physicsBodyWrappers ?? (physicsBodyWrappers = /* @__PURE__ */ new WeakMap());
|
|
1367
|
+
}
|
|
1158
1368
|
var PhysicsShapeType = /* @__PURE__ */ ((PhysicsShapeType2) => {
|
|
1159
1369
|
PhysicsShapeType2[PhysicsShapeType2["SPHERE"] = 0] = "SPHERE";
|
|
1160
1370
|
PhysicsShapeType2[PhysicsShapeType2["CAPSULE"] = 1] = "CAPSULE";
|
|
@@ -1188,6 +1398,637 @@ var PhysicsConstraintType = /* @__PURE__ */ ((PhysicsConstraintType2) => {
|
|
|
1188
1398
|
PhysicsConstraintType2[PhysicsConstraintType2["SIX_DOF"] = 7] = "SIX_DOF";
|
|
1189
1399
|
return PhysicsConstraintType2;
|
|
1190
1400
|
})(PhysicsConstraintType || {});
|
|
1401
|
+
var CharacterSupportedState = /* @__PURE__ */ ((CharacterSupportedState2) => {
|
|
1402
|
+
CharacterSupportedState2[CharacterSupportedState2["UNSUPPORTED"] = 0] = "UNSUPPORTED";
|
|
1403
|
+
CharacterSupportedState2[CharacterSupportedState2["SLIDING"] = 1] = "SLIDING";
|
|
1404
|
+
CharacterSupportedState2[CharacterSupportedState2["SUPPORTED"] = 2] = "SUPPORTED";
|
|
1405
|
+
return CharacterSupportedState2;
|
|
1406
|
+
})(CharacterSupportedState || {});
|
|
1407
|
+
function requirePhysicsWorld(scene) {
|
|
1408
|
+
var _a;
|
|
1409
|
+
const world = (_a = scene == null ? void 0 : scene.getPhysicsEngine()) == null ? void 0 : _a.getPhysicsPlugin().world;
|
|
1410
|
+
if (!world) {
|
|
1411
|
+
return unsupported("Physics", "Call `scene.enablePhysics(...)` with a ready HavokPlugin before creating physics bodies or shapes.");
|
|
1412
|
+
}
|
|
1413
|
+
return world;
|
|
1414
|
+
}
|
|
1415
|
+
function liteShapeType(type) {
|
|
1416
|
+
switch (type) {
|
|
1417
|
+
case 0:
|
|
1418
|
+
return PhysicsShapeType$1.SPHERE;
|
|
1419
|
+
case 1:
|
|
1420
|
+
return PhysicsShapeType$1.CAPSULE;
|
|
1421
|
+
case 2:
|
|
1422
|
+
return PhysicsShapeType$1.CYLINDER;
|
|
1423
|
+
case 3:
|
|
1424
|
+
return PhysicsShapeType$1.BOX;
|
|
1425
|
+
case 4:
|
|
1426
|
+
return PhysicsShapeType$1.CONVEX_HULL;
|
|
1427
|
+
case 5:
|
|
1428
|
+
return PhysicsShapeType$1.CONTAINER;
|
|
1429
|
+
case 6:
|
|
1430
|
+
return PhysicsShapeType$1.MESH;
|
|
1431
|
+
case 7:
|
|
1432
|
+
return PhysicsShapeType$1.HEIGHTFIELD;
|
|
1433
|
+
default:
|
|
1434
|
+
throw new Error(`Invalid PhysicsShapeType value: ${type}`);
|
|
1435
|
+
}
|
|
1436
|
+
}
|
|
1437
|
+
function liteMotionType(type) {
|
|
1438
|
+
switch (type) {
|
|
1439
|
+
case 0:
|
|
1440
|
+
return PhysicsMotionType$1.STATIC;
|
|
1441
|
+
case 1:
|
|
1442
|
+
return PhysicsMotionType$1.ANIMATED;
|
|
1443
|
+
case 2:
|
|
1444
|
+
return PhysicsMotionType$1.DYNAMIC;
|
|
1445
|
+
default:
|
|
1446
|
+
throw new Error(`Invalid PhysicsMotionType value: ${type}`);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
function litePrestepType(type) {
|
|
1450
|
+
switch (type) {
|
|
1451
|
+
case 0:
|
|
1452
|
+
return PhysicsPrestepType$1.DISABLED;
|
|
1453
|
+
case 1:
|
|
1454
|
+
return PhysicsPrestepType$1.TELEPORT;
|
|
1455
|
+
case 2:
|
|
1456
|
+
return PhysicsPrestepType$1.ACTION;
|
|
1457
|
+
default:
|
|
1458
|
+
throw new Error(`Invalid PhysicsPrestepType value: ${type}`);
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
class PhysicsShape {
|
|
1462
|
+
constructor(options, scene) {
|
|
1463
|
+
/** @internal */
|
|
1464
|
+
__publicField(this, "_lite");
|
|
1465
|
+
/** @internal */
|
|
1466
|
+
__publicField(this, "_world");
|
|
1467
|
+
/** @internal */
|
|
1468
|
+
__publicField(this, "_material", {});
|
|
1469
|
+
/** @internal */
|
|
1470
|
+
__publicField(this, "_membershipMask", 4294967295);
|
|
1471
|
+
/** @internal */
|
|
1472
|
+
__publicField(this, "_collideMask", 4294967295);
|
|
1473
|
+
/** @internal */
|
|
1474
|
+
__publicField(this, "_isTrigger", false);
|
|
1475
|
+
/** @internal */
|
|
1476
|
+
__publicField(this, "_disposed", false);
|
|
1477
|
+
/** @internal Whether this wrapper is responsible for releasing the native shape. */
|
|
1478
|
+
__publicField(this, "_ownsLiteShape", true);
|
|
1479
|
+
this._world = requirePhysicsWorld(scene);
|
|
1480
|
+
if (options.pluginData) {
|
|
1481
|
+
this._lite = options.pluginData;
|
|
1482
|
+
} else if (options.type !== void 0) {
|
|
1483
|
+
this._lite = createPhysicsShape(this._world, { type: liteShapeType(options.type), parameters: options.parameters });
|
|
1484
|
+
} else {
|
|
1485
|
+
return unsupported("PhysicsShape", "Specify either `type` or a native Lite shape as `pluginData`.");
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
/** @internal */
|
|
1489
|
+
static _fromLite(shape, world, ownsLiteShape = true) {
|
|
1490
|
+
const wrapper = Object.create(PhysicsShape.prototype);
|
|
1491
|
+
Object.defineProperties(wrapper, {
|
|
1492
|
+
_lite: { value: shape, enumerable: true, writable: true },
|
|
1493
|
+
_world: { value: world },
|
|
1494
|
+
_material: { value: {}, writable: true },
|
|
1495
|
+
_membershipMask: { value: 4294967295, writable: true },
|
|
1496
|
+
_collideMask: { value: 4294967295, writable: true },
|
|
1497
|
+
_isTrigger: { value: false, writable: true },
|
|
1498
|
+
_disposed: { value: false, writable: true },
|
|
1499
|
+
_ownsLiteShape: { value: ownsLiteShape }
|
|
1500
|
+
});
|
|
1501
|
+
return wrapper;
|
|
1502
|
+
}
|
|
1503
|
+
/** @internal */
|
|
1504
|
+
_replaceLiteShape(shape) {
|
|
1505
|
+
this._lite = shape;
|
|
1506
|
+
this.material = this._material;
|
|
1507
|
+
this.filterMembershipMask = this._membershipMask;
|
|
1508
|
+
this.filterCollideMask = this._collideMask;
|
|
1509
|
+
this.isTrigger = this._isTrigger;
|
|
1510
|
+
}
|
|
1511
|
+
getClassName() {
|
|
1512
|
+
return "PhysicsShape";
|
|
1513
|
+
}
|
|
1514
|
+
get type() {
|
|
1515
|
+
switch (this._lite._type) {
|
|
1516
|
+
case PhysicsShapeType$1.SPHERE:
|
|
1517
|
+
return 0;
|
|
1518
|
+
case PhysicsShapeType$1.CAPSULE:
|
|
1519
|
+
return 1;
|
|
1520
|
+
case PhysicsShapeType$1.CYLINDER:
|
|
1521
|
+
return 2;
|
|
1522
|
+
case PhysicsShapeType$1.BOX:
|
|
1523
|
+
return 3;
|
|
1524
|
+
case PhysicsShapeType$1.CONVEX_HULL:
|
|
1525
|
+
return 4;
|
|
1526
|
+
case PhysicsShapeType$1.CONTAINER:
|
|
1527
|
+
return 5;
|
|
1528
|
+
case PhysicsShapeType$1.MESH:
|
|
1529
|
+
return 6;
|
|
1530
|
+
case PhysicsShapeType$1.HEIGHTFIELD:
|
|
1531
|
+
return 7;
|
|
1532
|
+
default:
|
|
1533
|
+
throw new Error(`Invalid Lite PhysicsShapeType value: ${this._lite._type}`);
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
set filterMembershipMask(value) {
|
|
1537
|
+
this._membershipMask = value;
|
|
1538
|
+
setPhysicsShapeFilterMembershipMask(this._world, this._lite, value);
|
|
1539
|
+
}
|
|
1540
|
+
get filterMembershipMask() {
|
|
1541
|
+
return this._membershipMask;
|
|
1542
|
+
}
|
|
1543
|
+
set filterCollideMask(value) {
|
|
1544
|
+
this._collideMask = value;
|
|
1545
|
+
setPhysicsShapeFilterCollideMask(this._world, this._lite, value);
|
|
1546
|
+
}
|
|
1547
|
+
get filterCollideMask() {
|
|
1548
|
+
return this._collideMask;
|
|
1549
|
+
}
|
|
1550
|
+
set material(value) {
|
|
1551
|
+
this._material = value;
|
|
1552
|
+
const friction = value.friction ?? 0.5;
|
|
1553
|
+
setPhysicsShapeMaterial(this._world, this._lite, friction, value.restitution ?? 0, value.staticFriction ?? friction);
|
|
1554
|
+
}
|
|
1555
|
+
get material() {
|
|
1556
|
+
return this._material;
|
|
1557
|
+
}
|
|
1558
|
+
set isTrigger(value) {
|
|
1559
|
+
this._isTrigger = value;
|
|
1560
|
+
setPhysicsShapeIsTrigger(this._world, this._lite, value);
|
|
1561
|
+
}
|
|
1562
|
+
get isTrigger() {
|
|
1563
|
+
return this._isTrigger;
|
|
1564
|
+
}
|
|
1565
|
+
dispose() {
|
|
1566
|
+
if (!this._disposed) {
|
|
1567
|
+
if (this._ownsLiteShape) {
|
|
1568
|
+
releasePhysicsShape(this._world, this._lite);
|
|
1569
|
+
}
|
|
1570
|
+
this._disposed = true;
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
class PhysicsBody {
|
|
1575
|
+
constructor(transformNode, motionType, startsAsleep, scene) {
|
|
1576
|
+
/** @internal */
|
|
1577
|
+
__publicField(this, "_lite");
|
|
1578
|
+
/** @internal */
|
|
1579
|
+
__publicField(this, "_world");
|
|
1580
|
+
/** @internal */
|
|
1581
|
+
__publicField(this, "_shape", null);
|
|
1582
|
+
/** @internal */
|
|
1583
|
+
__publicField(this, "_disposed", false);
|
|
1584
|
+
/** @internal */
|
|
1585
|
+
__publicField(this, "_nodeDisposeObserver", null);
|
|
1586
|
+
__publicField(this, "transformNode");
|
|
1587
|
+
__publicField(this, "_disableSync", false);
|
|
1588
|
+
__publicField(this, "startAsleep");
|
|
1589
|
+
assertPhysicsNodeSupported(transformNode);
|
|
1590
|
+
this.transformNode = transformNode;
|
|
1591
|
+
this.startAsleep = startsAsleep;
|
|
1592
|
+
this._world = requirePhysicsWorld(scene);
|
|
1593
|
+
this._lite = createPhysicsBody(this._world, transformNode._node, liteMotionType(motionType), startsAsleep);
|
|
1594
|
+
getPhysicsBodyWrappers().set(this._lite, this);
|
|
1595
|
+
setPhysicsBodyPrestepType(this._lite, PhysicsPrestepType$1.DISABLED);
|
|
1596
|
+
this._attachToNode();
|
|
1597
|
+
}
|
|
1598
|
+
/** @internal */
|
|
1599
|
+
static _fromLite(body, transformNode, world, startsAsleep = false) {
|
|
1600
|
+
const wrapper = Object.create(PhysicsBody.prototype);
|
|
1601
|
+
Object.defineProperties(wrapper, {
|
|
1602
|
+
_lite: { value: body, enumerable: true },
|
|
1603
|
+
_world: { value: world },
|
|
1604
|
+
_shape: { value: null, writable: true },
|
|
1605
|
+
_disposed: { value: false, writable: true },
|
|
1606
|
+
_nodeDisposeObserver: { value: null, writable: true },
|
|
1607
|
+
transformNode: { value: transformNode, enumerable: true },
|
|
1608
|
+
_disableSync: { value: false, writable: true },
|
|
1609
|
+
startAsleep: { value: startsAsleep, enumerable: true }
|
|
1610
|
+
});
|
|
1611
|
+
setPhysicsBodyPrestepType(wrapper._lite, PhysicsPrestepType$1.DISABLED);
|
|
1612
|
+
getPhysicsBodyWrappers().set(wrapper._lite, wrapper);
|
|
1613
|
+
wrapper._attachToNode();
|
|
1614
|
+
return wrapper;
|
|
1615
|
+
}
|
|
1616
|
+
getClassName() {
|
|
1617
|
+
return "PhysicsBody";
|
|
1618
|
+
}
|
|
1619
|
+
get disablePreStep() {
|
|
1620
|
+
return this._lite._prestepType === PhysicsPrestepType$1.DISABLED;
|
|
1621
|
+
}
|
|
1622
|
+
set disablePreStep(value) {
|
|
1623
|
+
setPhysicsBodyPrestepType(this._lite, value ? PhysicsPrestepType$1.DISABLED : PhysicsPrestepType$1.TELEPORT);
|
|
1624
|
+
}
|
|
1625
|
+
get disableSync() {
|
|
1626
|
+
return this._disableSync;
|
|
1627
|
+
}
|
|
1628
|
+
set disableSync(value) {
|
|
1629
|
+
if (value) {
|
|
1630
|
+
unsupported(
|
|
1631
|
+
"PhysicsBody.disableSync",
|
|
1632
|
+
"Babylon Lite's shared physics step always synchronizes dynamic bodies; opting out would require changing that existing hot-path module and every physics scene bundle."
|
|
1633
|
+
);
|
|
1634
|
+
}
|
|
1635
|
+
this._disableSync = false;
|
|
1636
|
+
}
|
|
1637
|
+
get motionType() {
|
|
1638
|
+
switch (this._lite.motionType) {
|
|
1639
|
+
case PhysicsMotionType$1.STATIC:
|
|
1640
|
+
return 0;
|
|
1641
|
+
case PhysicsMotionType$1.ANIMATED:
|
|
1642
|
+
return 1;
|
|
1643
|
+
case PhysicsMotionType$1.DYNAMIC:
|
|
1644
|
+
return 2;
|
|
1645
|
+
default:
|
|
1646
|
+
throw new Error(`Invalid Lite PhysicsMotionType value: ${this._lite.motionType}`);
|
|
1647
|
+
}
|
|
1648
|
+
}
|
|
1649
|
+
set shape(value) {
|
|
1650
|
+
if (!value) {
|
|
1651
|
+
unsupported("PhysicsBody.shape", "Babylon Lite cannot detach a shape from a live body; assign another PhysicsShape or dispose the body.");
|
|
1652
|
+
}
|
|
1653
|
+
this._shape = value;
|
|
1654
|
+
setPhysicsBodyShape(this._world, this._lite, value._lite);
|
|
1655
|
+
}
|
|
1656
|
+
get shape() {
|
|
1657
|
+
return this._shape;
|
|
1658
|
+
}
|
|
1659
|
+
setMotionType(value) {
|
|
1660
|
+
setPhysicsBodyMotionType(this._world, this._lite, liteMotionType(value));
|
|
1661
|
+
}
|
|
1662
|
+
getMotionType() {
|
|
1663
|
+
return this.motionType;
|
|
1664
|
+
}
|
|
1665
|
+
setPrestepType(value) {
|
|
1666
|
+
setPhysicsBodyPrestepType(this._lite, litePrestepType(value));
|
|
1667
|
+
}
|
|
1668
|
+
getPrestepType() {
|
|
1669
|
+
switch (this._lite._prestepType) {
|
|
1670
|
+
case PhysicsPrestepType$1.DISABLED:
|
|
1671
|
+
return 0;
|
|
1672
|
+
case PhysicsPrestepType$1.TELEPORT:
|
|
1673
|
+
return 1;
|
|
1674
|
+
case PhysicsPrestepType$1.ACTION:
|
|
1675
|
+
return 2;
|
|
1676
|
+
default:
|
|
1677
|
+
throw new Error(`Invalid Lite PhysicsPrestepType value: ${this._lite._prestepType}`);
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
setMassProperties(properties) {
|
|
1681
|
+
setPhysicsBodyMassProperties(this._world, this._lite, properties);
|
|
1682
|
+
}
|
|
1683
|
+
setLinearVelocity(value) {
|
|
1684
|
+
setPhysicsBodyLinearVelocity(this._world, this._lite, value);
|
|
1685
|
+
}
|
|
1686
|
+
getLinearVelocity() {
|
|
1687
|
+
const value = getPhysicsBodyLinearVelocity(this._world, this._lite);
|
|
1688
|
+
return new Vector3(value.x, value.y, value.z);
|
|
1689
|
+
}
|
|
1690
|
+
getLinearVelocityToRef(result) {
|
|
1691
|
+
const value = getPhysicsBodyLinearVelocity(this._world, this._lite);
|
|
1692
|
+
result.set(value.x, value.y, value.z);
|
|
1693
|
+
}
|
|
1694
|
+
setAngularVelocity(value) {
|
|
1695
|
+
setPhysicsBodyAngularVelocity(this._world, this._lite, value);
|
|
1696
|
+
}
|
|
1697
|
+
getAngularVelocity() {
|
|
1698
|
+
const value = getPhysicsBodyAngularVelocity(this._world, this._lite);
|
|
1699
|
+
return new Vector3(value.x, value.y, value.z);
|
|
1700
|
+
}
|
|
1701
|
+
getAngularVelocityToRef(result) {
|
|
1702
|
+
const value = getPhysicsBodyAngularVelocity(this._world, this._lite);
|
|
1703
|
+
result.set(value.x, value.y, value.z);
|
|
1704
|
+
}
|
|
1705
|
+
applyImpulse(impulse, location) {
|
|
1706
|
+
applyPhysicsBodyImpulse(this._lite, impulse, location);
|
|
1707
|
+
}
|
|
1708
|
+
applyForce(force, location) {
|
|
1709
|
+
applyPhysicsBodyForce(this._world, this._lite, force, location);
|
|
1710
|
+
}
|
|
1711
|
+
dispose() {
|
|
1712
|
+
if (!this._disposed) {
|
|
1713
|
+
this.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver);
|
|
1714
|
+
this._nodeDisposeObserver = null;
|
|
1715
|
+
removePhysicsBody(this._world, this._lite);
|
|
1716
|
+
getPhysicsBodyWrappers().delete(this._lite);
|
|
1717
|
+
if (this.transformNode.physicsBody === this) {
|
|
1718
|
+
this.transformNode.physicsBody = null;
|
|
1719
|
+
}
|
|
1720
|
+
this._disposed = true;
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
/** @internal */
|
|
1724
|
+
_adoptShape(shape) {
|
|
1725
|
+
this._shape = shape;
|
|
1726
|
+
}
|
|
1727
|
+
/** @internal */
|
|
1728
|
+
_attachToNode() {
|
|
1729
|
+
this.transformNode.physicsBody = this;
|
|
1730
|
+
this._nodeDisposeObserver = this.transformNode.onDisposeObservable.add(() => this.dispose());
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
function vectorFromLite(value) {
|
|
1734
|
+
return new Vector3(value.x, value.y, value.z);
|
|
1735
|
+
}
|
|
1736
|
+
function vectorFromLiteOwned(value) {
|
|
1737
|
+
if (!(value instanceof Vector3)) {
|
|
1738
|
+
Object.setPrototypeOf(value, Vector3.prototype);
|
|
1739
|
+
}
|
|
1740
|
+
return value;
|
|
1741
|
+
}
|
|
1742
|
+
function surfaceInfoFromLite(value) {
|
|
1743
|
+
return {
|
|
1744
|
+
isSurfaceDynamic: value.isSurfaceDynamic,
|
|
1745
|
+
supportedState: Number(value.supportedState),
|
|
1746
|
+
averageSurfaceNormal: vectorFromLite(value.averageSurfaceNormal),
|
|
1747
|
+
averageSurfaceVelocity: vectorFromLite(value.averageSurfaceVelocity),
|
|
1748
|
+
averageAngularSurfaceVelocity: vectorFromLite(value.averageAngularSurfaceVelocity)
|
|
1749
|
+
};
|
|
1750
|
+
}
|
|
1751
|
+
class PhysicsCharacterController {
|
|
1752
|
+
constructor(position, characterShapeOptions, scene) {
|
|
1753
|
+
/** @internal */
|
|
1754
|
+
__publicField(this, "_lite");
|
|
1755
|
+
__publicField(this, "onTriggerCollisionObservable", new Observable());
|
|
1756
|
+
__publicField(this, "_shape");
|
|
1757
|
+
__publicField(this, "_up");
|
|
1758
|
+
__publicField(this, "_maxStepHeight", 0);
|
|
1759
|
+
__publicField(this, "_footOffset");
|
|
1760
|
+
__publicField(this, "_disposed", false);
|
|
1761
|
+
if (characterShapeOptions.shape) {
|
|
1762
|
+
unsupported(
|
|
1763
|
+
"PhysicsCharacterController custom shapes",
|
|
1764
|
+
"Lite's controller owns and rebuilds a capsule internally; exposing caller-owned shape replacement requires an ownership/lifetime design in Lite."
|
|
1765
|
+
);
|
|
1766
|
+
}
|
|
1767
|
+
const world = requirePhysicsWorld(scene);
|
|
1768
|
+
this._lite = createPhysicsCharacterController(world, position, {
|
|
1769
|
+
capsuleHeight: characterShapeOptions.capsuleHeight ?? 1.8,
|
|
1770
|
+
capsuleRadius: characterShapeOptions.capsuleRadius ?? 0.6
|
|
1771
|
+
});
|
|
1772
|
+
this._up = vectorFromLite(this._lite.up);
|
|
1773
|
+
this._lite.up = this._up;
|
|
1774
|
+
this._footOffset = (characterShapeOptions.capsuleHeight ?? 1.8) * 0.5;
|
|
1775
|
+
const liteShape = this._lite.getBody()._shape;
|
|
1776
|
+
if (!liteShape) {
|
|
1777
|
+
throw new Error("Babylon Lite character controller did not create a collision shape.");
|
|
1778
|
+
}
|
|
1779
|
+
this._shape = PhysicsShape._fromLite(liteShape, world, false);
|
|
1780
|
+
this._lite.onTriggerCollisionObservable.add((event) => this._notifyCollision(event));
|
|
1781
|
+
}
|
|
1782
|
+
get shape() {
|
|
1783
|
+
return this._shape;
|
|
1784
|
+
}
|
|
1785
|
+
set shape(_value) {
|
|
1786
|
+
unsupported("PhysicsCharacterController.shape", "Lite's controller owns its cast shape; replacing it requires an explicit Lite ownership/lifetime contract.");
|
|
1787
|
+
}
|
|
1788
|
+
get shapeOptions() {
|
|
1789
|
+
const { capsuleHeight, capsuleRadius } = this._lite.shapeOptions;
|
|
1790
|
+
return { capsuleHeight, capsuleRadius };
|
|
1791
|
+
}
|
|
1792
|
+
setShapeOptions(options, preserveFootPosition = true) {
|
|
1793
|
+
if (options.shape) {
|
|
1794
|
+
this.shape = options.shape;
|
|
1795
|
+
return;
|
|
1796
|
+
}
|
|
1797
|
+
this._lite.setShapeOptions({ capsuleHeight: options.capsuleHeight ?? 1.8, capsuleRadius: options.capsuleRadius ?? 0.6 }, preserveFootPosition);
|
|
1798
|
+
const liteShape = this._lite.getBody()._shape;
|
|
1799
|
+
if (!liteShape) {
|
|
1800
|
+
throw new Error("Babylon Lite character controller did not rebuild its collision shape.");
|
|
1801
|
+
}
|
|
1802
|
+
this._shape._replaceLiteShape(liteShape);
|
|
1803
|
+
this._footOffset = (options.capsuleHeight ?? 1.8) * 0.5;
|
|
1804
|
+
}
|
|
1805
|
+
getPosition() {
|
|
1806
|
+
return vectorFromLiteOwned(this._lite.getPosition());
|
|
1807
|
+
}
|
|
1808
|
+
setPosition(position) {
|
|
1809
|
+
this._lite.setPosition(position);
|
|
1810
|
+
}
|
|
1811
|
+
getVelocity() {
|
|
1812
|
+
return vectorFromLiteOwned(this._lite.getVelocity());
|
|
1813
|
+
}
|
|
1814
|
+
setVelocity(velocity) {
|
|
1815
|
+
this._lite.setVelocity(velocity);
|
|
1816
|
+
}
|
|
1817
|
+
moveWithCollisions(displacement) {
|
|
1818
|
+
this._lite.moveWithCollisions(displacement);
|
|
1819
|
+
}
|
|
1820
|
+
integrate(deltaTime, surfaceInfo, gravity) {
|
|
1821
|
+
this._lite.integrate(deltaTime, { ...surfaceInfo, supportedState: Number(surfaceInfo.supportedState) }, gravity);
|
|
1822
|
+
}
|
|
1823
|
+
checkSupport(deltaTime, direction) {
|
|
1824
|
+
return surfaceInfoFromLite(this._lite.checkSupport(deltaTime, direction));
|
|
1825
|
+
}
|
|
1826
|
+
checkSupportToRef(deltaTime, direction, result) {
|
|
1827
|
+
const value = this._lite.checkSupport(deltaTime, direction);
|
|
1828
|
+
result.isSurfaceDynamic = value.isSurfaceDynamic;
|
|
1829
|
+
result.supportedState = Number(value.supportedState);
|
|
1830
|
+
result.averageSurfaceNormal.set(value.averageSurfaceNormal.x, value.averageSurfaceNormal.y, value.averageSurfaceNormal.z);
|
|
1831
|
+
result.averageSurfaceVelocity.set(value.averageSurfaceVelocity.x, value.averageSurfaceVelocity.y, value.averageSurfaceVelocity.z);
|
|
1832
|
+
result.averageAngularSurfaceVelocity.set(value.averageAngularSurfaceVelocity.x, value.averageAngularSurfaceVelocity.y, value.averageAngularSurfaceVelocity.z);
|
|
1833
|
+
}
|
|
1834
|
+
calculateMovement(deltaTime, forwardWorld, surfaceNormal, currentVelocity, surfaceVelocity, desiredVelocity, upWorld) {
|
|
1835
|
+
return vectorFromLite(this._lite.calculateMovement(deltaTime, forwardWorld, surfaceNormal, currentVelocity, surfaceVelocity, desiredVelocity, upWorld));
|
|
1836
|
+
}
|
|
1837
|
+
calculateMovementToRef(deltaTime, forwardWorld, surfaceNormal, currentVelocity, surfaceVelocity, desiredVelocity, upWorld, result) {
|
|
1838
|
+
return calculatePhysicsCharacterMovementToRef(this._lite, deltaTime, forwardWorld, surfaceNormal, currentVelocity, surfaceVelocity, desiredVelocity, upWorld, result);
|
|
1839
|
+
}
|
|
1840
|
+
dispose() {
|
|
1841
|
+
if (!this._disposed) {
|
|
1842
|
+
this._lite.dispose();
|
|
1843
|
+
this.onTriggerCollisionObservable.clear();
|
|
1844
|
+
this._disposed = true;
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
get up() {
|
|
1848
|
+
return this._up;
|
|
1849
|
+
}
|
|
1850
|
+
set up(value) {
|
|
1851
|
+
this._up = value;
|
|
1852
|
+
this._lite.up = value;
|
|
1853
|
+
}
|
|
1854
|
+
get maxStepHeight() {
|
|
1855
|
+
return this._maxStepHeight;
|
|
1856
|
+
}
|
|
1857
|
+
set maxStepHeight(value) {
|
|
1858
|
+
if (value !== 0) {
|
|
1859
|
+
unsupported(
|
|
1860
|
+
"PhysicsCharacterController.maxStepHeight",
|
|
1861
|
+
"Step-up needs a substantial additional sweep/manifold policy in Lite's controller and cannot be implemented as compat translation."
|
|
1862
|
+
);
|
|
1863
|
+
}
|
|
1864
|
+
this._maxStepHeight = 0;
|
|
1865
|
+
}
|
|
1866
|
+
get footOffset() {
|
|
1867
|
+
return this._footOffset;
|
|
1868
|
+
}
|
|
1869
|
+
set footOffset(value) {
|
|
1870
|
+
if (value !== this._footOffset) {
|
|
1871
|
+
unsupported(
|
|
1872
|
+
"PhysicsCharacterController.footOffset",
|
|
1873
|
+
"Lite derives the character foot from capsule height and does not expose the custom-shape foot-offset policy used by Babylon.js."
|
|
1874
|
+
);
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
_notifyCollision(event) {
|
|
1878
|
+
const collider = getPhysicsBodyWrappers().get(event.collider);
|
|
1879
|
+
if (!collider) {
|
|
1880
|
+
unsupported(
|
|
1881
|
+
"PhysicsCharacterController collision body mapping",
|
|
1882
|
+
"The contacted Lite body was not created through the compat physics API and has no Babylon.js TransformNode wrapper."
|
|
1883
|
+
);
|
|
1884
|
+
}
|
|
1885
|
+
this.onTriggerCollisionObservable.notifyObservers({
|
|
1886
|
+
collider,
|
|
1887
|
+
colliderIndex: 0,
|
|
1888
|
+
impulse: vectorFromLite(event.impulse),
|
|
1889
|
+
impulsePosition: vectorFromLite(event.impulsePosition)
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1892
|
+
get keepDistance() {
|
|
1893
|
+
return this._lite.keepDistance;
|
|
1894
|
+
}
|
|
1895
|
+
set keepDistance(value) {
|
|
1896
|
+
this._lite.keepDistance = value;
|
|
1897
|
+
}
|
|
1898
|
+
get keepContactTolerance() {
|
|
1899
|
+
return this._lite.keepContactTolerance;
|
|
1900
|
+
}
|
|
1901
|
+
set keepContactTolerance(value) {
|
|
1902
|
+
this._lite.keepContactTolerance = value;
|
|
1903
|
+
}
|
|
1904
|
+
get maxCastIterations() {
|
|
1905
|
+
return this._lite.maxCastIterations;
|
|
1906
|
+
}
|
|
1907
|
+
set maxCastIterations(value) {
|
|
1908
|
+
this._lite.maxCastIterations = value;
|
|
1909
|
+
}
|
|
1910
|
+
get penetrationRecoverySpeed() {
|
|
1911
|
+
return this._lite.penetrationRecoverySpeed;
|
|
1912
|
+
}
|
|
1913
|
+
set penetrationRecoverySpeed(value) {
|
|
1914
|
+
this._lite.penetrationRecoverySpeed = value;
|
|
1915
|
+
}
|
|
1916
|
+
get staticFriction() {
|
|
1917
|
+
return this._lite.staticFriction;
|
|
1918
|
+
}
|
|
1919
|
+
set staticFriction(value) {
|
|
1920
|
+
this._lite.staticFriction = value;
|
|
1921
|
+
}
|
|
1922
|
+
get dynamicFriction() {
|
|
1923
|
+
return this._lite.dynamicFriction;
|
|
1924
|
+
}
|
|
1925
|
+
set dynamicFriction(value) {
|
|
1926
|
+
this._lite.dynamicFriction = value;
|
|
1927
|
+
}
|
|
1928
|
+
get maxSlopeCosine() {
|
|
1929
|
+
return this._lite.maxSlopeCosine;
|
|
1930
|
+
}
|
|
1931
|
+
set maxSlopeCosine(value) {
|
|
1932
|
+
this._lite.maxSlopeCosine = value;
|
|
1933
|
+
}
|
|
1934
|
+
get maxCharacterSpeedForSolver() {
|
|
1935
|
+
return this._lite.maxCharacterSpeedForSolver;
|
|
1936
|
+
}
|
|
1937
|
+
set maxCharacterSpeedForSolver(value) {
|
|
1938
|
+
this._lite.maxCharacterSpeedForSolver = value;
|
|
1939
|
+
}
|
|
1940
|
+
get characterStrength() {
|
|
1941
|
+
return this._lite.characterStrength;
|
|
1942
|
+
}
|
|
1943
|
+
set characterStrength(value) {
|
|
1944
|
+
this._lite.characterStrength = value;
|
|
1945
|
+
}
|
|
1946
|
+
get acceleration() {
|
|
1947
|
+
return this._lite.acceleration;
|
|
1948
|
+
}
|
|
1949
|
+
set acceleration(value) {
|
|
1950
|
+
this._lite.acceleration = value;
|
|
1951
|
+
}
|
|
1952
|
+
get maxAcceleration() {
|
|
1953
|
+
return this._lite.maxAcceleration;
|
|
1954
|
+
}
|
|
1955
|
+
set maxAcceleration(value) {
|
|
1956
|
+
this._lite.maxAcceleration = value;
|
|
1957
|
+
}
|
|
1958
|
+
get characterMass() {
|
|
1959
|
+
return this._lite.characterMass;
|
|
1960
|
+
}
|
|
1961
|
+
set characterMass(value) {
|
|
1962
|
+
this._lite.characterMass = value;
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
class PhysicsAggregate {
|
|
1966
|
+
constructor(transformNode, type, options = { mass: 0 }, scene) {
|
|
1967
|
+
__publicField(this, "transformNode");
|
|
1968
|
+
__publicField(this, "type");
|
|
1969
|
+
__publicField(this, "body");
|
|
1970
|
+
__publicField(this, "shape");
|
|
1971
|
+
__publicField(this, "material");
|
|
1972
|
+
/** @internal */
|
|
1973
|
+
__publicField(this, "_disposed", false);
|
|
1974
|
+
/** @internal */
|
|
1975
|
+
__publicField(this, "_disposeShapeWhenDisposed");
|
|
1976
|
+
/** @internal */
|
|
1977
|
+
__publicField(this, "_nodeDisposeObserver", null);
|
|
1978
|
+
assertPhysicsNodeSupported(transformNode);
|
|
1979
|
+
this.transformNode = transformNode;
|
|
1980
|
+
this.type = type;
|
|
1981
|
+
const resolvedScene = scene ?? transformNode.getScene();
|
|
1982
|
+
const world = requirePhysicsWorld(resolvedScene);
|
|
1983
|
+
const nativeType = type instanceof PhysicsShape ? type._lite._type : liteShapeType(type);
|
|
1984
|
+
let suppliedShape = type instanceof PhysicsShape ? type : void 0;
|
|
1985
|
+
this._disposeShapeWhenDisposed = !suppliedShape;
|
|
1986
|
+
if (!suppliedShape && (type === 6 || type === 4)) {
|
|
1987
|
+
suppliedShape = PhysicsShape._fromLite(createPhysicsShape(world, { type: nativeType, mesh: (options.mesh ?? transformNode)._node }), world);
|
|
1988
|
+
}
|
|
1989
|
+
const aggregate = createPhysicsAggregate(world, transformNode._node, nativeType, {
|
|
1990
|
+
...options,
|
|
1991
|
+
shape: suppliedShape == null ? void 0 : suppliedShape._lite
|
|
1992
|
+
});
|
|
1993
|
+
this.material = {
|
|
1994
|
+
friction: options.friction ?? 0.2,
|
|
1995
|
+
staticFriction: options.staticFriction,
|
|
1996
|
+
restitution: options.restitution ?? 0.2
|
|
1997
|
+
};
|
|
1998
|
+
this.shape = suppliedShape ?? PhysicsShape._fromLite(aggregate.shape, world);
|
|
1999
|
+
this.shape.material = this.material;
|
|
2000
|
+
if (options.isTriggerShape !== void 0) {
|
|
2001
|
+
this.shape.isTrigger = options.isTriggerShape;
|
|
2002
|
+
}
|
|
2003
|
+
this.body = PhysicsBody._fromLite(aggregate.body, transformNode, world, options.startAsleep);
|
|
2004
|
+
this.body._adoptShape(this.shape);
|
|
2005
|
+
this._nodeDisposeObserver = transformNode.onDisposeObservable.add(() => this.dispose());
|
|
2006
|
+
}
|
|
2007
|
+
dispose() {
|
|
2008
|
+
if (!this._disposed) {
|
|
2009
|
+
this.transformNode.onDisposeObservable.remove(this._nodeDisposeObserver);
|
|
2010
|
+
this._nodeDisposeObserver = null;
|
|
2011
|
+
this.body.dispose();
|
|
2012
|
+
if (this._disposeShapeWhenDisposed) {
|
|
2013
|
+
this.shape.dispose();
|
|
2014
|
+
}
|
|
2015
|
+
this._disposed = true;
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
function assertPhysicsNodeSupported(transformNode) {
|
|
2020
|
+
var _a;
|
|
2021
|
+
if (transformNode.physicsBody) {
|
|
2022
|
+
unsupported("PhysicsBody", "Babylon Lite synchronizes one physics body per scene node; dispose the existing TransformNode.physicsBody before attaching another.");
|
|
2023
|
+
}
|
|
2024
|
+
if (transformNode.parent || transformNode._node.parent) {
|
|
2025
|
+
unsupported("PhysicsBody", "Babylon Lite physics bodies currently consume local transforms, so parented TransformNodes cannot be synchronized in Babylon.js world space.");
|
|
2026
|
+
}
|
|
2027
|
+
const mesh = transformNode._node;
|
|
2028
|
+
if ((_a = mesh.thinInstances) == null ? void 0 : _a.count) {
|
|
2029
|
+
unsupported("PhysicsBody", "Babylon Lite exposes one physics body per scene node and has no per-thin-instance body representation.");
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
1191
2032
|
class HavokPlugin {
|
|
1192
2033
|
constructor(useDeltaForWorldStep = true, hpInjection) {
|
|
1193
2034
|
/** Name of the plugin. */
|
|
@@ -1562,8 +2403,8 @@ class GeospatialCamera extends Camera {
|
|
|
1562
2403
|
}
|
|
1563
2404
|
/** Anchored surface point the camera orbits (ECEF coordinates). */
|
|
1564
2405
|
get center() {
|
|
1565
|
-
const
|
|
1566
|
-
return new Vector3(
|
|
2406
|
+
const c = this._lite.center;
|
|
2407
|
+
return new Vector3(c.x, c.y, c.z);
|
|
1567
2408
|
}
|
|
1568
2409
|
set center(value) {
|
|
1569
2410
|
setGeospatialOrientation(this._lite, { center: { x: value.x, y: value.y, z: value.z } });
|
|
@@ -2091,8 +2932,8 @@ class AnimationGroup {
|
|
|
2091
2932
|
normalizer = holder.total;
|
|
2092
2933
|
final = zeroLike(holder.contributions[0].value);
|
|
2093
2934
|
}
|
|
2094
|
-
for (const
|
|
2095
|
-
final = addValue(final, scaleValue(
|
|
2935
|
+
for (const c of holder.contributions) {
|
|
2936
|
+
final = addValue(final, scaleValue(c.value, c.weight / normalizer));
|
|
2096
2937
|
}
|
|
2097
2938
|
}
|
|
2098
2939
|
applyAnimatedValue(holder.target, holder.path, final);
|
|
@@ -2413,8 +3254,8 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
2413
3254
|
this._defaultMaterial = value;
|
|
2414
3255
|
}
|
|
2415
3256
|
get clearColor() {
|
|
2416
|
-
const
|
|
2417
|
-
return new Color4(
|
|
3257
|
+
const c = this._lite.clearColor;
|
|
3258
|
+
return new Color4(c.r, c.g, c.b, c.a ?? 1);
|
|
2418
3259
|
}
|
|
2419
3260
|
set clearColor(value) {
|
|
2420
3261
|
this._lite.clearColor = { r: value.r, g: value.g, b: value.b, a: value.a ?? 1 };
|
|
@@ -2720,9 +3561,48 @@ const _Scene = class _Scene extends AbstractScene {
|
|
|
2720
3561
|
"Babylon Lite uses asynchronous GPU picking. Use the compat `GPUPicker` class (Babylon.js parity) or the native `createGpuPicker` + `pickAsync` API."
|
|
2721
3562
|
);
|
|
2722
3563
|
}
|
|
2723
|
-
/** Synchronous ray picking
|
|
2724
|
-
pickWithRay() {
|
|
2725
|
-
|
|
3564
|
+
/** Synchronous CPU ray picking over Babylon Lite's scene-mesh picker. */
|
|
3565
|
+
pickWithRay(ray, predicate, fastCheck = false, trianglePredicate) {
|
|
3566
|
+
if (fastCheck || trianglePredicate) {
|
|
3567
|
+
return unsupported(
|
|
3568
|
+
"Scene.pickWithRay",
|
|
3569
|
+
"Babylon Lite's synchronous picker returns the nearest bounding-box hit and does not expose fast-first-hit or per-triangle predicate modes."
|
|
3570
|
+
);
|
|
3571
|
+
}
|
|
3572
|
+
const candidates = new Set(this._lite.meshes);
|
|
3573
|
+
for (const wrapper of this.meshes) {
|
|
3574
|
+
if (wrapper instanceof AbstractMesh) {
|
|
3575
|
+
candidates.add(wrapper._lite);
|
|
3576
|
+
}
|
|
3577
|
+
}
|
|
3578
|
+
const wrappers = /* @__PURE__ */ new Map();
|
|
3579
|
+
for (const candidate of candidates) {
|
|
3580
|
+
if (candidate.thinInstances && candidate.thinInstances.count > 0) {
|
|
3581
|
+
return unsupported(
|
|
3582
|
+
"Scene.pickWithRay",
|
|
3583
|
+
"Thin-instance transforms are not represented by Lite's AABB ray picker; pick the source mesh before adding thin instances or use Lite's GPU picker."
|
|
3584
|
+
);
|
|
3585
|
+
}
|
|
3586
|
+
const registered = this._meshWrappers.get(candidate);
|
|
3587
|
+
const wrapper = registered instanceof AbstractMesh ? registered : Mesh._fromLite(candidate, void 0, this);
|
|
3588
|
+
wrappers.set(candidate, wrapper);
|
|
3589
|
+
}
|
|
3590
|
+
const info = pickMeshesWithRay(
|
|
3591
|
+
candidates,
|
|
3592
|
+
{
|
|
3593
|
+
origin: ray.origin.asArray(),
|
|
3594
|
+
direction: ray.direction.asArray(),
|
|
3595
|
+
length: ray.length
|
|
3596
|
+
},
|
|
3597
|
+
{
|
|
3598
|
+
predicate: (mesh) => {
|
|
3599
|
+
const wrapper = wrappers.get(mesh);
|
|
3600
|
+
return !!wrapper && (predicate ? predicate(wrapper) : wrapper.isEnabled() && wrapper.isVisible && wrapper.isPickable);
|
|
3601
|
+
},
|
|
3602
|
+
skipPickableCheck: !!predicate
|
|
3603
|
+
}
|
|
3604
|
+
);
|
|
3605
|
+
return PickingInfo._fromLite(info, info.pickedMesh ? wrappers.get(info.pickedMesh) ?? null : null, ray);
|
|
2726
3606
|
}
|
|
2727
3607
|
/**
|
|
2728
3608
|
* Babylon.js `scene.enablePhysics(gravity, plugin)`. Wires the given Havok V2
|
|
@@ -3808,14 +4688,14 @@ const _Texture = class _Texture extends BaseTexture {
|
|
|
3808
4688
|
* handle (tracked against the same scene so it is ready at build).
|
|
3809
4689
|
*/
|
|
3810
4690
|
clone() {
|
|
3811
|
-
const
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
return
|
|
4691
|
+
const c = new _Texture(this.name, this._source, this._noMipmap, this._invertY, this.samplingMode);
|
|
4692
|
+
c.uScale = this.uScale;
|
|
4693
|
+
c.vScale = this.vScale;
|
|
4694
|
+
c.uOffset = this.uOffset;
|
|
4695
|
+
c.vOffset = this.vOffset;
|
|
4696
|
+
c.hasAlpha = this.hasAlpha;
|
|
4697
|
+
c.coordinatesIndex = this.coordinatesIndex;
|
|
4698
|
+
return c;
|
|
3819
4699
|
}
|
|
3820
4700
|
whenReadyAsync() {
|
|
3821
4701
|
return this._ready;
|
|
@@ -4284,6 +5164,96 @@ function collectLoadedMeshes(container, registry, scene) {
|
|
|
4284
5164
|
}
|
|
4285
5165
|
return result;
|
|
4286
5166
|
}
|
|
5167
|
+
class Skeleton {
|
|
5168
|
+
constructor(_name, _id, _scene) {
|
|
5169
|
+
__publicField(this, "name");
|
|
5170
|
+
__publicField(this, "id");
|
|
5171
|
+
__publicField(this, "bones");
|
|
5172
|
+
/** @internal Underlying loader-produced Babylon Lite skeleton. */
|
|
5173
|
+
__publicField(this, "_lite");
|
|
5174
|
+
return unsupported(
|
|
5175
|
+
"Skeleton",
|
|
5176
|
+
"Babylon Lite exposes loader-produced skeletons but has no public API for manually constructing a skeleton. Load a skinned glTF and use the returned skeleton."
|
|
5177
|
+
);
|
|
5178
|
+
}
|
|
5179
|
+
/** @internal Wrap a loader-produced Babylon Lite skeleton. */
|
|
5180
|
+
static _fromLite(lite, index) {
|
|
5181
|
+
const skeleton = Object.create(Skeleton.prototype);
|
|
5182
|
+
Object.defineProperties(skeleton, {
|
|
5183
|
+
name: { value: `skeleton${index}`, enumerable: true },
|
|
5184
|
+
id: { value: `skeleton${index}`, enumerable: true },
|
|
5185
|
+
_lite: { value: lite },
|
|
5186
|
+
bones: { value: lite.bones.map((bone) => Bone._fromLite(bone, skeleton)) }
|
|
5187
|
+
});
|
|
5188
|
+
return skeleton;
|
|
5189
|
+
}
|
|
5190
|
+
getBoneIndexByName(name) {
|
|
5191
|
+
const bone = getBoneByName(this._lite, name);
|
|
5192
|
+
return bone ? this._lite.bones.indexOf(bone) : -1;
|
|
5193
|
+
}
|
|
5194
|
+
getBoneByName(name) {
|
|
5195
|
+
const index = this.getBoneIndexByName(name);
|
|
5196
|
+
return index < 0 ? null : this.bones[index];
|
|
5197
|
+
}
|
|
5198
|
+
}
|
|
5199
|
+
class Bone {
|
|
5200
|
+
constructor(_name, _skeleton) {
|
|
5201
|
+
__publicField(this, "_enabled", true);
|
|
5202
|
+
__publicField(this, "name");
|
|
5203
|
+
/** @internal Underlying loader-produced Babylon Lite bone. */
|
|
5204
|
+
__publicField(this, "_lite");
|
|
5205
|
+
/** @internal Owning compat skeleton. */
|
|
5206
|
+
__publicField(this, "_skeleton");
|
|
5207
|
+
return unsupported(
|
|
5208
|
+
"Bone",
|
|
5209
|
+
"Babylon Lite exposes loader-produced bones but has no public API for manually constructing a bone. Use Skeleton.bones from a loaded skinned glTF."
|
|
5210
|
+
);
|
|
5211
|
+
}
|
|
5212
|
+
/** @internal Wrap a loader-produced Babylon Lite bone. */
|
|
5213
|
+
static _fromLite(lite, skeleton) {
|
|
5214
|
+
const bone = Object.create(Bone.prototype);
|
|
5215
|
+
Object.defineProperties(bone, {
|
|
5216
|
+
name: { value: lite.name, enumerable: true },
|
|
5217
|
+
_lite: { value: lite },
|
|
5218
|
+
_skeleton: { value: skeleton },
|
|
5219
|
+
_enabled: { value: true, writable: true }
|
|
5220
|
+
});
|
|
5221
|
+
return bone;
|
|
5222
|
+
}
|
|
5223
|
+
getName() {
|
|
5224
|
+
return this.name;
|
|
5225
|
+
}
|
|
5226
|
+
getSkeleton() {
|
|
5227
|
+
return this._skeleton;
|
|
5228
|
+
}
|
|
5229
|
+
setPosition(position, space = 0) {
|
|
5230
|
+
if (space !== 0) {
|
|
5231
|
+
return unsupported("Bone.setPosition", "Babylon Lite's bone-control API currently exposes local-space position overrides only.");
|
|
5232
|
+
}
|
|
5233
|
+
setBonePosition(this._skeleton._lite, this._lite, position.x, position.y, position.z);
|
|
5234
|
+
return this;
|
|
5235
|
+
}
|
|
5236
|
+
setRotationQuaternion(rotation, space = 0) {
|
|
5237
|
+
if (space !== 0) {
|
|
5238
|
+
return unsupported("Bone.setRotationQuaternion", "Babylon Lite's bone-control API currently exposes local-space rotation overrides only.");
|
|
5239
|
+
}
|
|
5240
|
+
setBoneRotationQuaternion(this._skeleton._lite, this._lite, rotation.x, rotation.y, rotation.z, rotation.w);
|
|
5241
|
+
return this;
|
|
5242
|
+
}
|
|
5243
|
+
setScale(scale) {
|
|
5244
|
+
setBoneScaling(this._skeleton._lite, this._lite, scale.x, scale.y, scale.z);
|
|
5245
|
+
return this;
|
|
5246
|
+
}
|
|
5247
|
+
setEnabled(value) {
|
|
5248
|
+
this._enabled = value;
|
|
5249
|
+
}
|
|
5250
|
+
isEnabled() {
|
|
5251
|
+
return this._enabled;
|
|
5252
|
+
}
|
|
5253
|
+
returnToRest() {
|
|
5254
|
+
clearBoneOverride(this._skeleton._lite, this._lite);
|
|
5255
|
+
}
|
|
5256
|
+
}
|
|
4287
5257
|
function urlPath(url) {
|
|
4288
5258
|
return url.split(/[?#]/)[0];
|
|
4289
5259
|
}
|
|
@@ -4306,6 +5276,8 @@ class AssetContainer {
|
|
|
4306
5276
|
__publicField(this, "_meshRegistry", /* @__PURE__ */ new Map());
|
|
4307
5277
|
/** @internal The compat scene this container was added to, if any (drives scene-aware wrappers). */
|
|
4308
5278
|
__publicField(this, "_scene");
|
|
5279
|
+
/** @internal Canonical loaded-skeleton wrappers. */
|
|
5280
|
+
__publicField(this, "_skeletons");
|
|
4309
5281
|
this._lite = lite;
|
|
4310
5282
|
}
|
|
4311
5283
|
get animationGroups() {
|
|
@@ -4320,6 +5292,9 @@ class AssetContainer {
|
|
|
4320
5292
|
get meshes() {
|
|
4321
5293
|
return collectLoadedMeshes(this._lite, this._meshRegistry, this._scene);
|
|
4322
5294
|
}
|
|
5295
|
+
get skeletons() {
|
|
5296
|
+
return this._skeletons ?? (this._skeletons = (this._lite.skeletons ?? []).map((skeleton, index) => Skeleton._fromLite(skeleton, index)));
|
|
5297
|
+
}
|
|
4323
5298
|
/** Add every entity, animation group, camera, and clear colour to the scene. */
|
|
4324
5299
|
addAllToScene(scene) {
|
|
4325
5300
|
addToScene(scene._lite, this._lite);
|
|
@@ -4347,6 +5322,9 @@ function joinUrl(rootUrl, fileName) {
|
|
|
4347
5322
|
async function load(rootUrl, fileName, scene) {
|
|
4348
5323
|
const url = joinUrl(rootUrl, fileName);
|
|
4349
5324
|
const engine = scene.getEngine()._lite;
|
|
5325
|
+
if (!isBabylonUrl(url)) {
|
|
5326
|
+
enableBoneControlForSkinnedAssets();
|
|
5327
|
+
}
|
|
4350
5328
|
const lite = isBabylonUrl(url) ? await loadBabylon(engine, url) : await loadGltf(engine, url);
|
|
4351
5329
|
return new AssetContainer(lite);
|
|
4352
5330
|
}
|
|
@@ -4362,7 +5340,7 @@ const SceneLoader = {
|
|
|
4362
5340
|
return {
|
|
4363
5341
|
meshes: container.meshes,
|
|
4364
5342
|
particleSystems: [],
|
|
4365
|
-
skeletons:
|
|
5343
|
+
skeletons: container.skeletons,
|
|
4366
5344
|
animationGroups: container.animationGroups,
|
|
4367
5345
|
transformNodes: [],
|
|
4368
5346
|
lights: [],
|
|
@@ -4401,7 +5379,7 @@ async function ImportMeshAsync(source, scene, _options) {
|
|
|
4401
5379
|
return {
|
|
4402
5380
|
meshes: container.meshes,
|
|
4403
5381
|
particleSystems: [],
|
|
4404
|
-
skeletons:
|
|
5382
|
+
skeletons: container.skeletons,
|
|
4405
5383
|
animationGroups: container.animationGroups,
|
|
4406
5384
|
transformNodes: [],
|
|
4407
5385
|
lights: [],
|
|
@@ -4422,6 +5400,9 @@ async function LoadAssetContainerAsync(source, scene, _options) {
|
|
|
4422
5400
|
}
|
|
4423
5401
|
async function loadFromSource(source, scene) {
|
|
4424
5402
|
const engine = scene.getEngine()._lite;
|
|
5403
|
+
if (!isBabylonUrl(source)) {
|
|
5404
|
+
enableBoneControlForSkinnedAssets();
|
|
5405
|
+
}
|
|
4425
5406
|
const lite = isBabylonUrl(source) ? await loadBabylon(engine, source) : await loadGltf(engine, source);
|
|
4426
5407
|
return new AssetContainer(lite);
|
|
4427
5408
|
}
|
|
@@ -5930,9 +6911,9 @@ class BounceEase extends EasingFunction {
|
|
|
5930
6911
|
}
|
|
5931
6912
|
}
|
|
5932
6913
|
function RandomGUID() {
|
|
5933
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (
|
|
6914
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
5934
6915
|
const r2 = Math.random() * 16 | 0;
|
|
5935
|
-
const v2 =
|
|
6916
|
+
const v2 = c === "x" ? r2 : r2 & 3 | 8;
|
|
5936
6917
|
return v2.toString(16);
|
|
5937
6918
|
});
|
|
5938
6919
|
}
|
|
@@ -7635,16 +8616,6 @@ const SceneSerializer = {
|
|
|
7635
8616
|
return unsupported("SceneSerializer.SerializeMesh", "Babylon Lite does not implement mesh serialization.");
|
|
7636
8617
|
}
|
|
7637
8618
|
};
|
|
7638
|
-
class Skeleton {
|
|
7639
|
-
constructor() {
|
|
7640
|
-
unsupported("Skeleton", "Skeletons are produced by the glTF loader in Babylon Lite and driven by `createAnimationController`; they are not constructed manually.");
|
|
7641
|
-
}
|
|
7642
|
-
}
|
|
7643
|
-
class Bone {
|
|
7644
|
-
constructor() {
|
|
7645
|
-
unsupported("Bone", "Bones are produced by the glTF loader in Babylon Lite; manual bone construction is not wrapped.");
|
|
7646
|
-
}
|
|
7647
|
-
}
|
|
7648
8619
|
class ReflectionProbe {
|
|
7649
8620
|
constructor() {
|
|
7650
8621
|
unsupported("ReflectionProbe", "Dynamic reflection probes are not implemented in Babylon Lite.");
|
|
@@ -7741,21 +8712,6 @@ class PointsCloudSystem {
|
|
|
7741
8712
|
unsupported("PointsCloudSystem", "Point-cloud systems are not implemented in Babylon Lite. For Gaussian splats use the native splat loaders.");
|
|
7742
8713
|
}
|
|
7743
8714
|
}
|
|
7744
|
-
class PhysicsAggregate {
|
|
7745
|
-
constructor() {
|
|
7746
|
-
unsupported("PhysicsAggregate", "Use the native `createPhysicsAggregate` API instead of the Babylon.js PhysicsAggregate class.");
|
|
7747
|
-
}
|
|
7748
|
-
}
|
|
7749
|
-
class PhysicsBody {
|
|
7750
|
-
constructor() {
|
|
7751
|
-
unsupported("PhysicsBody", "Use the native `createPhysicsBody` API.");
|
|
7752
|
-
}
|
|
7753
|
-
}
|
|
7754
|
-
class PhysicsShape {
|
|
7755
|
-
constructor() {
|
|
7756
|
-
unsupported("PhysicsShape", "Use the native `createPhysicsShape` API.");
|
|
7757
|
-
}
|
|
7758
|
-
}
|
|
7759
8715
|
class CannonJSPlugin {
|
|
7760
8716
|
constructor() {
|
|
7761
8717
|
unsupported("CannonJSPlugin", "Babylon Lite physics is Havok-V2 only.");
|
|
@@ -8147,7 +9103,7 @@ export {
|
|
|
8147
9103
|
AbstractAudioNode,
|
|
8148
9104
|
AbstractAudioOutNode,
|
|
8149
9105
|
AbstractEngine,
|
|
8150
|
-
|
|
9106
|
+
AbstractMesh,
|
|
8151
9107
|
AbstractNamedAudioNode,
|
|
8152
9108
|
AbstractScene,
|
|
8153
9109
|
AbstractSound,
|
|
@@ -8196,14 +9152,15 @@ export {
|
|
|
8196
9152
|
B as BoundingBox,
|
|
8197
9153
|
BoundingBoxGizmo,
|
|
8198
9154
|
BoundingBoxRenderer,
|
|
8199
|
-
|
|
8200
|
-
|
|
9155
|
+
d as BoundingInfo,
|
|
9156
|
+
e as BoundingSphere,
|
|
8201
9157
|
CSG,
|
|
8202
9158
|
CSG2,
|
|
8203
9159
|
Camera,
|
|
8204
9160
|
CameraGizmo,
|
|
8205
9161
|
CannonJSPlugin,
|
|
8206
9162
|
CascadedShadowGenerator,
|
|
9163
|
+
CharacterSupportedState,
|
|
8207
9164
|
ChromaticAberrationPostProcess,
|
|
8208
9165
|
CircleEase,
|
|
8209
9166
|
ClusteredLightContainer,
|
|
@@ -8217,28 +9174,28 @@ export {
|
|
|
8217
9174
|
Constants,
|
|
8218
9175
|
CreateAudioBusAsync,
|
|
8219
9176
|
CreateAudioEngineAsync,
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
9177
|
+
f as CreateBox,
|
|
9178
|
+
g as CreateCylinder,
|
|
9179
|
+
h as CreateDashedLines,
|
|
9180
|
+
i as CreateDisc,
|
|
8224
9181
|
CreateGreasedLine,
|
|
8225
9182
|
CreateGreasedLineMaterial,
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
9183
|
+
j as CreateGround,
|
|
9184
|
+
k as CreateLineSystem,
|
|
9185
|
+
m as CreateLines,
|
|
8229
9186
|
CreateMainAudioBusAsync,
|
|
8230
9187
|
CreateMicrophoneSoundSourceAsync,
|
|
8231
|
-
|
|
9188
|
+
n as CreatePlane,
|
|
8232
9189
|
CreateSoundAsync,
|
|
8233
9190
|
CreateSoundBufferAsync,
|
|
8234
9191
|
CreateSoundSourceAsync,
|
|
8235
|
-
|
|
9192
|
+
o as CreateSphere,
|
|
8236
9193
|
CreateStreamingSoundAsync,
|
|
8237
9194
|
CreateTexture2DArrayFromImageUrlsAsync,
|
|
8238
9195
|
CreateTexture2DArrayFromKTX2Async,
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
9196
|
+
p as CreateTiledBox,
|
|
9197
|
+
q as CreateTiledPlane,
|
|
9198
|
+
r as CreateTorus,
|
|
8242
9199
|
CubeTexture,
|
|
8243
9200
|
CubicEase,
|
|
8244
9201
|
Curve3,
|
|
@@ -8321,17 +9278,17 @@ export {
|
|
|
8321
9278
|
Layer,
|
|
8322
9279
|
Light,
|
|
8323
9280
|
LightGizmo,
|
|
8324
|
-
|
|
9281
|
+
s as LinesMesh,
|
|
8325
9282
|
LiteCompatError,
|
|
8326
9283
|
LoadAssetContainerAsync,
|
|
8327
9284
|
LoadImageToTexture2DArrayLayerAsync,
|
|
8328
9285
|
Logger,
|
|
8329
9286
|
MainAudioBus,
|
|
8330
|
-
|
|
9287
|
+
t as Material,
|
|
8331
9288
|
MaterialGreasedLineDefines,
|
|
8332
9289
|
Matrix,
|
|
8333
9290
|
Mesh,
|
|
8334
|
-
|
|
9291
|
+
v as MeshBuilder,
|
|
8335
9292
|
MeshoptCompression,
|
|
8336
9293
|
MirrorTexture,
|
|
8337
9294
|
MorphTarget,
|
|
@@ -8347,12 +9304,12 @@ export {
|
|
|
8347
9304
|
OnAudioEngineV2CreatedObservable,
|
|
8348
9305
|
OutlineRenderer,
|
|
8349
9306
|
P as PBRAnisotropicConfiguration,
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
9307
|
+
w as PBRClearCoatConfiguration,
|
|
9308
|
+
x as PBRIridescenceConfiguration,
|
|
9309
|
+
y as PBRMaterial,
|
|
9310
|
+
z as PBRMetallicRoughnessMaterial,
|
|
9311
|
+
D as PBRSheenConfiguration,
|
|
9312
|
+
E as PBRSpecularGlossinessMaterial,
|
|
8356
9313
|
ParticleHelper,
|
|
8357
9314
|
ParticleSystem,
|
|
8358
9315
|
ParticleSystemSet,
|
|
@@ -8360,23 +9317,26 @@ export {
|
|
|
8360
9317
|
PerformanceMonitor,
|
|
8361
9318
|
PhysicsAggregate,
|
|
8362
9319
|
PhysicsBody,
|
|
9320
|
+
PhysicsCharacterController,
|
|
8363
9321
|
PhysicsConstraintType,
|
|
8364
9322
|
PhysicsEngine,
|
|
8365
9323
|
PhysicsMotionType,
|
|
8366
9324
|
PhysicsPrestepType,
|
|
8367
9325
|
PhysicsShape,
|
|
8368
9326
|
PhysicsShapeType,
|
|
9327
|
+
PickingInfo,
|
|
8369
9328
|
Plane,
|
|
8370
9329
|
PlaneDragGizmo,
|
|
8371
9330
|
PlaneRotationGizmo,
|
|
8372
9331
|
PointLight,
|
|
8373
9332
|
PointerDragBehavior,
|
|
8374
9333
|
PointsCloudSystem,
|
|
9334
|
+
Polar,
|
|
8375
9335
|
PositionGizmo,
|
|
8376
9336
|
PostProcess,
|
|
8377
9337
|
PrecisionDate,
|
|
8378
9338
|
PredicateCondition,
|
|
8379
|
-
|
|
9339
|
+
F as PushMaterial,
|
|
8380
9340
|
QuadraticEase,
|
|
8381
9341
|
QuarticEase,
|
|
8382
9342
|
Quaternion,
|
|
@@ -8416,6 +9376,7 @@ export {
|
|
|
8416
9376
|
SoundState,
|
|
8417
9377
|
Space,
|
|
8418
9378
|
SpatialAudioAttachmentType,
|
|
9379
|
+
Spherical,
|
|
8419
9380
|
SpotLight,
|
|
8420
9381
|
Sprite,
|
|
8421
9382
|
SpriteManager,
|
|
@@ -8447,7 +9408,7 @@ export {
|
|
|
8447
9408
|
UtilityLayerRenderer,
|
|
8448
9409
|
ValueCondition,
|
|
8449
9410
|
ValueConditionOperators,
|
|
8450
|
-
|
|
9411
|
+
Vector2,
|
|
8451
9412
|
Vector3,
|
|
8452
9413
|
H as Vector4,
|
|
8453
9414
|
J as VertexBuffer,
|
|
@@ -8457,8 +9418,8 @@ export {
|
|
|
8457
9418
|
WebGPUEngine,
|
|
8458
9419
|
WebXRCamera,
|
|
8459
9420
|
WeightedSound,
|
|
8460
|
-
|
|
8461
|
-
|
|
9421
|
+
R as transformCoordinates,
|
|
9422
|
+
U as transformNormal,
|
|
8462
9423
|
unsupported
|
|
8463
9424
|
};
|
|
8464
9425
|
//# sourceMappingURL=index.js.map
|