No description
- Rust 99.7%
- Nix 0.3%
| benches | ||
| examples | ||
| src | ||
| tests | ||
| .envrc | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| CLAUDE.md | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
| ROADMAP.md | ||
fizecks
A physics engine written in Rust.
Usage
use fizecks::{Body, BodyKind, Shape, Vec2, World};
let mut world = World::new();
world.gravity = Vec2::new(0.0, 300.0);
// Static floor.
world.add_body(
Body::new(Shape::Rect { half_width: 200.0, half_height: 10.0 })
.with_position(Vec2::new(400.0, 550.0))
.with_kind(BodyKind::Static),
);
// Bouncing ball.
world.add_body(
Body::new(Shape::Circle { radius: 20.0 })
.with_position(Vec2::new(400.0, 100.0))
.with_restitution(0.8),
);
// Step the simulation.
let dt = 1.0 / 120.0;
world.step(dt);
Demos
The examples are headless: each one steps a scene deterministically, records a
frame per step into an in-memory framebuffer, encodes an animated GIF to
out/<name>.gif, and opens it in your default image viewer.
cargo run --example bouncing_ball # gravity & restitution
cargo run --example box_stack # stacking & friction
cargo run --example pendulum # revolute joint
cargo run --example ccd_bullet # continuous collision (tunnelling)
cargo run --example sensor_trigger # sensor enter/exit events
cargo run --example kinematic_platform # kinematic body carrying a dynamic box
cargo run --example convex_pile # convex polygons heaping in a bin
cargo run --example ray_casting # ray query sweep with hit markers
Each example also asserts its final state, so a run that doesn't end in PASS
signals a regression. The only extra dependency is the small, pure-Rust gif
encoder, declared as a dev-dependency — the library crate itself has zero
dependencies.
Tests
cargo test
Status
fizecks is a library crate. Behavior is verified through the integration tests in
tests/ and demonstrated by the headless examples above — see
ROADMAP.md for feature progress.