{"id":32067270,"url":"https://github.com/avianphysics/avian","last_synced_at":"2026-02-24T20:02:42.836Z","repository":{"id":37541903,"uuid":"497570733","full_name":"avianphysics/avian","owner":"avianphysics","description":"ECS-driven 2D and 3D physics engine for the Bevy game engine.","archived":false,"fork":false,"pushed_at":"2026-02-07T17:46:34.000Z","size":10478,"stargazers_count":2736,"open_issues_count":163,"forks_count":214,"subscribers_count":14,"default_branch":"main","last_synced_at":"2026-02-09T14:54:49.511Z","etag":null,"topics":["2d","3d","bevy","game-development","gamedev","physics","physics-engine","rust","simulation"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/avian3d","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avianphysics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["Jondolf"]}},"created_at":"2022-05-29T11:28:38.000Z","updated_at":"2026-02-09T14:44:51.000Z","dependencies_parsed_at":"2024-02-16T23:33:48.049Z","dependency_job_id":"fffcad27-ef46-4c3b-ad67-e75afb21307a","html_url":"https://github.com/avianphysics/avian","commit_stats":{"total_commits":816,"total_committers":55,"mean_commits":"14.836363636363636","dds":"0.31495098039215685","last_synced_commit":"55d6815c8bbfc8f133304c203635983c2595ef98"},"previous_names":["jondolf/avian","jondolf/bevy_xpbd","avianphysics/avian"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/avianphysics/avian","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avianphysics%2Favian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avianphysics%2Favian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avianphysics%2Favian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avianphysics%2Favian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avianphysics","download_url":"https://codeload.github.com/avianphysics/avian/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avianphysics%2Favian/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29797889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T19:56:48.334Z","status":"ssl_error","status_checked_at":"2026-02-24T19:55:43.372Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d","3d","bevy","game-development","gamedev","physics","physics-engine","rust","simulation"],"created_at":"2025-10-19T03:00:50.262Z","updated_at":"2026-02-24T20:02:42.831Z","avatar_url":"https://github.com/avianphysics.png","language":"Rust","readme":"# ![Avian Physics](https://raw.githubusercontent.com/Jondolf/avian/avian/assets/branding/logo.svg)\n\n[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/avianphysics/avian#license)\n[![ci](https://github.com/avianphysics/avian/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/avianphysics/avian/actions/workflows/ci.yml)\n[![2D crates.io](https://img.shields.io/crates/v/avian2d?label=2D%20crates.io)](https://crates.io/crates/avian2d)\n[![2D docs.rs](https://img.shields.io/docsrs/avian2d?label=2D%20docs.rs)](https://docs.rs/avian2d)\n[![3D crates.io](https://img.shields.io/crates/v/avian3d?label=3D%20crates.io)](https://crates.io/crates/avian3d)\n[![3D docs.rs](https://img.shields.io/docsrs/avian3d?label=3D%20docs.rs)](https://docs.rs/avian3d)\n\n**Avian** is an ECS-driven 2D and 3D physics engine for the [Bevy game engine](https://bevyengine.org/).\n\n---\n\n## Design\n\nBelow are some of the core design principles used in Avian.\n\n- **Made with Bevy, for Bevy.** No wrappers around existing engines.\n- **Provide an ergonomic and familiar API.** Ergonomics is key for a good experience.\n- **Utilize the ECS as much as possible.** The engine should feel like a part of Bevy, and it shouldn't\n    need to maintain a separate physics world.\n- **Use a highly modular plugin architecture.** Users should be able to replace parts of the engine\n    with their own implementations.\n- **Have good documentation.** A physics engine is pointless if you don't know how to use it.\n\n## Features\n\nBelow are some of the current features of Avian.\n\n- Dynamic, kinematic and static rigid bodies\n  - Linear and angular velocity\n  - External forces, torque and impulses\n  - Gravity and gravity scale\n  - Linear and angular damping\n  - Locking translational and rotational axes\n  - Rigid body dominance\n  - Continuous Collision Detection (CCD)\n  - Automatic deactivation with sleeping\n- Collision detection powered by [Parry](https://parry.rs)\n  - Colliders with configurable collision layers, density, material properties and more\n  - Collider generation for meshes and entire scenes\n  - Collision events\n  - Access to colliding entities\n  - Filtering and modifying collisions with collision hooks\n  - Manual contact queries and intersection tests\n- Constraints and joints\n  - Several built-in joint types: fixed, distance, prismatic, revolute, spherical\n  - Support for custom joints and other constraints using XPBD\n- Spatial queries\n  - Raycasting, shapecasting, point projection and intersection tests\n  - Ergonomic component-based API for raycasts and shapecasts\n  - Flexible `SpatialQuery` system parameter\n  - Spatial query filters\n- `Transform` interpolation and extrapolation for fixed timesteps\n- Debug rendering for colliders, AABBs, contacts, joints, spatial queries, and more\n- Configurable scheduling and high customizability\n- Highly modular plugin architecture, freely extend and replace parts of the engine\n- Support for custom collision backends\n- `f32`/`f64` precision (`f32` by default)\n\nYou can find a more complete list along with documentation in the\n[Table of Contents](https://docs.rs/avian3d/latest/avian3d/#table-of-contents)\non docs.rs.\n\n## Documentation\n\n- [2D documentation](https://docs.rs/avian2d)\n- [3D documentation](https://docs.rs/avian3d)\n\n## Usage Example\n\nFirst, add `avian2d` or `avian3d` to your dependencies in `Cargo.toml`:\n\n```toml\n# For 2D applications:\n[dependencies]\navian2d = \"0.5\"\n\n# For 3D applications:\n[dependencies]\navian3d = \"0.5\"\n\n# If you want to use the most up-to-date version, you can follow the main branch:\n[dependencies]\navian3d = { git = \"https://github.com/avianphysics/avian\", branch = \"main\" }\n```\n\nBelow is a very simple example where a cube with initial angular velocity falls onto a circular platform.\nThis is a modified version of Bevy's [`3d_scene`](https://bevyengine.org/examples/3d-rendering/3d-scene/) example.\n\n```rust\nuse avian3d::prelude::*;\nuse bevy::prelude::*;\n\nfn main() {\n    App::new()\n        // Enable physics\n        .add_plugins((DefaultPlugins, PhysicsPlugins::default()))\n        .add_systems(Startup, setup)\n        .run();\n}\n\nfn setup(\n    mut commands: Commands,\n    mut meshes: ResMut\u003cAssets\u003cMesh\u003e\u003e,\n    mut materials: ResMut\u003cAssets\u003cStandardMaterial\u003e\u003e,\n) {\n    // Static physics object with a collision shape\n    commands.spawn((\n        RigidBody::Static,\n        Collider::cylinder(4.0, 0.1),\n        Mesh3d(meshes.add(Cylinder::new(4.0, 0.1))),\n        MeshMaterial3d(materials.add(Color::WHITE)),\n    ));\n\n    // Dynamic physics object with a collision shape and initial angular velocity\n    commands.spawn((\n        RigidBody::Dynamic,\n        Collider::cuboid(1.0, 1.0, 1.0),\n        AngularVelocity(Vec3::new(2.5, 3.5, 1.5)),\n        Mesh3d(meshes.add(Cuboid::from_length(1.0))),\n        MeshMaterial3d(materials.add(Color::srgb_u8(124, 144, 255))),\n        Transform::from_xyz(0.0, 4.0, 0.0),\n    ));\n\n    // Light\n    commands.spawn((\n        PointLight {\n            shadows_enabled: true,\n            ..default()\n        },\n        Transform::from_xyz(4.0, 8.0, 4.0),\n    ));\n\n    // Camera\n    commands.spawn((\n        Camera3d::default(),\n        Transform::from_xyz(-2.5, 4.5, 9.0).looking_at(Vec3::ZERO, Dir3::Y),\n    ));\n}\n```\n\n![A spinning cube falling onto a circular platform](https://github.com/user-attachments/assets/14d25e7e-9d46-467c-9fe6-dc408cd23398)\n\n## More Examples\n\nYou can find lots of 2D and 3D examples in [/crates/avian2d/examples](/crates/avian2d/examples) and [/crates/avian3d/examples](/crates/avian3d/examples) respectively.\n\nThe examples support both `f32` and `f64` precisions, so the code contains some feature-dependent types like `Scalar` and `Vector`.\nIn actual usage these are not needed, so you can just use `f32` or `f64` types depending on the features you have chosen.\n\nBy default the examples use `f32`. To run the `f64` versions, you need to disable default features and manually choose the dimension\nand precision:\n\n```shell\n# Manually specify dimension and precision. `parry-f64` enables collision detection using Parry.\ncargo run --example cubes --no-default-features --features \"3d f64 parry-f64\"\n```\n\n## Version Table\n\n| Bevy    | Avian     |\n| ------- | --------- |\n| 0.18    | 0.5, main |\n| 0.17    | 0.4       |\n| 0.16    | 0.3       |\n| 0.15    | 0.2       |\n| 0.14    | 0.1       |\n\nAvian provides [migration guides](./migration-guides) for each version.\n\n\u003cdetails\u003e\n  \u003csummary\u003eBevy XPBD versions (the predecessor of Avian)\u003c/summary\u003e\n\n  | Bevy | Bevy XPBD |\n  | ---- | --------- |\n  | 0.14 | 0.5       |\n  | 0.13 | 0.4       |\n  | 0.12 | 0.3       |\n  | 0.11 | 0.2       |\n  | 0.10 | 0.1       |\n\n\u003c/details\u003e\n\n## Contributing\n\nIf you encounter any problems, feel free to open issues or create pull requests.\nFor larger changes and additions, it's better to open an issue or ask me for input\nbefore making a pull request.\n\nYou can also ask for help or ask questions on the [Bevy Discord](https://discord.com/invite/gMUk5Ph)\nserver's Avian Physics topic in `#ecosystem-crates`. My username on the Discord is `Jondolf` (`@jondolfdev`).\n\n## Acknowledgements\n\nHuge thanks to the entire Bevy community for the incredible support!\nAll of your contributions, insight and requests are a massive help\nin driving the state of physics in Bevy forward, and it's what\nkeeps me motivated to build the best engine I can.\n\nI would also like to give a special thanks to [Johan Helsing][johan-helsing]\nfor inspiring this project and helping me significantly in the early stages.\nHis original [tutorial series][johan-xpbd-tutorial] is the reason `avian`\nexists in the first place, and without his support and contributions,\nthe project wouldn't be anywhere near where it is today.\n\n[johan-helsing]: https://github.com/johanhelsing\n[johan-xpbd-tutorial]: https://johanhelsing.studio/posts/bevy-xpbd\n\n## License\n\nAvian is free and open source. All code in this repository is dual-licensed under either:\n\n- MIT License ([LICENSE-MIT](/LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n- Apache License, Version 2.0 ([LICENSE-APACHE](/LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n\nat your option.\n","funding_links":["https://github.com/sponsors/Jondolf"],"categories":["Physics","Rust"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favianphysics%2Favian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favianphysics%2Favian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favianphysics%2Favian/lists"}