Skip to content

A physics simulator, using OpenGL and SDL2 for display, written in Rust.

License

Notifications You must be signed in to change notification settings

PerpetualColor/sdl_physics

Repository files navigation

sdl_physics

A physics simulator, using OpenGL and SDL2 for display, written in Rust.

Running

Linux

You may need to install your OpenGL libraries and SDL2 libraries. Then just run cargo run

Windows x64

The required libraries (freetype.lib, freetype.dll, and sdl2.dll) are included in the binary. Just run cargo run

Windows x86

You will need to download or build freetype and sdl2 libraries. Build using cargo build and run with cargo run.

Usage

It's mostly self-explanatory. Play to play, pause to pause, grid to make a grid, sine to make a sine wave of particles, and a list of functions to play around with. The little lines all over the graph are acceleration vectors, the strengths of which are represented by the redness. Click and drag to add a new particle.

Screenshots

Gravity Simulation alt text

Butterfly-Looking Force alt text

Harmonic Sine-Wave alt text

Credit

Credit for much of the GL code to nercury's tutorial and to learnopengl.com.

About

A physics simulator, using OpenGL and SDL2 for display, written in Rust.

Resources

License

Stars

Watchers

Forks

Packages

No packages published