@newkrok/three-particles 0.8.3 → 0.8.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newkrok/three-particles",
3
- "version": "0.8.3",
3
+ "version": "0.8.4",
4
4
  "description": "Particle system for ThreeJS",
5
5
  "main": "src/js/three-particles.js",
6
6
  "bin": {
@@ -72,7 +72,7 @@ export const calculateRandomPositionAndVelocityOnCone = (
72
72
 
73
73
  const positionLength = position.length();
74
74
  const normalizedAngle = Math.abs(
75
- (positionLength / radius) * THREE.Math.degToRad(angle)
75
+ (positionLength / radius) * THREE.MathUtils.degToRad(angle)
76
76
  );
77
77
  const sinNormalizedAngle = Math.sin(normalizedAngle);
78
78
 
@@ -195,8 +195,8 @@ export const calculateRandomPositionAndVelocityOnRectangle = (
195
195
  ) => {
196
196
  const xOffset = Math.random() * scale.x - scale.x / 2;
197
197
  const yOffset = Math.random() * scale.y - scale.y / 2;
198
- const rotationX = THREE.Math.degToRad(rotation.x);
199
- const rotationY = THREE.Math.degToRad(rotation.y);
198
+ const rotationX = THREE.MathUtils.degToRad(rotation.x);
199
+ const rotationY = THREE.MathUtils.degToRad(rotation.y);
200
200
  position.x = xOffset * Math.cos(rotationY);
201
201
  position.y = yOffset * Math.cos(rotationX);
202
202
  position.z = xOffset * Math.sin(rotationY) - yOffset * Math.sin(rotationX);
@@ -498,7 +498,7 @@ export const createParticleSystem = (
498
498
  createFloat32AttributesRequest("opacity", 0);
499
499
 
500
500
  createFloat32AttributesRequest("rotation", () =>
501
- THREE.Math.degToRad(
501
+ THREE.MathUtils.degToRad(
502
502
  THREE.MathUtils.randFloat(startRotation.min, startRotation.max)
503
503
  )
504
504
  );
@@ -577,7 +577,7 @@ export const createParticleSystem = (
577
577
  generalData.startValues.startOpacity[particleIndex] =
578
578
  THREE.MathUtils.randFloat(startOpacity.min, startOpacity.max);
579
579
 
580
- geometry.attributes.rotation.array[particleIndex] = THREE.Math.degToRad(
580
+ geometry.attributes.rotation.array[particleIndex] = THREE.MathUtils.degToRad(
581
581
  THREE.MathUtils.randFloat(startRotation.min, startRotation.max)
582
582
  );
583
583
 
@@ -657,9 +657,9 @@ export const createParticleSystem = (
657
657
  particleSystem.sortParticles = true;
658
658
 
659
659
  particleSystem.position.copy(transform.position);
660
- particleSystem.rotation.x = THREE.Math.degToRad(transform.rotation.x);
661
- particleSystem.rotation.y = THREE.Math.degToRad(transform.rotation.y);
662
- particleSystem.rotation.z = THREE.Math.degToRad(transform.rotation.z);
660
+ particleSystem.rotation.x = THREE.MathUtils.degToRad(transform.rotation.x);
661
+ particleSystem.rotation.y = THREE.MathUtils.degToRad(transform.rotation.y);
662
+ particleSystem.rotation.z = THREE.MathUtils.degToRad(transform.rotation.z);
663
663
  particleSystem.scale.copy(transform.scale);
664
664
 
665
665
  const calculatedCreationTime =