About this project

Avian is an ECS-driven 2D and 3D physics engine designed specifically for the Bevy game engine. Rather than wrapping an existing engine, it is built from the ground up with Bevy's Entity Component System at its core, so physics state lives in the same world as the rest of a game's entities. Design principles - Made with Bevy, for Bevy, with no wrappers around existing engines. - Ergonomic, familiar API. - Heavy use of the ECS instead of a separate physics world. - Modular plugin architecture so parts of the engine can be replaced. - Emphasis on documentation. Features - Rigid bodies: dynamic, kinematic and static, with linear and angular velocity, external forces, torque and impulses, gravity and gravity scale, linear and angular damping, axis locking, rigid body dominance, continuous collision detection (CCD), and automatic deactivation via sleeping. - Collision detection powered by Parry: colliders with configurable collision layers, density and material properties; collider generation for meshes and whole scenes; collision events; access to colliding entities; collision hooks for filtering and modifying collisions; manual contact queries and intersection tests. - Constraints and joints: built-in fixed, distance, prismatic, revolute and spherical joints, plus support for custom joints and constraints using XPBD. - Spatial queries: raycasting, shapecasting, point projection and intersection tests, with a component-based API, a flexible SpatialQuery system parameter and query filters. - Transform interpolation and extrapolation for fixed timesteps. - Debug rendering for colliders, AABBs, contacts, joints and spatial queries. - Configurable scheduling, high customizability, modular plugins, support for custom collision backends, and f32/f64 precision (f32 by default). Usage Add avian2d or avian3d to Cargo.toml, register PhysicsPlugins alongside Bevy's DefaultPlugins, then spawn entities with components such as RigidBody, Collider, AngularVelocity and Transform. The README includes a complete 3D example where a spinning cube falls onto a static cylindrical platform. Examples and versions Numerous 2D and 3D examples live under crates/avian2d/examples and crates/avian3d/examples. They support both f32 and f64 precisions; f64 requires disabling default features and selecting dimension and precision manually. A version table maps Bevy releases to Avian releases (for example Bevy 0.19 with Avian 0.7), and migration guides are provided. Avian is the successor to Bevy XPBD. Community and license Contributions are welcome via issues and pull requests, with an AI policy to review first. Development discussion happens on the Avian Dev Discord and the Bevy Discord. The project is dual-licensed under MIT or Apache-2.0, at the user's option.