@babylonjs/core 5.17.1 → 5.20.0
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/Debug/debugLayer.d.ts +36 -0
- package/Debug/debugLayer.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSource.d.ts +1 -1
- package/DeviceInput/InputDevices/deviceSource.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.d.ts +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.js +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
- package/DeviceInput/{Helpers/eventFactory.d.ts → eventFactory.d.ts} +4 -4
- package/DeviceInput/{Helpers/eventFactory.js → eventFactory.js} +2 -2
- package/DeviceInput/eventFactory.js.map +1 -0
- package/DeviceInput/{InputDevices/inputInterfaces.d.ts → inputInterfaces.d.ts} +2 -2
- package/DeviceInput/{InputDevices/inputInterfaces.js → inputInterfaces.js} +0 -0
- package/DeviceInput/inputInterfaces.js.map +1 -0
- package/DeviceInput/{InputDevices/internalDeviceSourceManager.d.ts → internalDeviceSourceManager.d.ts} +7 -7
- package/DeviceInput/{InputDevices/internalDeviceSourceManager.js → internalDeviceSourceManager.js} +2 -2
- package/DeviceInput/internalDeviceSourceManager.js.map +1 -0
- package/DeviceInput/{InputDevices/nativeDeviceInputSystem.d.ts → nativeDeviceInputSystem.d.ts} +2 -2
- package/DeviceInput/{InputDevices/nativeDeviceInputSystem.js → nativeDeviceInputSystem.js} +2 -2
- package/DeviceInput/nativeDeviceInputSystem.js.map +1 -0
- package/DeviceInput/{InputDevices/webDeviceInputSystem.d.ts → webDeviceInputSystem.d.ts} +3 -3
- package/DeviceInput/{InputDevices/webDeviceInputSystem.js → webDeviceInputSystem.js} +4 -4
- package/DeviceInput/webDeviceInputSystem.js.map +1 -0
- package/Engines/Extensions/engine.query.js +5 -1
- package/Engines/Extensions/engine.query.js.map +1 -1
- package/Engines/Extensions/engine.transformFeedback.js +5 -1
- package/Engines/Extensions/engine.transformFeedback.js.map +1 -1
- package/Engines/Extensions/engine.views.d.ts +13 -0
- package/Engines/Extensions/engine.views.js +16 -1
- package/Engines/Extensions/engine.views.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +1 -1
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/engine.d.ts +15 -240
- package/Engines/engineFeatures.d.ts +2 -0
- package/Engines/engineFeatures.js.map +1 -1
- package/Engines/nativeEngine.js +1 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +1 -1
- package/Engines/thinEngine.js +14 -4
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +1 -0
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/axisDragGizmo.d.ts +31 -9
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.d.ts +46 -14
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +94 -19
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/cameraGizmo.d.ts +23 -6
- package/Gizmos/cameraGizmo.js.map +1 -1
- package/Gizmos/gizmo.d.ts +48 -6
- package/Gizmos/gizmo.js.map +1 -1
- package/Gizmos/gizmoManager.d.ts +25 -17
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/lightGizmo.d.ts +25 -8
- package/Gizmos/lightGizmo.js.map +1 -1
- package/Gizmos/planeDragGizmo.d.ts +30 -9
- package/Gizmos/planeDragGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.d.ts +45 -15
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Gizmos/positionGizmo.d.ts +53 -17
- package/Gizmos/positionGizmo.js +1 -1
- package/Gizmos/positionGizmo.js.map +1 -1
- package/Gizmos/rotationGizmo.d.ts +35 -10
- package/Gizmos/rotationGizmo.js.map +1 -1
- package/Gizmos/scaleGizmo.d.ts +49 -18
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +16 -4
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.d.ts +39 -0
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +97 -0
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -0
- package/Materials/Node/Blocks/Fragment/index.d.ts +1 -0
- package/Materials/Node/Blocks/Fragment/index.js +1 -0
- package/Materials/Node/Blocks/Fragment/index.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.d.ts +18 -0
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +85 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +6 -0
- package/Materials/Node/nodeMaterial.js +11 -0
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +5 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +3 -0
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.js +9 -5
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/index.d.ts +1 -0
- package/Materials/index.js +1 -0
- package/Materials/index.js.map +1 -1
- package/Maths/math.vector.d.ts +134 -8
- package/Maths/math.vector.js +168 -36
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Compression/dracoCompression.js +1 -1
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/groundMesh.js +1 -1
- package/Meshes/groundMesh.js.map +1 -1
- package/Meshes/mesh.js +1 -0
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/transformNode.js +1 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/assetsManager.d.ts +9 -0
- package/Misc/assetsManager.js +3 -1
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/basis.js +10 -4
- package/Misc/basis.js.map +1 -1
- package/Misc/computePressure.d.ts +9 -3
- package/Misc/computePressure.js +13 -5
- package/Misc/computePressure.js.map +1 -1
- package/Misc/fileTools.js +2 -2
- package/Misc/fileTools.js.map +1 -1
- package/Misc/iInspectable.d.ts +12 -2
- package/Misc/iInspectable.js +4 -0
- package/Misc/iInspectable.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +1 -1
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/sceneSerializer.js +1 -1
- package/Misc/sceneSerializer.js.map +1 -1
- package/Misc/tools.d.ts +2 -2
- package/Misc/tools.js +4 -1
- package/Misc/tools.js.map +1 -1
- package/Offline/database.js +6 -8
- package/Offline/database.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +1 -0
- package/Particles/solidParticleSystem.js +4 -1
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Physics/Plugins/ammoJSPlugin.d.ts +2 -2
- package/Physics/Plugins/ammoJSPlugin.js +29 -29
- package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/Plugins/cannonJSPlugin.d.ts +2 -2
- package/Physics/Plugins/cannonJSPlugin.js +26 -26
- package/Physics/Plugins/cannonJSPlugin.js.map +1 -1
- package/Physics/Plugins/oimoJSPlugin.js +9 -11
- package/Physics/Plugins/oimoJSPlugin.js.map +1 -1
- package/Physics/physicsImpostor.d.ts +6 -6
- package/Physics/physicsImpostor.js +15 -8
- package/Physics/physicsImpostor.js.map +1 -1
- package/Shaders/sprites.fragment.js +1 -1
- package/Shaders/sprites.fragment.js.map +1 -1
- package/Sprites/spriteRenderer.js +1 -1
- package/Sprites/spriteRenderer.js.map +1 -1
- package/XR/webXRDefaultExperience.d.ts +10 -0
- package/XR/webXRDefaultExperience.js +2 -12
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXRExperienceHelper.js +12 -12
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/node.d.ts +2 -0
- package/node.js +2 -0
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +1 -1
- package/scene.js +5 -3
- package/scene.js.map +1 -1
- package/DeviceInput/Helpers/eventFactory.js.map +0 -1
- package/DeviceInput/InputDevices/inputInterfaces.js.map +0 -1
- package/DeviceInput/InputDevices/internalDeviceSourceManager.js.map +0 -1
- package/DeviceInput/InputDevices/nativeDeviceInputSystem.js.map +0 -1
- package/DeviceInput/InputDevices/webDeviceInputSystem.js.map +0 -1
|
@@ -378,8 +378,8 @@ export declare class AmmoJSPlugin implements IPhysicsEnginePlugin {
|
|
|
378
378
|
dispose(): void;
|
|
379
379
|
/**
|
|
380
380
|
* Does a raycast in the physics world
|
|
381
|
-
* @param from
|
|
382
|
-
* @param to
|
|
381
|
+
* @param from where should the ray start?
|
|
382
|
+
* @param to where should the ray end?
|
|
383
383
|
* @returns PhysicsRaycastResult
|
|
384
384
|
*/
|
|
385
385
|
raycast(from: Vector3, to: Vector3): PhysicsRaycastResult;
|
|
@@ -805,7 +805,7 @@ var AmmoJSPlugin = /** @class */ (function () {
|
|
|
805
805
|
if (ignoreChildren === void 0) { ignoreChildren = false; }
|
|
806
806
|
var object = impostor.object;
|
|
807
807
|
var returnValue;
|
|
808
|
-
var
|
|
808
|
+
var impostorExtents = impostor.getObjectExtents();
|
|
809
809
|
if (!ignoreChildren) {
|
|
810
810
|
var meshChildren = impostor.object.getChildMeshes ? impostor.object.getChildMeshes(true) : [];
|
|
811
811
|
returnValue = new this.bjsAMMO.btCompoundShape();
|
|
@@ -852,50 +852,50 @@ var AmmoJSPlugin = /** @class */ (function () {
|
|
|
852
852
|
switch (impostor.type) {
|
|
853
853
|
case PhysicsImpostor.SphereImpostor:
|
|
854
854
|
// Is there a better way to compare floats number? With an epsilon or with a Math function
|
|
855
|
-
if (Scalar.WithinEpsilon(
|
|
856
|
-
returnValue = new this.bjsAMMO.btSphereShape(
|
|
855
|
+
if (Scalar.WithinEpsilon(impostorExtents.x, impostorExtents.y, 0.0001) && Scalar.WithinEpsilon(impostorExtents.x, impostorExtents.z, 0.0001)) {
|
|
856
|
+
returnValue = new this.bjsAMMO.btSphereShape(impostorExtents.x / 2);
|
|
857
857
|
}
|
|
858
858
|
else {
|
|
859
859
|
// create a btMultiSphereShape because it's not possible to set a local scaling on a btSphereShape
|
|
860
860
|
var positions = [new this.bjsAMMO.btVector3(0, 0, 0)];
|
|
861
861
|
var radii = [1];
|
|
862
862
|
returnValue = new this.bjsAMMO.btMultiSphereShape(positions, radii, 1);
|
|
863
|
-
returnValue.setLocalScaling(new this.bjsAMMO.btVector3(
|
|
863
|
+
returnValue.setLocalScaling(new this.bjsAMMO.btVector3(impostorExtents.x / 2, impostorExtents.y / 2, impostorExtents.z / 2));
|
|
864
864
|
}
|
|
865
865
|
break;
|
|
866
866
|
case PhysicsImpostor.CapsuleImpostor:
|
|
867
867
|
{
|
|
868
868
|
// https://pybullet.org/Bullet/BulletFull/classbtCapsuleShape.html#details
|
|
869
869
|
// Height is just the height between the center of each 'sphere' of the capsule caps
|
|
870
|
-
var capRadius =
|
|
871
|
-
returnValue = new this.bjsAMMO.btCapsuleShape(capRadius,
|
|
870
|
+
var capRadius = impostorExtents.x / 2;
|
|
871
|
+
returnValue = new this.bjsAMMO.btCapsuleShape(capRadius, impostorExtents.y - capRadius * 2);
|
|
872
872
|
}
|
|
873
873
|
break;
|
|
874
874
|
case PhysicsImpostor.CylinderImpostor:
|
|
875
|
-
this._tmpAmmoVectorA.setValue(
|
|
875
|
+
this._tmpAmmoVectorA.setValue(impostorExtents.x / 2, impostorExtents.y / 2, impostorExtents.z / 2);
|
|
876
876
|
returnValue = new this.bjsAMMO.btCylinderShape(this._tmpAmmoVectorA);
|
|
877
877
|
break;
|
|
878
878
|
case PhysicsImpostor.PlaneImpostor:
|
|
879
879
|
case PhysicsImpostor.BoxImpostor:
|
|
880
|
-
this._tmpAmmoVectorA.setValue(
|
|
880
|
+
this._tmpAmmoVectorA.setValue(impostorExtents.x / 2, impostorExtents.y / 2, impostorExtents.z / 2);
|
|
881
881
|
returnValue = new this.bjsAMMO.btBoxShape(this._tmpAmmoVectorA);
|
|
882
882
|
break;
|
|
883
883
|
case PhysicsImpostor.MeshImpostor: {
|
|
884
884
|
if (impostor.getParam("mass") == 0) {
|
|
885
|
-
// Only create btBvhTriangleMeshShape impostor is static
|
|
885
|
+
// Only create btBvhTriangleMeshShape if the impostor is static
|
|
886
886
|
// See https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=7283
|
|
887
887
|
if (this.onCreateCustomMeshImpostor) {
|
|
888
888
|
returnValue = this.onCreateCustomMeshImpostor(impostor);
|
|
889
889
|
}
|
|
890
890
|
else {
|
|
891
|
-
var
|
|
892
|
-
impostor._pluginData.toDispose.push(
|
|
893
|
-
var
|
|
894
|
-
if (
|
|
891
|
+
var triMesh = new this.bjsAMMO.btTriangleMesh();
|
|
892
|
+
impostor._pluginData.toDispose.push(triMesh);
|
|
893
|
+
var triangleCount = this._addMeshVerts(triMesh, object, object);
|
|
894
|
+
if (triangleCount == 0) {
|
|
895
895
|
returnValue = new this.bjsAMMO.btCompoundShape();
|
|
896
896
|
}
|
|
897
897
|
else {
|
|
898
|
-
returnValue = new this.bjsAMMO.btBvhTriangleMeshShape(
|
|
898
|
+
returnValue = new this.bjsAMMO.btBvhTriangleMeshShape(triMesh);
|
|
899
899
|
}
|
|
900
900
|
}
|
|
901
901
|
break;
|
|
@@ -908,22 +908,22 @@ var AmmoJSPlugin = /** @class */ (function () {
|
|
|
908
908
|
returnValue = this.onCreateCustomConvexHullImpostor(impostor);
|
|
909
909
|
}
|
|
910
910
|
else {
|
|
911
|
-
var
|
|
912
|
-
var
|
|
913
|
-
if (
|
|
911
|
+
var convexHull = new this.bjsAMMO.btConvexHullShape();
|
|
912
|
+
var triangleCount = this._addHullVerts(convexHull, object, object);
|
|
913
|
+
if (triangleCount == 0) {
|
|
914
914
|
// Cleanup Unused Convex Hull Shape
|
|
915
|
-
impostor._pluginData.toDispose.push(
|
|
915
|
+
impostor._pluginData.toDispose.push(convexHull);
|
|
916
916
|
returnValue = new this.bjsAMMO.btCompoundShape();
|
|
917
917
|
}
|
|
918
918
|
else {
|
|
919
|
-
returnValue =
|
|
919
|
+
returnValue = convexHull;
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
922
|
break;
|
|
923
923
|
}
|
|
924
924
|
case PhysicsImpostor.NoImpostor:
|
|
925
925
|
// Fill with sphere but collision is disabled on the rigid body in generatePhysicsBody, using an empty shape caused unexpected movement with joints
|
|
926
|
-
returnValue = new this.bjsAMMO.btSphereShape(
|
|
926
|
+
returnValue = new this.bjsAMMO.btSphereShape(impostorExtents.x / 2);
|
|
927
927
|
break;
|
|
928
928
|
case PhysicsImpostor.CustomImpostor:
|
|
929
929
|
// Only usable when the plugin's onCreateCustomShape is set
|
|
@@ -1340,8 +1340,8 @@ var AmmoJSPlugin = /** @class */ (function () {
|
|
|
1340
1340
|
* @returns the radius
|
|
1341
1341
|
*/
|
|
1342
1342
|
AmmoJSPlugin.prototype.getRadius = function (impostor) {
|
|
1343
|
-
var
|
|
1344
|
-
return
|
|
1343
|
+
var extents = impostor.getObjectExtents();
|
|
1344
|
+
return extents.x / 2;
|
|
1345
1345
|
};
|
|
1346
1346
|
/**
|
|
1347
1347
|
* Gets the box size of the impostor
|
|
@@ -1349,10 +1349,10 @@ var AmmoJSPlugin = /** @class */ (function () {
|
|
|
1349
1349
|
* @param result the resulting box size
|
|
1350
1350
|
*/
|
|
1351
1351
|
AmmoJSPlugin.prototype.getBoxSizeToRef = function (impostor, result) {
|
|
1352
|
-
var
|
|
1353
|
-
result.x =
|
|
1354
|
-
result.y =
|
|
1355
|
-
result.z =
|
|
1352
|
+
var extents = impostor.getObjectExtents();
|
|
1353
|
+
result.x = extents.x;
|
|
1354
|
+
result.y = extents.y;
|
|
1355
|
+
result.z = extents.z;
|
|
1356
1356
|
};
|
|
1357
1357
|
/**
|
|
1358
1358
|
* Disposes of the impostor
|
|
@@ -1364,7 +1364,7 @@ var AmmoJSPlugin = /** @class */ (function () {
|
|
|
1364
1364
|
this.bjsAMMO.destroy(this._overlappingPairCache);
|
|
1365
1365
|
this.bjsAMMO.destroy(this._dispatcher);
|
|
1366
1366
|
this.bjsAMMO.destroy(this._collisionConfiguration);
|
|
1367
|
-
// Dispose of
|
|
1367
|
+
// Dispose of temp variables
|
|
1368
1368
|
this.bjsAMMO.destroy(this._tmpAmmoVectorA);
|
|
1369
1369
|
this.bjsAMMO.destroy(this._tmpAmmoVectorB);
|
|
1370
1370
|
this.bjsAMMO.destroy(this._tmpAmmoVectorC);
|
|
@@ -1375,8 +1375,8 @@ var AmmoJSPlugin = /** @class */ (function () {
|
|
|
1375
1375
|
};
|
|
1376
1376
|
/**
|
|
1377
1377
|
* Does a raycast in the physics world
|
|
1378
|
-
* @param from
|
|
1379
|
-
* @param to
|
|
1378
|
+
* @param from where should the ray start?
|
|
1379
|
+
* @param to where should the ray end?
|
|
1380
1380
|
* @returns PhysicsRaycastResult
|
|
1381
1381
|
*/
|
|
1382
1382
|
AmmoJSPlugin.prototype.raycast = function (from, to) {
|