No description
  • Rust 99.7%
  • Nix 0.3%
Find a file
2026-07-09 00:18:28 -05:00
benches Format Rust codebase 2026-06-05 18:08:48 -06:00
examples Add capsules and the remaining medium roadmap features. 2026-06-06 21:03:02 -06:00
src Add capsules and the remaining medium roadmap features. 2026-06-06 21:03:02 -06:00
tests Add capsules and the remaining medium roadmap features. 2026-06-06 21:03:02 -06:00
.envrc Add friction: per-body coefficient, Coulomb impulse resolution, example, and tests 2026-04-12 20:57:38 -06:00
.gitignore Harden body handles: generational handles, joint guards, mass retention 2026-06-05 00:40:10 -06:00
Cargo.lock Add headless GIF demo examples; fix restitution to survive iterative solver 2026-06-02 20:10:03 -06:00
Cargo.toml Add zero-dependency benchmark suite with per-phase profiling 2026-06-05 17:22:57 -06:00
CLAUDE.md Add friction and restitution mixing policies. 2026-06-06 00:00:26 -06:00
flake.lock Add friction: per-body coefficient, Coulomb impulse resolution, example, and tests 2026-04-12 20:57:38 -06:00
flake.nix update flake 2026-04-13 16:47:25 -06:00
README.md cleanup 2026-07-09 00:18:28 -05:00
ROADMAP.md Add capsules and the remaining medium roadmap features. 2026-06-06 21:03:02 -06:00

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.