@babylonjs/core 6.16.2 → 6.17.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.
Files changed (51) hide show
  1. package/Animations/animatable.d.ts +4 -0
  2. package/Animations/animatable.js +7 -1
  3. package/Animations/animatable.js.map +1 -1
  4. package/Animations/animationGroup.d.ts +16 -0
  5. package/Animations/animationGroup.js +50 -0
  6. package/Animations/animationGroup.js.map +1 -1
  7. package/Animations/animationGroupMask.d.ts +63 -0
  8. package/Animations/animationGroupMask.js +83 -0
  9. package/Animations/animationGroupMask.js.map +1 -0
  10. package/Animations/index.d.ts +1 -0
  11. package/Animations/index.js +1 -0
  12. package/Animations/index.js.map +1 -1
  13. package/Engines/thinEngine.js +2 -2
  14. package/Engines/thinEngine.js.map +1 -1
  15. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.d.ts +77 -0
  16. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +198 -0
  17. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -0
  18. package/Meshes/Node/Blocks/geometryInputBlock.js +1 -0
  19. package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
  20. package/Meshes/Node/Blocks/noiseBlock.d.ts +10 -2
  21. package/Meshes/Node/Blocks/noiseBlock.js +22 -4
  22. package/Meshes/Node/Blocks/noiseBlock.js.map +1 -1
  23. package/Meshes/Node/Enums/nodeGeometryContextualSources.d.ts +3 -1
  24. package/Meshes/Node/Enums/nodeGeometryContextualSources.js +2 -0
  25. package/Meshes/Node/Enums/nodeGeometryContextualSources.js.map +1 -1
  26. package/Meshes/Node/index.d.ts +1 -0
  27. package/Meshes/Node/index.js +1 -0
  28. package/Meshes/Node/index.js.map +1 -1
  29. package/Meshes/Node/nodeGeometryBuildState.js +2 -0
  30. package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
  31. package/Meshes/mesh.vertexData.d.ts +9 -0
  32. package/Meshes/mesh.vertexData.js +10 -0
  33. package/Meshes/mesh.vertexData.js.map +1 -1
  34. package/Particles/IGPUParticleSystemPlatform.d.ts +2 -2
  35. package/Particles/IGPUParticleSystemPlatform.js.map +1 -1
  36. package/Particles/computeShaderParticleSystem.d.ts +2 -2
  37. package/Particles/computeShaderParticleSystem.js +2 -2
  38. package/Particles/computeShaderParticleSystem.js.map +1 -1
  39. package/Particles/gpuParticleSystem.d.ts +2 -0
  40. package/Particles/gpuParticleSystem.js +16 -3
  41. package/Particles/gpuParticleSystem.js.map +1 -1
  42. package/Particles/particleSystem.d.ts +2 -0
  43. package/Particles/particleSystem.js +40 -7
  44. package/Particles/particleSystem.js.map +1 -1
  45. package/Particles/webgl2ParticleSystem.d.ts +4 -2
  46. package/Particles/webgl2ParticleSystem.js +8 -2
  47. package/Particles/webgl2ParticleSystem.js.map +1 -1
  48. package/Physics/v2/physicsBody.d.ts +18 -1
  49. package/Physics/v2/physicsBody.js +26 -1
  50. package/Physics/v2/physicsBody.js.map +1 -1
  51. package/package.json +1 -1
@@ -917,9 +917,11 @@ export class ParticleSystem extends BaseParticleSystem {
917
917
  }
918
918
  _createIndexBuffer() {
919
919
  if (this._useInstancing) {
920
+ this._linesIndexBufferUseInstancing = this._engine.createIndexBuffer(new Uint32Array([0, 1, 1, 3, 3, 2, 2, 0, 0, 3]));
920
921
  return;
921
922
  }
922
923
  const indices = [];
924
+ const indicesWireframe = [];
923
925
  let index = 0;
924
926
  for (let count = 0; count < this._capacity; count++) {
925
927
  indices.push(index);
@@ -928,9 +930,11 @@ export class ParticleSystem extends BaseParticleSystem {
928
930
  indices.push(index);
929
931
  indices.push(index + 2);
930
932
  indices.push(index + 3);
933
+ indicesWireframe.push(index, index + 1, index + 1, index + 2, index + 2, index + 3, index + 3, index, index, index + 3);
931
934
  index += 4;
932
935
  }
933
936
  this._indexBuffer = this._engine.createIndexBuffer(indices);
937
+ this._linesIndexBuffer = this._engine.createIndexBuffer(indicesWireframe);
934
938
  }
935
939
  /**
936
940
  * Gets the maximum number of particles active at the same time.
@@ -1612,7 +1616,7 @@ export class ParticleSystem extends BaseParticleSystem {
1612
1616
  return true;
1613
1617
  }
1614
1618
  _render(blendMode) {
1615
- var _a, _b;
1619
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1616
1620
  const drawWrapper = this._getWrapper(blendMode);
1617
1621
  const effect = drawWrapper.effect;
1618
1622
  const engine = this._engine;
@@ -1648,13 +1652,24 @@ export class ParticleSystem extends BaseParticleSystem {
1648
1652
  effect.setMatrix("invView", TmpVectors.Matrix[0]);
1649
1653
  }
1650
1654
  if (this._vertexArrayObject !== undefined) {
1651
- if (!this._vertexArrayObject) {
1652
- this._vertexArrayObject = this._engine.recordVertexArrayObject(this._vertexBuffers, this._indexBuffer, effect);
1655
+ if ((_c = this._scene) === null || _c === void 0 ? void 0 : _c.forceWireframe) {
1656
+ engine.bindBuffers(this._vertexBuffers, this._linesIndexBufferUseInstancing, effect);
1657
+ }
1658
+ else {
1659
+ if (!this._vertexArrayObject) {
1660
+ this._vertexArrayObject = this._engine.recordVertexArrayObject(this._vertexBuffers, null, effect);
1661
+ }
1662
+ this._engine.bindVertexArrayObject(this._vertexArrayObject, ((_d = this._scene) === null || _d === void 0 ? void 0 : _d.forceWireframe) ? this._linesIndexBufferUseInstancing : this._indexBuffer);
1653
1663
  }
1654
- this._engine.bindVertexArrayObject(this._vertexArrayObject, this._indexBuffer);
1655
1664
  }
1656
1665
  else {
1657
- engine.bindBuffers(this._vertexBuffers, this._indexBuffer, effect);
1666
+ if (!this._indexBuffer) {
1667
+ // Use instancing mode
1668
+ engine.bindBuffers(this._vertexBuffers, ((_e = this._scene) === null || _e === void 0 ? void 0 : _e.forceWireframe) ? this._linesIndexBufferUseInstancing : null, effect);
1669
+ }
1670
+ else {
1671
+ engine.bindBuffers(this._vertexBuffers, ((_f = this._scene) === null || _f === void 0 ? void 0 : _f.forceWireframe) ? this._linesIndexBuffer : this._indexBuffer, effect);
1672
+ }
1658
1673
  }
1659
1674
  // Log. depth
1660
1675
  if (this.useLogarithmicDepth && this._scene) {
@@ -1683,10 +1698,20 @@ export class ParticleSystem extends BaseParticleSystem {
1683
1698
  this._onBeforeDrawParticlesObservable.notifyObservers(effect);
1684
1699
  }
1685
1700
  if (this._useInstancing) {
1686
- engine.drawArraysType(7, 0, 4, this._particles.length);
1701
+ if ((_g = this._scene) === null || _g === void 0 ? void 0 : _g.forceWireframe) {
1702
+ engine.drawElementsType(6, 0, 10, this._particles.length);
1703
+ }
1704
+ else {
1705
+ engine.drawArraysType(7, 0, 4, this._particles.length);
1706
+ }
1687
1707
  }
1688
1708
  else {
1689
- engine.drawElementsType(0, 0, this._particles.length * 6);
1709
+ if ((_h = this._scene) === null || _h === void 0 ? void 0 : _h.forceWireframe) {
1710
+ engine.drawElementsType(1, 0, this._particles.length * 10);
1711
+ }
1712
+ else {
1713
+ engine.drawElementsType(0, 0, this._particles.length * 6);
1714
+ }
1690
1715
  }
1691
1716
  return this._particles.length;
1692
1717
  }
@@ -1735,6 +1760,14 @@ export class ParticleSystem extends BaseParticleSystem {
1735
1760
  this._engine._releaseBuffer(this._indexBuffer);
1736
1761
  this._indexBuffer = null;
1737
1762
  }
1763
+ if (this._linesIndexBuffer) {
1764
+ this._engine._releaseBuffer(this._linesIndexBuffer);
1765
+ this._linesIndexBuffer = null;
1766
+ }
1767
+ if (this._linesIndexBufferUseInstancing) {
1768
+ this._engine._releaseBuffer(this._linesIndexBufferUseInstancing);
1769
+ this._linesIndexBufferUseInstancing = null;
1770
+ }
1738
1771
  if (this._vertexArrayObject) {
1739
1772
  this._engine.releaseVertexArrayObject(this._vertexArrayObject);
1740
1773
  this._vertexArrayObject = null;