Skip to content

Commit 38177c7

Browse files
committed
Set default options suitable for mouse trail
1 parent 672ddf6 commit 38177c7

File tree

2 files changed

+9
-14
lines changed

2 files changed

+9
-14
lines changed

examples/nextjs/src/app/layout.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ export default function RootLayout({ children }: { children: React.ReactNode }):
2424
fullScreenOverlay
2525
options={{
2626
rgba: [0, 1, 0, 0.5],
27-
maxParticles: 1000,
28-
generationRate: 0.25,
29-
angleRage: [-2 * Math.PI, 2 * Math.PI],
30-
origin: [-1, -1],
31-
speedRange: [0.01, 0.1],
32-
ageRange: [0.01, 0.5],
33-
forceField: [0, 0],
3427
}}
3528
/>
3629
</body>

lib/src/simulator.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ export interface ParticlesOptions {
5656
}
5757

5858
const defaultOptions: ParticlesOptions = {
59-
rgba: [1, 0, 0, 1],
60-
maxParticles: 1000_000,
61-
generationRate: 1,
62-
forceField: [0, -0.25],
63-
angleRage: [-PI, PI],
64-
speedRange: [0.5, 1],
65-
ageRange: [2, 10],
59+
rgba: [1, 0, 0, 0.5],
60+
maxParticles: 1000,
61+
generationRate: 0.25,
62+
// setting range from -PI to PI craetes some patches because of overflows
63+
angleRage: [-2 * PI, 2 * PI],
64+
origin: [-1, -1],
65+
speedRange: [0.01, 0.1],
66+
ageRange: [0.01, 0.5],
67+
forceField: [0, 0.1],
6668
};
6769

6870
/** generate initial data for the simulation */

0 commit comments

Comments
 (0)