@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.
Files changed (80) hide show
  1. package/Animations/runtimeAnimation.js +3 -1
  2. package/Animations/runtimeAnimation.js.map +1 -1
  3. package/AudioV2/abstractAudio/staticSound.d.ts +26 -1
  4. package/AudioV2/abstractAudio/staticSound.js.map +1 -1
  5. package/AudioV2/abstractAudio/staticSoundBuffer.d.ts +19 -0
  6. package/AudioV2/abstractAudio/staticSoundBuffer.js +5 -0
  7. package/AudioV2/abstractAudio/staticSoundBuffer.js.map +1 -1
  8. package/AudioV2/webAudio/webAudioStaticSound.d.ts +6 -2
  9. package/AudioV2/webAudio/webAudioStaticSound.js +21 -0
  10. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
  11. package/Cameras/arcRotateCamera.js +1 -1
  12. package/Cameras/arcRotateCamera.js.map +1 -1
  13. package/Cameras/targetCamera.d.ts +12 -21
  14. package/Cameras/targetCamera.js +16 -37
  15. package/Cameras/targetCamera.js.map +1 -1
  16. package/Engines/abstractEngine.js +2 -2
  17. package/Engines/abstractEngine.js.map +1 -1
  18. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.d.ts +3 -3
  19. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js +5 -6
  20. package/FlowGraph/Blocks/Data/Math/flowGraphVectorMathBlocks.js.map +1 -1
  21. package/Lights/Shadows/cascadedShadowGenerator.d.ts +1 -0
  22. package/Lights/Shadows/cascadedShadowGenerator.js +12 -0
  23. package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
  24. package/Materials/Node/Blocks/Dual/currentScreenBlock.d.ts +14 -8
  25. package/Materials/Node/Blocks/Dual/currentScreenBlock.js +15 -10
  26. package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
  27. package/Materials/Node/Blocks/Dual/index.d.ts +1 -0
  28. package/Materials/Node/Blocks/Dual/index.js +1 -0
  29. package/Materials/Node/Blocks/Dual/index.js.map +1 -1
  30. package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.d.ts +32 -0
  31. package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js +99 -0
  32. package/Materials/Node/Blocks/Dual/smartFilterTextureBlock.js.map +1 -0
  33. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +4 -12
  34. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  35. package/Materials/Node/Blocks/Input/inputBlock.js +1 -3
  36. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  37. package/Materials/Node/Blocks/Teleport/teleportInBlock.d.ts +4 -0
  38. package/Materials/Node/Blocks/Teleport/teleportInBlock.js +6 -0
  39. package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
  40. package/Materials/Node/Blocks/Teleport/teleportOutBlock.js +8 -2
  41. package/Materials/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
  42. package/Materials/Node/nodeMaterial.js +7 -1
  43. package/Materials/Node/nodeMaterial.js.map +1 -1
  44. package/Materials/Node/nodeMaterialBlock.js +4 -0
  45. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  46. package/Materials/Node/nodeMaterialBuildState.d.ts +10 -8
  47. package/Materials/Node/nodeMaterialBuildState.js +21 -35
  48. package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
  49. package/Materials/Node/nodeMaterialDefault.js +4 -2
  50. package/Materials/Node/nodeMaterialDefault.js.map +1 -1
  51. package/Materials/Textures/thinTexture.js +3 -0
  52. package/Materials/Textures/thinTexture.js.map +1 -1
  53. package/Maths/math.vector.d.ts +6 -0
  54. package/Maths/math.vector.js +10 -4
  55. package/Maths/math.vector.js.map +1 -1
  56. package/Meshes/transformNode.d.ts +0 -8
  57. package/Meshes/transformNode.js +66 -88
  58. package/Meshes/transformNode.js.map +1 -1
  59. package/Misc/depthReducer.js +2 -6
  60. package/Misc/depthReducer.js.map +1 -1
  61. package/Misc/observable.d.ts +34 -3
  62. package/Misc/observable.js +1 -1
  63. package/Misc/observable.js.map +1 -1
  64. package/Physics/v2/characterController.d.ts +9 -0
  65. package/Physics/v2/characterController.js +17 -0
  66. package/Physics/v2/characterController.js.map +1 -1
  67. package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +8 -0
  68. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +21 -0
  69. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  70. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js +1 -1
  71. package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js.map +1 -1
  72. package/ShadersWGSL/ShadersInclude/bonesDeclaration.js +1 -1
  73. package/ShadersWGSL/ShadersInclude/bonesDeclaration.js.map +1 -1
  74. package/ShadersWGSL/background.fragment.js +1 -1
  75. package/ShadersWGSL/background.fragment.js.map +1 -1
  76. package/ShadersWGSL/iblShadowGBufferDebug.fragment.js +5 -4
  77. package/ShadersWGSL/iblShadowGBufferDebug.fragment.js.map +1 -1
  78. package/package.json +1 -1
  79. package/scene.js +4 -2
  80. 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
  */
@@ -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) || (this._billboardMode !== TransformNode.BILLBOARDMODE_NONE && !this.preserveParentRotationForBillboard);
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 (cache.useBillboardPath) {
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
- // Billboarding based on camera orientation (testing PG:http://www.babylonjs-playground.com/#UJEIL#13)
1033
- if (cache.useBillboardPath && camera && this.billboardMode && !cache.useBillboardPosition) {
1034
- const storedTranslation = TmpVectors.Vector3[0];
1035
- this._worldMatrix.getTranslationToRef(storedTranslation); // Save translation
1036
- // Cancel camera rotation
1037
- TmpVectors.Matrix[1].copyFrom(camera.getViewMatrix());
1038
- if (this._scene.useRightHandedSystem) {
1039
- TmpVectors.Matrix[1].multiplyToRef(ConvertRHSToLHS, TmpVectors.Matrix[1]);
1040
- }
1041
- TmpVectors.Matrix[1].setTranslationFromFloats(0, 0, 0);
1042
- TmpVectors.Matrix[1].invertToRef(TmpVectors.Matrix[0]);
1043
- if ((this.billboardMode & TransformNode.BILLBOARDMODE_ALL) !== TransformNode.BILLBOARDMODE_ALL) {
1044
- TmpVectors.Matrix[0].decompose(undefined, TmpVectors.Quaternion[0], undefined);
1045
- const eulerAngles = TmpVectors.Vector3[1];
1046
- TmpVectors.Quaternion[0].toEulerAnglesToRef(eulerAngles);
1047
- if ((this.billboardMode & TransformNode.BILLBOARDMODE_X) !== TransformNode.BILLBOARDMODE_X) {
1048
- eulerAngles.x = 0;
1049
- }
1050
- if ((this.billboardMode & TransformNode.BILLBOARDMODE_Y) !== TransformNode.BILLBOARDMODE_Y) {
1051
- eulerAngles.y = 0;
1052
- }
1053
- if ((this.billboardMode & TransformNode.BILLBOARDMODE_Z) !== TransformNode.BILLBOARDMODE_Z) {
1054
- eulerAngles.z = 0;
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
- Matrix.RotationYawPitchRollToRef(eulerAngles.y, eulerAngles.x, eulerAngles.z, TmpVectors.Matrix[0]);
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
- this._worldMatrix.setTranslationFromFloats(0, 0, 0);
1059
- this._worldMatrix.multiplyToRef(TmpVectors.Matrix[0], this._worldMatrix);
1060
- // Restore translation
1061
- this._worldMatrix.setTranslation(TmpVectors.Vector3[0]);
1062
- }
1063
- // Billboarding based on camera position
1064
- else if (cache.useBillboardPath && camera && cache.useBillboardPosition) {
1065
- const storedTranslation = TmpVectors.Vector3[0];
1066
- // Save translation
1067
- this._worldMatrix.getTranslationToRef(storedTranslation);
1068
- // Compute camera position in local space
1069
- const cameraPosition = camera.globalPosition;
1070
- this._worldMatrix.invertToRef(TmpVectors.Matrix[1]);
1071
- const camInObjSpace = TmpVectors.Vector3[1];
1072
- Vector3.TransformCoordinatesToRef(cameraPosition, TmpVectors.Matrix[1], camInObjSpace);
1073
- camInObjSpace.normalize();
1074
- // Find the lookAt info in local space
1075
- const yaw = -Math.atan2(camInObjSpace.z, camInObjSpace.x) + Math.PI / 2;
1076
- const len = Math.sqrt(camInObjSpace.x * camInObjSpace.x + camInObjSpace.z * camInObjSpace.z);
1077
- const pitch = -Math.atan2(camInObjSpace.y, len);
1078
- Quaternion.RotationYawPitchRollToRef(yaw, pitch, 0, TmpVectors.Quaternion[0]);
1079
- if ((this.billboardMode & TransformNode.BILLBOARDMODE_ALL) !== TransformNode.BILLBOARDMODE_ALL) {
1080
- const eulerAngles = TmpVectors.Vector3[1];
1081
- TmpVectors.Quaternion[0].toEulerAnglesToRef(eulerAngles);
1082
- if ((this.billboardMode & TransformNode.BILLBOARDMODE_X) !== TransformNode.BILLBOARDMODE_X) {
1083
- eulerAngles.x = 0;
1084
- }
1085
- if ((this.billboardMode & TransformNode.BILLBOARDMODE_Y) !== TransformNode.BILLBOARDMODE_Y) {
1086
- eulerAngles.y = 0;
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
- if ((this.billboardMode & TransformNode.BILLBOARDMODE_Z) !== TransformNode.BILLBOARDMODE_Z) {
1089
- eulerAngles.z = 0;
1070
+ else {
1071
+ Matrix.FromQuaternionToRef(TmpVectors.Quaternion[0], TmpVectors.Matrix[0]);
1090
1072
  }
1091
- Matrix.RotationYawPitchRollToRef(eulerAngles.y, eulerAngles.x, eulerAngles.z, TmpVectors.Matrix[0]);
1092
- }
1093
- else {
1094
- Matrix.FromQuaternionToRef(TmpVectors.Quaternion[0], TmpVectors.Matrix[0]);
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) {