Skip to content

jakemcleman/project-sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Sandbox

Experimental rust falling sand simulation with long term goals of huge worlds and complex particle physics and interaction simulation. For the latest working build, check the Releases page

Latest release status Current main build/test

Setup

Project is built using latest stable rust toolchain versions. On windows, just installing the rust/cargo toolchain is enough to get building. On Linux there are a few extra things you may need, see Bevy Linux Dependencies

Architecture

The project is currently split into 3 crates.

Gridmath

Contains the integer vector library used for this project. This includes the set of bounds helper functions that are used in the simulation, including iterators for traversing each integer coordinate within a bounding box.

sandworld

Contains the core simulation, depends on gridmath. Uses Rayon to multithread the simulation and provides an API to manipulate and help render it. Simulation is based on chunks, which each keep track of what areas need updating and process their own updates, allowing for movement into neighbors if needed. Each chunk is able to run its updates safely in parallel as long as no orthogonnaly or diagonally adjacent chunks are being updated at the same time.

sandgame (top level executable)

Depends on the other 2 crates. Contains a Bevy app to run, render, and manipulate the simulation with basic UI. Renders each chunk as a sprite, using a color array produced by a chunk's render method.