@babylonjs/core 5.17.1 → 5.18.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/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 +2 -0
- 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.js +9 -3
- 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 +11 -8
- package/Gizmos/axisDragGizmo.js.map +1 -1
- package/Gizmos/axisScaleGizmo.d.ts +20 -13
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +23 -18
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/cameraGizmo.d.ts +8 -5
- 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 +17 -9
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Gizmos/lightGizmo.d.ts +12 -7
- package/Gizmos/lightGizmo.js.map +1 -1
- package/Gizmos/planeDragGizmo.d.ts +10 -8
- package/Gizmos/planeDragGizmo.js.map +1 -1
- package/Gizmos/planeRotationGizmo.d.ts +23 -14
- package/Gizmos/planeRotationGizmo.js.map +1 -1
- package/Gizmos/positionGizmo.d.ts +9 -7
- package/Gizmos/positionGizmo.js +1 -1
- package/Gizmos/positionGizmo.js.map +1 -1
- package/Gizmos/rotationGizmo.d.ts +6 -4
- package/Gizmos/rotationGizmo.js.map +1 -1
- package/Gizmos/scaleGizmo.d.ts +15 -12
- 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 +6 -0
- package/Materials/Node/nodeMaterial.js +11 -0
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Maths/math.vector.d.ts +2 -2
- package/Maths/math.vector.js +18 -30
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Compression/dracoCompression.js +1 -1
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Misc/basis.js +3 -0
- package/Misc/basis.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 +7 -6
- 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/Maths/math.vector.d.ts
CHANGED
|
@@ -635,14 +635,14 @@ export declare class Vector3 {
|
|
|
635
635
|
*/
|
|
636
636
|
scaleAndAddToRef(scale: number, result: Vector3): Vector3;
|
|
637
637
|
/**
|
|
638
|
-
* Projects the current
|
|
638
|
+
* Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
|
|
639
639
|
* @param plane defines the plane to project to
|
|
640
640
|
* @param origin defines the origin of the projection ray
|
|
641
641
|
* @returns the projected vector3
|
|
642
642
|
*/
|
|
643
643
|
projectOnPlane(plane: Plane, origin: Vector3): Vector3;
|
|
644
644
|
/**
|
|
645
|
-
* Projects the current
|
|
645
|
+
* Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
|
|
646
646
|
* @param plane defines the plane to project to
|
|
647
647
|
* @param origin defines the origin of the projection ray
|
|
648
648
|
* @param result defines the Vector3 where to store the result
|
package/Maths/math.vector.js
CHANGED
|
@@ -989,7 +989,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
989
989
|
return result.addInPlaceFromFloats(this._x * scale, this._y * scale, this._z * scale);
|
|
990
990
|
};
|
|
991
991
|
/**
|
|
992
|
-
* Projects the current
|
|
992
|
+
* Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
|
|
993
993
|
* @param plane defines the plane to project to
|
|
994
994
|
* @param origin defines the origin of the projection ray
|
|
995
995
|
* @returns the projected vector3
|
|
@@ -1000,41 +1000,29 @@ var Vector3 = /** @class */ (function () {
|
|
|
1000
1000
|
return result;
|
|
1001
1001
|
};
|
|
1002
1002
|
/**
|
|
1003
|
-
* 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.
|
|
1004
1004
|
* @param plane defines the plane to project to
|
|
1005
1005
|
* @param origin defines the origin of the projection ray
|
|
1006
1006
|
* @param result defines the Vector3 where to store the result
|
|
1007
1007
|
*/
|
|
1008
1008
|
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;
|
|
1009
|
+
var n = plane.normal;
|
|
1010
|
+
var d = plane.d;
|
|
1011
|
+
var V = MathTmp.Vector3[0];
|
|
1012
|
+
// ray direction
|
|
1013
|
+
this.subtractToRef(origin, V);
|
|
1014
|
+
V.normalize();
|
|
1015
|
+
var denom = Vector3.Dot(V, n);
|
|
1016
|
+
//When the ray is close to parallel to the plane return infinity vector
|
|
1017
|
+
if (Math.abs(denom) < Math.pow(10, -10)) {
|
|
1018
|
+
origin.addToRef(new Vector3(Infinity, Infinity, Infinity), result);
|
|
1019
|
+
}
|
|
1020
|
+
else {
|
|
1021
|
+
var t = -(Vector3.Dot(origin, n) + d) / denom;
|
|
1022
|
+
// P = P0 + t*V
|
|
1023
|
+
var scaledV = V.scaleInPlace(t);
|
|
1024
|
+
origin.addToRef(scaledV, result);
|
|
1030
1025
|
}
|
|
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
1026
|
};
|
|
1039
1027
|
/**
|
|
1040
1028
|
* Returns true if the current Vector3 and the given vector coordinates are strictly equal
|