tsparticles 1.37.4 → 1.37.5
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/Utils/Utils.js +4 -7
- package/browser/Utils/Utils.js +5 -8
- package/esm/Utils/Utils.js +5 -8
- package/package.json +1 -1
- package/report.html +2 -2
- package/report.slim.html +2 -2
- package/tsparticles.js +4 -7
- package/tsparticles.min.js +2 -2
- package/tsparticles.slim.js +4 -7
- package/tsparticles.slim.min.js +2 -2
package/tsparticles.slim.js
CHANGED
|
@@ -939,14 +939,11 @@
|
|
|
939
939
|
};
|
|
940
940
|
}
|
|
941
941
|
function circleBounce(p1, p2) {
|
|
942
|
-
const xVelocityDiff = p1.velocity.
|
|
943
|
-
const
|
|
944
|
-
const
|
|
945
|
-
const pos2 = p2.position;
|
|
946
|
-
const xDist = pos2.x - pos1.x;
|
|
947
|
-
const yDist = pos2.y - pos1.y;
|
|
942
|
+
const {x: xVelocityDiff, y: yVelocityDiff} = p1.velocity.sub(p2.velocity);
|
|
943
|
+
const [pos1, pos2] = [ p1.position, p2.position ];
|
|
944
|
+
const {dx: xDist, dy: yDist} = getDistances(pos2, pos1);
|
|
948
945
|
if (xVelocityDiff * xDist + yVelocityDiff * yDist >= 0) {
|
|
949
|
-
const angle = -Math.atan2(
|
|
946
|
+
const angle = -Math.atan2(yDist, xDist);
|
|
950
947
|
const m1 = p1.mass;
|
|
951
948
|
const m2 = p2.mass;
|
|
952
949
|
const u1 = p1.velocity.rotate(angle);
|