Repolode
avianphysics

avianphysics/avian

An ECS-driven 2D and 3D physics engine built specifically for the Bevy game engine in Rust.

Stars
3,280
Forks
302
Open issues
212
Last commit
3 days ago

What is it?

Avian is a physics engine for the Bevy game engine, written in Rust and offered in separate 2D (avian2d) and 3D (avian3d) crates. It is designed to fit Bevy's Entity Component System directly, so physics objects are ordinary entities and components rather than a separate physics world that has to be kept in sync.

The engine covers dynamic, kinematic and static rigid bodies, with velocities, forces, damping, axis locking, sleeping and continuous collision detection. Collision detection uses the Parry library, and the project provides collision events, layers, collision hooks, joints (fixed, distance, prismatic, revolute, spherical), and spatial queries such as raycasts and shapecasts. Transform interpolation for fixed timesteps and debug rendering are also included.

Avian supports both f32 and f64 precision, with f32 as the default. Its documentation and a set of 2D and 3D examples are available on docs.rs and in the repository.

Key features

  • 01Dynamic, kinematic and static rigid bodies with velocity, damping and axis locking
  • 02Collision detection powered by Parry, with layers, collision events and hooks
  • 03Built-in joints: fixed, distance, prismatic, revolute and spherical
  • 04Raycasts, shapecasts and other spatial queries through components or a SpatialQuery parameter
  • 05Transform interpolation and extrapolation for fixed timesteps
  • 06f32 and f64 precision support

Use cases

  • Adding rigid-body physics and collisions to a 2D or 3D game built with Bevy
  • Creating joints and constraints such as hinges or sliders in a Bevy simulation
  • Running raycasts or shapecasts for gameplay like line of sight or projectile checks

Quick start

  1. 1

    Add avian3d to your Cargo.toml dependencies (use avian2d for 2D)

    avian3d = "0.8"
  2. 2

    Add PhysicsPlugins to your Bevy app and spawn physics entities with RigidBody and Collider

Things to know

  • Tied to the Bevy game engine, so it is not useful outside Bevy.
  • Pre-1.0 version (0.8), so APIs may change between releases.
  • Each Bevy version requires a matching Avian version, so Bevy upgrades may need coordinated updates.

In collections

Topics

FAQ

What is avian?
An ECS-driven 2D and 3D physics engine built specifically for the Bevy game engine in Rust. Avian is a physics engine for the Bevy game engine, written in Rust and offered in separate 2D (avian2d) and 3D (avian3d) crates. It is designed to fit Bevy's Entity Component System directly, so physics objects are ordinary entities and components rather than a separate physics world that has to be kept in sync.
Is avian free to use? What license does it have?
avian is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is avian still maintained?
Actively maintained. The last commit to avian was on Nov 4, 2026.
What can I use avian for?
Adding rigid-body physics and collisions to a 2D or 3D game built with Bevy Creating joints and constraints such as hinges or sliders in a Bevy simulation Running raycasts or shapecasts for gameplay like line of sight or projectile checks
How do I install avian?
Add avian3d to your Cargo.toml dependencies (use avian2d for 2D): avian3d = "0.8" Add PhysicsPlugins to your Bevy app and spawn physics entities with RigidBody and Collider
Where can I get avian?
The source code and installation instructions are on GitHub: https://github.com/avianphysics/avian

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects