ParticleSolver
CPU and GPU implementations of a particle-based physics simulation based on Macklin et. al's "Unified Particle Physics for Real-Time Application".
Install / Use
/learn @ebirenbaum/ParticleSolverREADME
Unified Particle Solver
An implementation of Macklin et. al's Unified Particle Physics for Real-Time Applications for both the CPU and GPU.
This physics simulation was implemented on both the CPU (leveraging the Qt framework) and GPU (using CUDA) as a final project for Brown University's graduate-level course CSCI2240: Interactive Computer Graphics by Evan Birenbaum '15, Logan Barnes '15, and Geoff Trousdale '15.
Overview
The simulation supports a variety of states of matter by representing the entire world as a large set of small, individual, and independent particles that are influenced by a set of constraints. The system supports the following physical phenomena with two-way interaction:
- Inter-particle collisions
- Rigid bodies with approximated stacking
- Friction
- Rope and cloth
- Fluids
- Gases
CPU demo scenes
The following demo scenes are built in the CPU application, labeled with appropriate key commands to bring them up:
- 1 - A collapsing sand pile demonstrating frictional effect on angle of repose
- 2 - Stiff stacks of rigid bodies
- 3 - Stable stacking of rigid bodies in the formation of a wall
- 4 - Chained rigid bodies acting as a pendulum
- 5 - A fluid caught and held by a rope
- 6 - Two fluids settling, demonstrating the Rayleigh-Taylor instability
- 7 - Solids sinking or floating based on density
- 8 - Gas particles interacting with a swinging rope
- 9 - A rigid body being stopped by friction
- 0 - Fluids trapped like a water balloon
- D - Gas particles emitted into a closed space
- S - Gas particles emitted into an open space
- W - I came in like a wrecking ball!
- N - Newton's cradle
- . - Resolution of interlocked rigid bodies
- V - A volcano erupting and settling
The following commands may also be useful:
- T - Toggle real-time or time-step mode
- Space - move forward by a time step during time-step mode
- R - reset the simulation
- C - toggle rendering of individual particles
GPU demo scenes
Note: This version of the program no longer uses the CUDA 7 cuSolver library allowing it to be run on CUDA 5 capable machines.
The following demo scenes are built in the GPU application, labeled with appropriate key commands to bring them up:
- 1 - A single rope demonstrating basic distance constraints
- 2 - A cloth created with a grid of distance constraints
- 3 - Two fluids settling, demonstrating the Rayleigh-Taylor instability
- 4 - A single stack of solid particles
- 5 - Multiple stacks of solid particles
- 6 - A grid of solid particles falling into a cloth net
- 7 - A giant ball of fluid being fluidy, and demonstrating surface tension
- 8 - A combo scene of solid particles, cloths, ropes, and an immovable sphere
- 9 - Hair...just hair
- 0 - Empty scene
Moving around in the scene:
- W - Move forward
- A - Move left
- S - Move backward
- D - Move right
- Mouse - Look around
- Left Click - Shoot particle into scene
- Space - Add fluid to scene at origin (not guaranteed to maintain stability)
Pretty pictures

Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
