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.js
CHANGED
|
@@ -1222,14 +1222,11 @@
|
|
|
1222
1222
|
};
|
|
1223
1223
|
}
|
|
1224
1224
|
function circleBounce(p1, p2) {
|
|
1225
|
-
const xVelocityDiff = p1.velocity.
|
|
1226
|
-
const
|
|
1227
|
-
const
|
|
1228
|
-
const pos2 = p2.position;
|
|
1229
|
-
const xDist = pos2.x - pos1.x;
|
|
1230
|
-
const yDist = pos2.y - pos1.y;
|
|
1225
|
+
const {x: xVelocityDiff, y: yVelocityDiff} = p1.velocity.sub(p2.velocity);
|
|
1226
|
+
const [pos1, pos2] = [ p1.position, p2.position ];
|
|
1227
|
+
const {dx: xDist, dy: yDist} = getDistances(pos2, pos1);
|
|
1231
1228
|
if (xVelocityDiff * xDist + yVelocityDiff * yDist >= 0) {
|
|
1232
|
-
const angle = -Math.atan2(
|
|
1229
|
+
const angle = -Math.atan2(yDist, xDist);
|
|
1233
1230
|
const m1 = p1.mass;
|
|
1234
1231
|
const m2 = p2.mass;
|
|
1235
1232
|
const u1 = p1.velocity.rotate(angle);
|