@newkrok/three-particles 0.6.0 → 0.6.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/README.md CHANGED
@@ -18,4 +18,4 @@ Install with npm
18
18
  `npm i @newkrok/three-particles`
19
19
 
20
20
  Add as a package.json dependency
21
- `"dependencies": { ... "@newkrok/three-particles": "0.6.0" ... }, `
21
+ `"dependencies": { ... "@newkrok/three-particles": "0.6.1" ... }, `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newkrok/three-particles",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Particle system for ThreeJS",
5
5
  "main": "src/js/three-particles.js",
6
6
  "bin": {
@@ -652,10 +652,10 @@ export const updateParticleSystems = ({ now, delta, elapsed }) => {
652
652
  currentWorldPosition.y - lastWorldPosition.y,
653
653
  currentWorldPosition.z - lastWorldPosition.z
654
654
  );
655
+ worldPositionChange.applyQuaternion(worldQuaternion.invert())
655
656
  }
656
657
  generalData.distanceFromLastEmitByDistance += worldPositionChange.length();
657
658
  particleSystem.getWorldPosition(lastWorldPosition);
658
-
659
659
  particleSystem.getWorldQuaternion(worldQuaternion);
660
660
  if (
661
661
  lastWorldQuaternion.x === -99999 ||
@@ -665,16 +665,12 @@ export const updateParticleSystems = ({ now, delta, elapsed }) => {
665
665
  ) {
666
666
  worldEuler.setFromQuaternion(worldQuaternion);
667
667
  lastWorldQuaternion.copy(worldQuaternion);
668
-
669
- const tempPosX = particleSystem.position.x;
670
- const tempPosY = particleSystem.position.y;
671
- const tempPosZ = particleSystem.position.z;
672
- gravityVelocity.set(0, gravity, 0);
673
- particleSystem.position.set(0, 0, 0);
674
- particleSystem.updateMatrixWorld();
668
+ gravityVelocity.set(
669
+ lastWorldPosition.x,
670
+ lastWorldPosition.y + gravity,
671
+ lastWorldPosition.z
672
+ );
675
673
  particleSystem.worldToLocal(gravityVelocity);
676
- particleSystem.position.set(tempPosX, tempPosY, tempPosZ);
677
- particleSystem.updateMatrixWorld();
678
674
  }
679
675
 
680
676
  generalData.creationTimes.forEach((entry, index) => {