@babylonjs/core 5.10.0 → 5.12.1
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/Cameras/Inputs/freeCameraTouchInput.d.ts +1 -0
- package/Cameras/Inputs/freeCameraTouchInput.js +3 -2
- package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
- package/Engines/Extensions/engine.query.js +1 -1
- package/Engines/Extensions/engine.query.js.map +1 -1
- package/Engines/ICanvas.d.ts +5 -0
- package/Engines/ICanvas.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +1 -1
- package/Engines/WebGPU/webgpuConstants.js +5 -5
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/engine.d.ts +2 -2
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +1 -1
- package/Engines/webgpuEngine.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +2 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +2 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.d.ts +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.js +1 -1
- package/Materials/PBR/pbrAnisotropicConfiguration.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +9 -4
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +2 -1
- package/Materials/Textures/baseTexture.js +6 -3
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/cubeTexture.js +1 -1
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/equiRectangularCubeTexture.js +1 -1
- package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
- package/Materials/Textures/hdrCubeTexture.js +1 -1
- package/Materials/Textures/hdrCubeTexture.js.map +1 -1
- package/Materials/effect.d.ts +5 -0
- package/Materials/effect.js +5 -0
- package/Materials/effect.js.map +1 -1
- package/Materials/material.d.ts +2 -0
- package/Materials/material.js +4 -1
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginBase.d.ts +14 -0
- package/Materials/materialPluginBase.js +16 -0
- package/Materials/materialPluginBase.js.map +1 -1
- package/Materials/materialPluginEvent.d.ts +2 -0
- package/Materials/materialPluginEvent.js.map +1 -1
- package/Materials/materialPluginManager.d.ts +1 -0
- package/Materials/materialPluginManager.js +13 -1
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +17 -2
- package/Materials/shaderMaterial.js +65 -4
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/standardMaterial.js +8 -3
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.vector.d.ts +7 -0
- package/Maths/math.vector.js +43 -11
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/shapeBuilder.d.ts +12 -0
- package/Meshes/Builders/shapeBuilder.js +48 -10
- package/Meshes/Builders/shapeBuilder.js.map +1 -1
- package/Meshes/mesh.js +1 -1
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/subMesh.d.ts +2 -1
- package/Meshes/subMesh.js +4 -2
- package/Meshes/subMesh.js.map +1 -1
- package/Misc/computePressure.js +4 -3
- package/Misc/computePressure.js.map +1 -1
- package/Misc/iInspectable.d.ts +1 -1
- package/Misc/iInspectable.js.map +1 -1
- package/Misc/screenshotTools.js +31 -14
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/tools.d.ts +16 -0
- package/Misc/tools.js +44 -30
- package/Misc/tools.js.map +1 -1
- package/Offline/database.js +2 -2
- package/Offline/database.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.d.ts +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/prePassRendererSceneComponent.js +2 -2
- package/Rendering/prePassRendererSceneComponent.js.map +1 -1
- package/XR/webXRCamera.js +11 -0
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXRExperienceHelper.js +2 -1
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/package.json +2 -2
- package/sceneComponent.d.ts +2 -2
- package/sceneComponent.js +2 -2
- package/sceneComponent.js.map +1 -1
package/Maths/math.vector.d.ts
CHANGED
|
@@ -1852,6 +1852,13 @@ export declare class Quaternion {
|
|
|
1852
1852
|
* @returns a new array populated with 4 elements from the quaternion coordinates
|
|
1853
1853
|
*/
|
|
1854
1854
|
asArray(): number[];
|
|
1855
|
+
/**
|
|
1856
|
+
* Stores from the starting index in the given array the Quaternion successive values
|
|
1857
|
+
* @param array defines the array where to store the x,y,z,w components
|
|
1858
|
+
* @param index defines an optional index in the target array to define where to start storing values
|
|
1859
|
+
* @returns the current Quaternion object
|
|
1860
|
+
*/
|
|
1861
|
+
toArray(array: FloatArray, index?: number): Quaternion;
|
|
1855
1862
|
/**
|
|
1856
1863
|
* Check if two quaternions are equals
|
|
1857
1864
|
* @param otherQuaternion defines the second operand
|
package/Maths/math.vector.js
CHANGED
|
@@ -1006,17 +1006,35 @@ var Vector3 = /** @class */ (function () {
|
|
|
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
|
-
var
|
|
1017
|
-
//
|
|
1018
|
-
var
|
|
1019
|
-
|
|
1009
|
+
// Use the normal scaled to the plane offset as the origin for the formula
|
|
1010
|
+
var planeOrigin = MathTmp.Vector3[0];
|
|
1011
|
+
plane.normal.scaleToRef(-plane.d, planeOrigin);
|
|
1012
|
+
// Since the normal in Babylon should point toward the viewer, invert it for the dot product
|
|
1013
|
+
var inverseNormal = MathTmp.Vector3[1];
|
|
1014
|
+
plane.normal.negateToRef(inverseNormal);
|
|
1015
|
+
// This vector is the direction
|
|
1016
|
+
var direction = this;
|
|
1017
|
+
// Calculate how close the direction is to the normal of the plane
|
|
1018
|
+
var dotProduct = Vector3.Dot(inverseNormal, direction);
|
|
1019
|
+
/*
|
|
1020
|
+
* Early out in case the direction will never hit the plane.
|
|
1021
|
+
*
|
|
1022
|
+
* Epsilon is used to avoid issues with rays very near to parallel with the
|
|
1023
|
+
* plane, and squared because as of writing the value is not sufficiently
|
|
1024
|
+
* small for this use case.
|
|
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;
|
|
1030
|
+
}
|
|
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 + direction.x * hitDistance, origin.y + direction.y * hitDistance, origin.z + direction.z * hitDistance);
|
|
1020
1038
|
};
|
|
1021
1039
|
/**
|
|
1022
1040
|
* Returns true if the current Vector3 and the given vector coordinates are strictly equal
|
|
@@ -3159,6 +3177,20 @@ var Quaternion = /** @class */ (function () {
|
|
|
3159
3177
|
Quaternion.prototype.asArray = function () {
|
|
3160
3178
|
return [this._x, this._y, this._z, this._w];
|
|
3161
3179
|
};
|
|
3180
|
+
/**
|
|
3181
|
+
* Stores from the starting index in the given array the Quaternion successive values
|
|
3182
|
+
* @param array defines the array where to store the x,y,z,w components
|
|
3183
|
+
* @param index defines an optional index in the target array to define where to start storing values
|
|
3184
|
+
* @returns the current Quaternion object
|
|
3185
|
+
*/
|
|
3186
|
+
Quaternion.prototype.toArray = function (array, index) {
|
|
3187
|
+
if (index === void 0) { index = 0; }
|
|
3188
|
+
array[index] = this.x;
|
|
3189
|
+
array[index + 1] = this.y;
|
|
3190
|
+
array[index + 2] = this.z;
|
|
3191
|
+
array[index + 3] = this.w;
|
|
3192
|
+
return this;
|
|
3193
|
+
};
|
|
3162
3194
|
/**
|
|
3163
3195
|
* Check if two quaternions are equals
|
|
3164
3196
|
* @param otherQuaternion defines the second operand
|