@babylonjs/core 5.17.0 → 5.19.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/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/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/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 +8 -1
- package/Materials/Node/nodeMaterial.js +15 -3
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +2 -1
- package/Materials/Textures/baseTexture.js +4 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +3 -0
- package/Materials/Textures/renderTargetTexture.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 +18 -3
- package/Maths/math.vector.js +52 -31
- 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/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/khronosTextureContainer2.js +1 -1
- package/Misc/khronosTextureContainer2.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/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/package.json +1 -1
- package/scene.js +5 -3
- package/scene.js.map +1 -1
package/Maths/math.vector.js
CHANGED
|
@@ -406,6 +406,16 @@ var Vector2 = /** @class */ (function () {
|
|
|
406
406
|
Vector2.One = function () {
|
|
407
407
|
return new Vector2(1, 1);
|
|
408
408
|
};
|
|
409
|
+
Object.defineProperty(Vector2, "ZeroReadOnly", {
|
|
410
|
+
/**
|
|
411
|
+
* Gets a zero Vector2 that must not be updated
|
|
412
|
+
*/
|
|
413
|
+
get: function () {
|
|
414
|
+
return Vector2._ZeroReadOnly;
|
|
415
|
+
},
|
|
416
|
+
enumerable: false,
|
|
417
|
+
configurable: true
|
|
418
|
+
});
|
|
409
419
|
/**
|
|
410
420
|
* Gets a new Vector2 set from the given index element of the given array
|
|
411
421
|
* @param array defines the data source
|
|
@@ -677,6 +687,7 @@ var Vector2 = /** @class */ (function () {
|
|
|
677
687
|
var proj = segA.add(v.multiplyByFloats(t, t));
|
|
678
688
|
return Vector2.Distance(p, proj);
|
|
679
689
|
};
|
|
690
|
+
Vector2._ZeroReadOnly = Vector2.Zero();
|
|
680
691
|
return Vector2;
|
|
681
692
|
}());
|
|
682
693
|
export { Vector2 };
|
|
@@ -989,7 +1000,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
989
1000
|
return result.addInPlaceFromFloats(this._x * scale, this._y * scale, this._z * scale);
|
|
990
1001
|
};
|
|
991
1002
|
/**
|
|
992
|
-
* Projects the current
|
|
1003
|
+
* Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
|
|
993
1004
|
* @param plane defines the plane to project to
|
|
994
1005
|
* @param origin defines the origin of the projection ray
|
|
995
1006
|
* @returns the projected vector3
|
|
@@ -1000,41 +1011,29 @@ var Vector3 = /** @class */ (function () {
|
|
|
1000
1011
|
return result;
|
|
1001
1012
|
};
|
|
1002
1013
|
/**
|
|
1003
|
-
* Projects the current
|
|
1014
|
+
* Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
|
|
1004
1015
|
* @param plane defines the plane to project to
|
|
1005
1016
|
* @param origin defines the origin of the projection ray
|
|
1006
1017
|
* @param result defines the Vector3 where to store the result
|
|
1007
1018
|
*/
|
|
1008
1019
|
Vector3.prototype.projectOnPlaneToRef = function (plane, origin, result) {
|
|
1009
|
-
|
|
1010
|
-
var
|
|
1011
|
-
|
|
1012
|
-
//
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
*/
|
|
1026
|
-
if (dotProduct <= Epsilon * Epsilon) {
|
|
1027
|
-
// No good option for setting the result vector here, so just take the origin of the ray
|
|
1028
|
-
result.copyFrom(origin);
|
|
1029
|
-
return;
|
|
1020
|
+
var n = plane.normal;
|
|
1021
|
+
var d = plane.d;
|
|
1022
|
+
var V = MathTmp.Vector3[0];
|
|
1023
|
+
// ray direction
|
|
1024
|
+
this.subtractToRef(origin, V);
|
|
1025
|
+
V.normalize();
|
|
1026
|
+
var denom = Vector3.Dot(V, n);
|
|
1027
|
+
//When the ray is close to parallel to the plane return infinity vector
|
|
1028
|
+
if (Math.abs(denom) < Math.pow(10, -10)) {
|
|
1029
|
+
result.setAll(Infinity);
|
|
1030
|
+
}
|
|
1031
|
+
else {
|
|
1032
|
+
var t = -(Vector3.Dot(origin, n) + d) / denom;
|
|
1033
|
+
// P = P0 + t*V
|
|
1034
|
+
var scaledV = V.scaleInPlace(t);
|
|
1035
|
+
origin.addToRef(scaledV, result);
|
|
1030
1036
|
}
|
|
1031
|
-
// Calculate the offset
|
|
1032
|
-
var relativeOrigin = MathTmp.Vector3[2];
|
|
1033
|
-
planeOrigin.subtractToRef(origin, relativeOrigin);
|
|
1034
|
-
// Calculate the length along the direction vector to the hit point
|
|
1035
|
-
var hitDistance = Vector3.Dot(relativeOrigin, inverseNormal) / dotProduct;
|
|
1036
|
-
// Apply the hit point by adding the direction scaled by the distance to the origin
|
|
1037
|
-
result.set(origin.x + x * hitDistance, origin.y + y * hitDistance, origin.z + z * hitDistance);
|
|
1038
1037
|
};
|
|
1039
1038
|
/**
|
|
1040
1039
|
* Returns true if the current Vector3 and the given vector coordinates are strictly equal
|
|
@@ -1582,7 +1581,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1582
1581
|
};
|
|
1583
1582
|
Object.defineProperty(Vector3, "UpReadOnly", {
|
|
1584
1583
|
/**
|
|
1585
|
-
* Gets
|
|
1584
|
+
* Gets an up Vector3 that must not be updated
|
|
1586
1585
|
*/
|
|
1587
1586
|
get: function () {
|
|
1588
1587
|
return Vector3._UpReadOnly;
|
|
@@ -1590,6 +1589,16 @@ var Vector3 = /** @class */ (function () {
|
|
|
1590
1589
|
enumerable: false,
|
|
1591
1590
|
configurable: true
|
|
1592
1591
|
});
|
|
1592
|
+
Object.defineProperty(Vector3, "DownReadOnly", {
|
|
1593
|
+
/**
|
|
1594
|
+
* Gets a down Vector3 that must not be updated
|
|
1595
|
+
*/
|
|
1596
|
+
get: function () {
|
|
1597
|
+
return Vector3._DownReadOnly;
|
|
1598
|
+
},
|
|
1599
|
+
enumerable: false,
|
|
1600
|
+
configurable: true
|
|
1601
|
+
});
|
|
1593
1602
|
Object.defineProperty(Vector3, "RightReadOnly", {
|
|
1594
1603
|
/**
|
|
1595
1604
|
* Gets a right Vector3 that must not be updated
|
|
@@ -2305,6 +2314,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2305
2314
|
quat.toEulerAnglesToRef(ref);
|
|
2306
2315
|
};
|
|
2307
2316
|
Vector3._UpReadOnly = Vector3.Up();
|
|
2317
|
+
Vector3._DownReadOnly = Vector3.Down();
|
|
2308
2318
|
Vector3._LeftHandedForwardReadOnly = Vector3.Forward(false);
|
|
2309
2319
|
Vector3._RightHandedForwardReadOnly = Vector3.Forward(true);
|
|
2310
2320
|
Vector3._RightReadOnly = Vector3.Right();
|
|
@@ -2882,6 +2892,16 @@ var Vector4 = /** @class */ (function () {
|
|
|
2882
2892
|
Vector4.One = function () {
|
|
2883
2893
|
return new Vector4(1.0, 1.0, 1.0, 1.0);
|
|
2884
2894
|
};
|
|
2895
|
+
Object.defineProperty(Vector4, "ZeroReadOnly", {
|
|
2896
|
+
/**
|
|
2897
|
+
* Gets a zero Vector4 that must not be updated
|
|
2898
|
+
*/
|
|
2899
|
+
get: function () {
|
|
2900
|
+
return Vector4._ZeroReadOnly;
|
|
2901
|
+
},
|
|
2902
|
+
enumerable: false,
|
|
2903
|
+
configurable: true
|
|
2904
|
+
});
|
|
2885
2905
|
/**
|
|
2886
2906
|
* Returns a new normalized Vector4 from the given one.
|
|
2887
2907
|
* @param vector the vector to normalize
|
|
@@ -3065,6 +3085,7 @@ var Vector4 = /** @class */ (function () {
|
|
|
3065
3085
|
if (w === void 0) { w = 0; }
|
|
3066
3086
|
return new Vector4(source._x, source._y, source._z, w);
|
|
3067
3087
|
};
|
|
3088
|
+
Vector4._ZeroReadOnly = Vector4.Zero();
|
|
3068
3089
|
return Vector4;
|
|
3069
3090
|
}());
|
|
3070
3091
|
export { Vector4 };
|