{"id":20783514,"url":"https://github.com/jondolf/bevy_heavy","last_synced_at":"2025-10-07T02:54:06.285Z","repository":{"id":224121886,"uuid":"762399531","full_name":"Jondolf/bevy_heavy","owner":"Jondolf","description":"Mass properties for Bevy's geometric primitives.","archived":false,"fork":false,"pushed_at":"2025-09-30T16:59:06.000Z","size":93,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-30T17:40:52.856Z","etag":null,"topics":["bevy","game-development","geometry","mass","math","physics","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/bevy_heavy","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/Jondolf.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":"2024-02-23T17:43:10.000Z","updated_at":"2025-09-30T16:59:10.000Z","dependencies_parsed_at":"2024-07-14T15:06:10.419Z","dependency_job_id":"81fcd50c-4edc-4a21-b746-d502ed829588","html_url":"https://github.com/Jondolf/bevy_heavy","commit_stats":null,"previous_names":["jondolf/bevy_heavy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jondolf/bevy_heavy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jondolf%2Fbevy_heavy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jondolf%2Fbevy_heavy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jondolf%2Fbevy_heavy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jondolf%2Fbevy_heavy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jondolf","download_url":"https://codeload.github.com/Jondolf/bevy_heavy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jondolf%2Fbevy_heavy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278712454,"owners_count":26032738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bevy","game-development","geometry","mass","math","physics","rust"],"created_at":"2024-11-17T14:19:34.929Z","updated_at":"2025-10-07T02:54:06.279Z","avatar_url":"https://github.com/Jondolf.png","language":"Rust","funding_links":["https://github.com/sponsors/Jondolf"],"categories":[],"sub_categories":[],"readme":"# `bevy_heavy`\n\n[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/Jondolf/bevy_heavy#license)\n[![ci](https://github.com/Jondolf/bevy_heavy/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Jondolf/bevy_heavy/actions/workflows/ci.yml)\n[![crates.io](https://img.shields.io/crates/v/bevy_heavy?label=crates.io)](https://crates.io/crates/bevy_heavy)\n[![docs.rs](https://img.shields.io/docsrs/bevy_heavy?label=docs.rs)](https://docs.rs/bevy_heavy)\n\n`bevy_heavy` is a crate for computing mass properties (mass, angular inertia, and center of mass)\nfor the [geometric primitives] in the [Bevy game engine][Bevy]. This is typically required\nfor things like physics simulations.\n\n[geometric primitives]: https://docs.rs/bevy/latest/bevy/math/primitives/index.html\n[Bevy]: https://bevyengine.org\n\n## Features\n\n- `MassProperties2d` and `MassProperties3d` structs containing the mass, angular inertia, and local center of mass\n- Mass property computation for all of Bevy's [geometric primitives]\n- Eigensolver for symmetric 3x3 matrices\n- Support for `bevy_reflect` and `serde` through the `bevy_reflect` and `serialize` feature flags\n\n## Usage\n\nMass properties can be computed individually for shapes using the `mass`, `angular_inertia`,\nand `center_of_mass` methods:\n\n```rust\nuse bevy_heavy::{ComputeMassProperties2d, MassProperties2d};\nuse bevy_math::{primitives::Rectangle, Vec2};\n\nlet rectangle = Rectangle::new(2.0, 1.0);\nlet density = 2.0;\n\nlet mass = rectangle.mass(density);\nlet angular_inertia = rectangle.angular_inertia(mass);\nlet center_of_mass = rectangle.center_of_mass();\n```\n\nYou can also compute all mass properties at once, returning `MassProperties2d` for 2D shapes,\nor `MassProperties3d` for 3D shapes. This can be more efficient when more than one property is needed.\n\n```rust\nlet mass_props = rectangle.mass_properties(density);\n```\n\nThe mass property types have several helper methods for various transformations and operations:\n\n```rust\nlet shifted_inertia = mass_props.shifted_angular_inertia(Vec2::new(-3.5, 1.0));\nlet global_center_of_mass = mass_props.global_center_of_mass(Vec2::new(5.0, 7.5));\n```\n\nYou can also add and subtract mass properties:\n\n```rust\nlet mass_props_2 = MassProperties2d::new(mass, angular_inertia, Vec2::new(0.0, 1.0));\nlet sum = mass_props + mass_props_2;\napprox::assert_relative_eq!(sum - mass_props_2, mass_props);\n```\n\nTo support mass property computation for custom shapes, implement `ComputeMassProperties2d`\nor `ComputeMassProperties3d` for them.\n\n## Supported `bevy_math` Versions\n\n| `bevy_math` | `bevy_heavy` |\n| ----------- | ------------ |\n| 0.17        | `main`       |\n| 0.16        | 0.2          |\n| 0.15        | 0.1          |\n\n## License\n\n`bevy_heavy` is free, open source, and permissively licensed! Except where noted (below and/or in individual files),\nall 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. This dual-licensing approach is the de-facto standard in the Rust ecosystem,\nand there are [very good reasons](https://github.com/bevyengine/bevy/issues/2373) to include both.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjondolf%2Fbevy_heavy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjondolf%2Fbevy_heavy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjondolf%2Fbevy_heavy/lists"}