@babylonjs/core 8.10.0 → 8.10.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/Animations/runtimeAnimation.js +3 -1
- package/Animations/runtimeAnimation.js.map +1 -1
- package/AudioV2/abstractAudio/staticSound.d.ts +26 -1
- package/AudioV2/abstractAudio/staticSound.js.map +1 -1
- package/AudioV2/abstractAudio/staticSoundBuffer.d.ts +19 -0
- package/AudioV2/abstractAudio/staticSoundBuffer.js +5 -0
- package/AudioV2/abstractAudio/staticSoundBuffer.js.map +1 -1
- package/AudioV2/webAudio/webAudioStaticSound.d.ts +6 -2
- package/AudioV2/webAudio/webAudioStaticSound.js +21 -0
- package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
- package/Cameras/arcRotateCamera.js +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/targetCamera.d.ts +12 -21
- package/Cameras/targetCamera.js +16 -37
- package/Cameras/targetCamera.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.d.ts +3 -3
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js +5 -6
- package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.d.ts +1 -0
- package/Lights/Shadows/cascadedShadowGenerator.js +12 -0
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +14 -8
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js +15 -10
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/index.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/index.js +1 -0
- package/Materials/Node/Blocks/Dual/index.js.map +1 -1
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.d.ts +32 -0
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js +99 -0
- package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js.map +1 -0
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +4 -12
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +1 -3
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportInBlock.d.ts +4 -0
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js +6 -0
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js +8 -2
- package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +7 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.js +4 -0
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +10 -8
- package/Materials/Node/nodeMaterialBuildState.js +21 -35
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/Node/nodeMaterialDefault.js +4 -2
- package/Materials/Node/nodeMaterialDefault.js.map +1 -1
- package/Materials/Textures/thinTexture.js +3 -0
- package/Materials/Textures/thinTexture.js.map +1 -1
- package/Maths/math.vector.d.ts +6 -0
- package/Maths/math.vector.js +10 -4
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/transformNode.d.ts +0 -8
- package/Meshes/transformNode.js +66 -88
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/depthReducer.js +2 -6
- package/Misc/depthReducer.js.map +1 -1
- package/Misc/observable.d.ts +34 -3
- package/Misc/observable.js +1 -1
- package/Misc/observable.js.map +1 -1
- package/Physics/v2/characterController.d.ts +9 -0
- package/Physics/v2/characterController.js +17 -0
- package/Physics/v2/characterController.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +8 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +21 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js +1 -1
- package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/bonesDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/bonesDeclaration.js.map +1 -1
- package/ShadersWGSL/background.fragment.js +1 -1
- package/ShadersWGSL/background.fragment.js.map +1 -1
- package/ShadersWGSL/iblShadowGBufferDebug.fragment.js +5 -4
- package/ShadersWGSL/iblShadowGBufferDebug.fragment.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +4 -2
- package/scene.js.map +1 -1
|
@@ -68,14 +68,6 @@ export declare class TransformNode extends Node {
|
|
|
68
68
|
*/
|
|
69
69
|
get billboardMode(): number;
|
|
70
70
|
set billboardMode(value: number);
|
|
71
|
-
private _preserveParentRotationForBillboard;
|
|
72
|
-
/**
|
|
73
|
-
* Gets or sets a boolean indicating that parent rotation should be preserved when using billboards.
|
|
74
|
-
* This could be useful for glTF objects where parent rotation helps converting from right handed to left handed
|
|
75
|
-
*/
|
|
76
|
-
get preserveParentRotationForBillboard(): boolean;
|
|
77
|
-
set preserveParentRotationForBillboard(value: boolean);
|
|
78
|
-
private _computeUseBillboardPath;
|
|
79
71
|
/**
|
|
80
72
|
* Multiplication factor on scale x/y/z when computing the world matrix. Eg. for a 1x1x1 cube setting this to 2 will make it a 2x2x2 cube
|
|
81
73
|
*/
|
package/Meshes/transformNode.js
CHANGED
|
@@ -5,7 +5,6 @@ import { Observable } from "../Misc/observable.js";
|
|
|
5
5
|
import { Quaternion, Matrix, Vector3, TmpVectors } from "../Maths/math.vector.js";
|
|
6
6
|
import { Node } from "../node.js";
|
|
7
7
|
import { GetClass } from "../Misc/typeStore.js";
|
|
8
|
-
const ConvertRHSToLHS = Matrix.Compose(Vector3.One(), Quaternion.FromEulerAngles(0, Math.PI, 0), Vector3.Zero());
|
|
9
8
|
/**
|
|
10
9
|
* A TransformNode is an object that is not rendered but can be used as a center of transformation. This can decrease memory usage and increase rendering speed compared to using an empty mesh as a parent and is less complicated than using a pivot matrix.
|
|
11
10
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/transform_node
|
|
@@ -32,24 +31,6 @@ export class TransformNode extends Node {
|
|
|
32
31
|
}
|
|
33
32
|
this._billboardMode = value;
|
|
34
33
|
this._cache.useBillboardPosition = (this._billboardMode & TransformNode.BILLBOARDMODE_USE_POSITION) !== 0;
|
|
35
|
-
this._computeUseBillboardPath();
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Gets or sets a boolean indicating that parent rotation should be preserved when using billboards.
|
|
39
|
-
* This could be useful for glTF objects where parent rotation helps converting from right handed to left handed
|
|
40
|
-
*/
|
|
41
|
-
get preserveParentRotationForBillboard() {
|
|
42
|
-
return this._preserveParentRotationForBillboard;
|
|
43
|
-
}
|
|
44
|
-
set preserveParentRotationForBillboard(value) {
|
|
45
|
-
if (value === this._preserveParentRotationForBillboard) {
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
this._preserveParentRotationForBillboard = value;
|
|
49
|
-
this._computeUseBillboardPath();
|
|
50
|
-
}
|
|
51
|
-
_computeUseBillboardPath() {
|
|
52
|
-
this._cache.useBillboardPath = this._billboardMode !== TransformNode.BILLBOARDMODE_NONE && !this.preserveParentRotationForBillboard;
|
|
53
34
|
}
|
|
54
35
|
/**
|
|
55
36
|
* Gets or sets the distance of the object to max, often used by skybox
|
|
@@ -76,7 +57,6 @@ export class TransformNode extends Node {
|
|
|
76
57
|
this._transformToBoneReferal = null;
|
|
77
58
|
this._isAbsoluteSynced = false;
|
|
78
59
|
this._billboardMode = TransformNode.BILLBOARDMODE_NONE;
|
|
79
|
-
this._preserveParentRotationForBillboard = false;
|
|
80
60
|
/**
|
|
81
61
|
* Multiplication factor on scale x/y/z when computing the world matrix. Eg. for a 1x1x1 cube setting this to 2 will make it a 2x2x2 cube
|
|
82
62
|
*/
|
|
@@ -266,7 +246,6 @@ export class TransformNode extends Node {
|
|
|
266
246
|
cache.billboardMode = -1;
|
|
267
247
|
cache.infiniteDistance = false;
|
|
268
248
|
cache.useBillboardPosition = false;
|
|
269
|
-
cache.useBillboardPath = false;
|
|
270
249
|
}
|
|
271
250
|
/**
|
|
272
251
|
* Returns the current mesh absolute position.
|
|
@@ -904,7 +883,7 @@ export class TransformNode extends Node {
|
|
|
904
883
|
* @returns true if the world matrix computation needs the camera information to be computed
|
|
905
884
|
*/
|
|
906
885
|
isWorldMatrixCameraDependent() {
|
|
907
|
-
return (this._infiniteDistance && !this.parent) ||
|
|
886
|
+
return (this._infiniteDistance && !this.parent) || this._billboardMode !== TransformNode.BILLBOARDMODE_NONE;
|
|
908
887
|
}
|
|
909
888
|
/**
|
|
910
889
|
* Computes the world matrix of the node
|
|
@@ -990,7 +969,7 @@ export class TransformNode extends Node {
|
|
|
990
969
|
if (force) {
|
|
991
970
|
parent.computeWorldMatrix(force);
|
|
992
971
|
}
|
|
993
|
-
if (
|
|
972
|
+
if (this.billboardMode) {
|
|
994
973
|
if (this._transformToBoneReferal) {
|
|
995
974
|
const bone = this.parent;
|
|
996
975
|
bone.getSkeleton().prepare();
|
|
@@ -1029,76 +1008,75 @@ export class TransformNode extends Node {
|
|
|
1029
1008
|
else {
|
|
1030
1009
|
this._worldMatrix.copyFrom(this._localMatrix);
|
|
1031
1010
|
}
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
TmpVectors.Matrix[1].
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
eulerAngles.z
|
|
1011
|
+
if (camera && this.billboardMode) {
|
|
1012
|
+
// Billboarding based on camera orientation (testing PG:http://www.babylonjs-playground.com/#UJEIL#13)
|
|
1013
|
+
if (!cache.useBillboardPosition) {
|
|
1014
|
+
const storedTranslation = TmpVectors.Vector3[0];
|
|
1015
|
+
this._worldMatrix.getTranslationToRef(storedTranslation); // Save translation
|
|
1016
|
+
// Cancel camera rotation
|
|
1017
|
+
TmpVectors.Matrix[1].copyFrom(camera.getViewMatrix());
|
|
1018
|
+
TmpVectors.Matrix[1].setTranslationFromFloats(0, 0, 0);
|
|
1019
|
+
TmpVectors.Matrix[1].invertToRef(TmpVectors.Matrix[0]);
|
|
1020
|
+
if ((this.billboardMode & TransformNode.BILLBOARDMODE_ALL) !== TransformNode.BILLBOARDMODE_ALL) {
|
|
1021
|
+
TmpVectors.Matrix[0].decompose(undefined, TmpVectors.Quaternion[0], undefined);
|
|
1022
|
+
const eulerAngles = TmpVectors.Vector3[1];
|
|
1023
|
+
TmpVectors.Quaternion[0].toEulerAnglesToRef(eulerAngles);
|
|
1024
|
+
if ((this.billboardMode & TransformNode.BILLBOARDMODE_X) !== TransformNode.BILLBOARDMODE_X) {
|
|
1025
|
+
eulerAngles.x = 0;
|
|
1026
|
+
}
|
|
1027
|
+
if ((this.billboardMode & TransformNode.BILLBOARDMODE_Y) !== TransformNode.BILLBOARDMODE_Y) {
|
|
1028
|
+
eulerAngles.y = 0;
|
|
1029
|
+
}
|
|
1030
|
+
if ((this.billboardMode & TransformNode.BILLBOARDMODE_Z) !== TransformNode.BILLBOARDMODE_Z) {
|
|
1031
|
+
eulerAngles.z = 0;
|
|
1032
|
+
}
|
|
1033
|
+
Matrix.RotationYawPitchRollToRef(eulerAngles.y, eulerAngles.x, eulerAngles.z, TmpVectors.Matrix[0]);
|
|
1055
1034
|
}
|
|
1056
|
-
|
|
1035
|
+
this._worldMatrix.setTranslationFromFloats(0, 0, 0);
|
|
1036
|
+
this._worldMatrix.multiplyToRef(TmpVectors.Matrix[0], this._worldMatrix);
|
|
1037
|
+
// Restore translation
|
|
1038
|
+
this._worldMatrix.setTranslation(TmpVectors.Vector3[0]);
|
|
1057
1039
|
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
eulerAngles.y
|
|
1040
|
+
// Billboarding based on camera position
|
|
1041
|
+
else if (cache.useBillboardPosition) {
|
|
1042
|
+
const storedTranslation = TmpVectors.Vector3[0];
|
|
1043
|
+
// Save translation
|
|
1044
|
+
this._worldMatrix.getTranslationToRef(storedTranslation);
|
|
1045
|
+
// Compute camera position in local space
|
|
1046
|
+
const cameraPosition = camera.globalPosition;
|
|
1047
|
+
this._worldMatrix.invertToRef(TmpVectors.Matrix[1]);
|
|
1048
|
+
const camInObjSpace = TmpVectors.Vector3[1];
|
|
1049
|
+
Vector3.TransformCoordinatesToRef(cameraPosition, TmpVectors.Matrix[1], camInObjSpace);
|
|
1050
|
+
camInObjSpace.normalize();
|
|
1051
|
+
// Find the lookAt info in local space
|
|
1052
|
+
const yaw = -Math.atan2(camInObjSpace.z, camInObjSpace.x) + Math.PI / 2;
|
|
1053
|
+
const len = Math.sqrt(camInObjSpace.x * camInObjSpace.x + camInObjSpace.z * camInObjSpace.z);
|
|
1054
|
+
const pitch = -Math.atan2(camInObjSpace.y, len);
|
|
1055
|
+
Quaternion.RotationYawPitchRollToRef(yaw, pitch, 0, TmpVectors.Quaternion[0]);
|
|
1056
|
+
if ((this.billboardMode & TransformNode.BILLBOARDMODE_ALL) !== TransformNode.BILLBOARDMODE_ALL) {
|
|
1057
|
+
const eulerAngles = TmpVectors.Vector3[1];
|
|
1058
|
+
TmpVectors.Quaternion[0].toEulerAnglesToRef(eulerAngles);
|
|
1059
|
+
if ((this.billboardMode & TransformNode.BILLBOARDMODE_X) !== TransformNode.BILLBOARDMODE_X) {
|
|
1060
|
+
eulerAngles.x = 0;
|
|
1061
|
+
}
|
|
1062
|
+
if ((this.billboardMode & TransformNode.BILLBOARDMODE_Y) !== TransformNode.BILLBOARDMODE_Y) {
|
|
1063
|
+
eulerAngles.y = 0;
|
|
1064
|
+
}
|
|
1065
|
+
if ((this.billboardMode & TransformNode.BILLBOARDMODE_Z) !== TransformNode.BILLBOARDMODE_Z) {
|
|
1066
|
+
eulerAngles.z = 0;
|
|
1067
|
+
}
|
|
1068
|
+
Matrix.RotationYawPitchRollToRef(eulerAngles.y, eulerAngles.x, eulerAngles.z, TmpVectors.Matrix[0]);
|
|
1087
1069
|
}
|
|
1088
|
-
|
|
1089
|
-
|
|
1070
|
+
else {
|
|
1071
|
+
Matrix.FromQuaternionToRef(TmpVectors.Quaternion[0], TmpVectors.Matrix[0]);
|
|
1090
1072
|
}
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1073
|
+
// Cancel translation
|
|
1074
|
+
this._worldMatrix.setTranslationFromFloats(0, 0, 0);
|
|
1075
|
+
// Rotate according to lookat (diff from local to lookat)
|
|
1076
|
+
this._worldMatrix.multiplyToRef(TmpVectors.Matrix[0], this._worldMatrix);
|
|
1077
|
+
// Restore translation
|
|
1078
|
+
this._worldMatrix.setTranslation(TmpVectors.Vector3[0]);
|
|
1095
1079
|
}
|
|
1096
|
-
// Cancel translation
|
|
1097
|
-
this._worldMatrix.setTranslationFromFloats(0, 0, 0);
|
|
1098
|
-
// Rotate according to lookat (diff from local to lookat)
|
|
1099
|
-
this._worldMatrix.multiplyToRef(TmpVectors.Matrix[0], this._worldMatrix);
|
|
1100
|
-
// Restore translation
|
|
1101
|
-
this._worldMatrix.setTranslation(TmpVectors.Vector3[0]);
|
|
1102
1080
|
}
|
|
1103
1081
|
// Normal matrix
|
|
1104
1082
|
if (!this.ignoreNonUniformScaling) {
|