
This project is an implementation of the Game Physics in a Weekend book using the Rust programming language and the Bevy game engine.
This has been a learning excercise for me to get a better understanding of implementing a physics engine, using Bevy and also making use of my math library glam.
Note that the code from the book and this code is for learning purposes, it's not very optimized and not intended for use in production. For real world use check out Rapier or physx-rs.
I'm using a fork of Bevy 0.5.0 that is using the latest version of glam from github.
The Bevy Flycam plugin is used for camera movement.
The book uses Z up and Bevy uses Y up. I've used the Bevy Y up convention here.
The book uses row-major matrices whereas glam uses column vectors and column
major matrices.
I've mostly tried to follow the code structure in the book, however some things don't translate so well to Rust so some organisation of code has changed.
BodyHandle is used instead of Body* pointers. The handle is currently
just wrapping an array index.Body and Constraint structs are owned by BodyArena and
ConstraintArena instead of being owned by PhysicsScene. This makes
working with the borrow checker easier.$ claude mcp add bevy-physics-weekend \
-- python -m otcore.mcp_server <graph>