Particle simulator

Particle simulator

- Simulations:
- Free particles: up to 20 000 particles - 13 fps
- Springs: 5000 particles connected in 200 ropes; spring strength 100, damping 20 – 12 fps
- Cloth:

i. Euler 50x50: grid spring strength 100, damping 2, time step 0.001 – 12 fps

ii. Middle-point: 50x50 grid spring strength 100, damping 2, time step 0.001 – 10 fps

iii. Runge-Kutta4: 50x50 grid spring strength 200, damping 2, time step 0.01 – 8 fps

iv. Large-Step-Euler: 50x50 grid spring strength 1000, damping 2, time step 0.1 – 30 fps

v. Implicit: 50x50 grid spring strength 1000, damping 2, time step 0.01 – 30 fps

- Fireworks: Creating a particle on each vertex of a mesh and shoot it out
- Soft Body: Read the mesh data and creates spring connections between the vertices. When dropped against a plane the object deforms and bounces

- Solvers:
- Euler
- Middle-point
- Runge-Kutta 4
- Large-Step-Euler (Readjusts the distance between particles several times in each step before refreshing the forces which makes the simulation more stable)
- Implicit

- Collision detection: We check if particle will collide with any mesh on the scene for each step by first ray casting the bounding boxes only if we have a hit we check each triangle in the mesh. If an intersection occurs we reflect the particle’s velocity by the normal of the intersecting triangle.

- Forces:
- Constant: e.g. gravity acts in a constant direction with a constant value
- Impulse: Gives the particle initial velocity, which gradually descends
- Vector Field: Like constant plus some randomness in direction and strength
- Friction (damping): some constant that takes away energy from the relative velocity