@babylonjs/core 7.9.0 → 7.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 (143) hide show
  1. package/Audio/Interfaces/IAudioEngine.d.ts +2 -0
  2. package/Audio/Interfaces/IAudioEngine.js.map +1 -1
  3. package/Audio/audioEngine.d.ts +2 -0
  4. package/Audio/audioEngine.js +12 -0
  5. package/Audio/audioEngine.js.map +1 -1
  6. package/Behaviors/Cameras/framingBehavior.d.ts +1 -1
  7. package/Behaviors/Cameras/framingBehavior.js +1 -1
  8. package/Behaviors/Cameras/framingBehavior.js.map +1 -1
  9. package/Behaviors/Meshes/baseSixDofDragBehavior.d.ts +5 -5
  10. package/Behaviors/Meshes/baseSixDofDragBehavior.js +4 -4
  11. package/Behaviors/Meshes/baseSixDofDragBehavior.js.map +1 -1
  12. package/Collisions/gpuPicker.d.ts +38 -0
  13. package/Collisions/gpuPicker.js +244 -0
  14. package/Collisions/gpuPicker.js.map +1 -0
  15. package/Collisions/index.d.ts +1 -0
  16. package/Collisions/index.js +1 -0
  17. package/Collisions/index.js.map +1 -1
  18. package/Debug/physicsViewer.d.ts +4 -2
  19. package/Debug/physicsViewer.js +16 -4
  20. package/Debug/physicsViewer.js.map +1 -1
  21. package/Engines/AbstractEngine/abstractEngine.cubeTexture.d.ts +1 -1
  22. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +7 -3
  23. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
  24. package/Engines/Extensions/engine.cubeTexture.d.ts +3 -2
  25. package/Engines/Extensions/engine.cubeTexture.js +2 -2
  26. package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
  27. package/Engines/Extensions/engine.views.d.ts +1 -0
  28. package/Engines/Extensions/engine.views.js +3 -0
  29. package/Engines/Extensions/engine.views.js.map +1 -0
  30. package/Engines/WebGPU/Extensions/engine.cubeTexture.d.ts +3 -2
  31. package/Engines/WebGPU/Extensions/engine.cubeTexture.js +2 -2
  32. package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
  33. package/Engines/WebGPU/Extensions/engine.videoTexture.js +12 -4
  34. package/Engines/WebGPU/Extensions/engine.videoTexture.js.map +1 -1
  35. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +2 -3
  36. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  37. package/Engines/abstractEngine.js +2 -2
  38. package/Engines/abstractEngine.js.map +1 -1
  39. package/Engines/nativeEngine.d.ts +2 -1
  40. package/Engines/nativeEngine.js +7 -2
  41. package/Engines/nativeEngine.js.map +1 -1
  42. package/Engines/thinEngine.js +8 -7
  43. package/Engines/thinEngine.js.map +1 -1
  44. package/Gizmos/boundingBoxGizmo.d.ts +6 -5
  45. package/Gizmos/boundingBoxGizmo.js +5 -5
  46. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  47. package/Gizmos/lightGizmo.js +1 -2
  48. package/Gizmos/lightGizmo.js.map +1 -1
  49. package/Helpers/environmentHelper.js +2 -0
  50. package/Helpers/environmentHelper.js.map +1 -1
  51. package/Layers/layer.js +5 -3
  52. package/Layers/layer.js.map +1 -1
  53. package/Loading/Plugins/babylonFileLoader.js +1 -1
  54. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  55. package/Materials/Node/Blocks/Dual/currentScreenBlock.js +13 -4
  56. package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
  57. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +12 -3
  58. package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
  59. package/Materials/Node/nodeMaterial.d.ts +2 -2
  60. package/Materials/Node/nodeMaterial.js +11 -11
  61. package/Materials/Node/nodeMaterial.js.map +1 -1
  62. package/Materials/Textures/cubeTexture.d.ts +38 -3
  63. package/Materials/Textures/cubeTexture.js +36 -14
  64. package/Materials/Textures/cubeTexture.js.map +1 -1
  65. package/Materials/Textures/internalTexture.js +1 -1
  66. package/Materials/Textures/internalTexture.js.map +1 -1
  67. package/Materials/material.d.ts +1 -1
  68. package/Materials/material.js.map +1 -1
  69. package/Materials/pushMaterial.d.ts +1 -1
  70. package/Materials/pushMaterial.js.map +1 -1
  71. package/Materials/shaderMaterial.d.ts +1 -1
  72. package/Materials/shaderMaterial.js.map +1 -1
  73. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +0 -2
  74. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  75. package/Meshes/Node/Blocks/mergeGeometryBlock.js +15 -11
  76. package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
  77. package/Meshes/abstractMesh.d.ts +6 -16
  78. package/Meshes/abstractMesh.js +5 -21
  79. package/Meshes/abstractMesh.js.map +1 -1
  80. package/Meshes/mesh.js +2 -2
  81. package/Meshes/mesh.js.map +1 -1
  82. package/Meshes/mesh.vertexData.js +19 -1
  83. package/Meshes/mesh.vertexData.js.map +1 -1
  84. package/Meshes/transformNode.d.ts +14 -0
  85. package/Meshes/transformNode.js +20 -0
  86. package/Meshes/transformNode.js.map +1 -1
  87. package/Particles/EmitterTypes/coneParticleEmitter.d.ts +60 -0
  88. package/Particles/EmitterTypes/coneParticleEmitter.js +88 -0
  89. package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
  90. package/Particles/IParticleSystem.d.ts +2 -1
  91. package/Particles/IParticleSystem.js.map +1 -1
  92. package/Particles/baseParticleSystem.d.ts +2 -1
  93. package/Particles/baseParticleSystem.js +3 -0
  94. package/Particles/baseParticleSystem.js.map +1 -1
  95. package/Particles/gpuParticleSystem.d.ts +2 -1
  96. package/Particles/gpuParticleSystem.js +6 -1
  97. package/Particles/gpuParticleSystem.js.map +1 -1
  98. package/Particles/particleSystem.d.ts +2 -1
  99. package/Particles/particleSystem.functions.d.ts +2 -1
  100. package/Particles/particleSystem.functions.js +4 -1
  101. package/Particles/particleSystem.functions.js.map +1 -1
  102. package/Particles/particleSystem.js +10 -2
  103. package/Particles/particleSystem.js.map +1 -1
  104. package/Physics/v2/IPhysicsEnginePlugin.d.ts +3 -0
  105. package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
  106. package/Physics/v2/Plugins/havokPlugin.d.ts +14 -0
  107. package/Physics/v2/Plugins/havokPlugin.js +42 -18
  108. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  109. package/Physics/v2/physicsEngine.d.ts +14 -0
  110. package/Physics/v2/physicsEngine.js +20 -0
  111. package/Physics/v2/physicsEngine.js.map +1 -1
  112. package/Rendering/edgesRenderer.js +2 -1
  113. package/Rendering/edgesRenderer.js.map +1 -1
  114. package/Shaders/ShadersInclude/lineUboDeclaration.d.ts +7 -0
  115. package/Shaders/ShadersInclude/lineUboDeclaration.js +14 -0
  116. package/Shaders/ShadersInclude/lineUboDeclaration.js.map +1 -0
  117. package/Shaders/ShadersInclude/lineVertexDeclaration.d.ts +5 -0
  118. package/Shaders/ShadersInclude/lineVertexDeclaration.js +11 -0
  119. package/Shaders/ShadersInclude/lineVertexDeclaration.js.map +1 -0
  120. package/Shaders/gpuUpdateParticles.vertex.js +12 -2
  121. package/Shaders/gpuUpdateParticles.vertex.js.map +1 -1
  122. package/Shaders/line.vertex.d.ts +2 -0
  123. package/Shaders/line.vertex.js +5 -2
  124. package/Shaders/line.vertex.js.map +1 -1
  125. package/Shaders/picking.fragment.d.ts +5 -0
  126. package/Shaders/picking.fragment.js +20 -0
  127. package/Shaders/picking.fragment.js.map +1 -0
  128. package/Shaders/picking.vertex.d.ts +11 -0
  129. package/Shaders/picking.vertex.js +34 -0
  130. package/Shaders/picking.vertex.js.map +1 -0
  131. package/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js +1 -1
  132. package/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js.map +1 -1
  133. package/ShadersWGSL/gpuUpdateParticles.compute.js +11 -1
  134. package/ShadersWGSL/gpuUpdateParticles.compute.js.map +1 -1
  135. package/XR/features/WebXRControllerMovement.d.ts +14 -1
  136. package/XR/features/WebXRControllerMovement.js +21 -3
  137. package/XR/features/WebXRControllerMovement.js.map +1 -1
  138. package/XR/webXRExperienceHelper.js +3 -0
  139. package/XR/webXRExperienceHelper.js.map +1 -1
  140. package/XR/webXRInputSource.d.ts +1 -1
  141. package/XR/webXRInputSource.js +3 -3
  142. package/XR/webXRInputSource.js.map +1 -1
  143. package/package.json +1 -1
@@ -977,7 +977,25 @@ export class VertexData {
977
977
  result.uvs6 = meshOrGeometry.getVerticesData(VertexBuffer.UV6Kind, copyWhenShared, forceCopy);
978
978
  }
979
979
  if (meshOrGeometry.isVerticesDataPresent(VertexBuffer.ColorKind)) {
980
- result.colors = meshOrGeometry.getVerticesData(VertexBuffer.ColorKind, copyWhenShared, forceCopy);
980
+ const geometry = meshOrGeometry.geometry || meshOrGeometry;
981
+ const vertexBuffer = geometry.getVertexBuffer(VertexBuffer.ColorKind);
982
+ const colors = geometry.getVerticesData(VertexBuffer.ColorKind, copyWhenShared, forceCopy);
983
+ if (vertexBuffer.getSize() === 3) {
984
+ const newColors = new Float32Array((colors.length * 4) / 3);
985
+ for (let i = 0, j = 0; i < colors.length; i += 3, j += 4) {
986
+ newColors[j] = colors[i];
987
+ newColors[j + 1] = colors[i + 1];
988
+ newColors[j + 2] = colors[i + 2];
989
+ newColors[j + 3] = 1;
990
+ }
991
+ result.colors = newColors;
992
+ }
993
+ else if (vertexBuffer.getSize() === 4) {
994
+ result.colors = colors;
995
+ }
996
+ else {
997
+ throw new Error(`Unexpected number of color components: ${vertexBuffer.getSize()}`);
998
+ }
981
999
  }
982
1000
  if (meshOrGeometry.isVerticesDataPresent(VertexBuffer.MatricesIndicesKind)) {
983
1001
  result.matricesIndices = meshOrGeometry.getVerticesData(VertexBuffer.MatricesIndicesKind, copyWhenShared, forceCopy);