| Crates.io | bevy_mod_skinned_aabb |
| lib.rs | bevy_mod_skinned_aabb |
| version | 0.4.0 |
| created_at | 2025-02-04 16:01:26.98503+00 |
| updated_at | 2026-01-14 06:30:49.786467+00 |
| description | A Bevy plugin that automatically calculates AABBs for skinned meshes |
| homepage | |
| repository | https://github.com/greeble-dev/bevy_mod_skinned_aabb |
| max_upload_size | |
| id | 1542123 |
| size | 181,629 |
A Bevy plugin that automatically calculates AABBs for skinned meshes.
https://github.com/user-attachments/assets/73d236da-43a8-4b63-a19e-f3625d374077
The goal of the plugin is to fix meshes disappearing due to incorrect AABBs.
To enable skinned AABBs in a Bevy 0.18 app:
cargo add bevy_mod_skinned_aabb
use bevy_mod_skinned_aabb::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
// Enable skinned AABBs.
.add_plugins(SkinnedAabbPlugin)
.run();
}
The plugin will automatically detect and update any skinned meshes that are added to the world.
RenderAssetUsages::MAIN_WORLD.
Mesh::asset_usage or the asset_usage parameter of Mesh::new.| bevy | bevy_mod_skinned_aabb |
|---|---|
0.18 |
0.4 |
0.17 |
0.3 |
0.16 |
0.2 |
0.15 |
0.1 |
<=0.14 |
Not supported |
git clone https://github.com/greeble-dev/bevy_mod_skinned_aabb
cd bevy_mod_skinned_aabb
# Show a variety of glTF and custom meshes.
cargo run --example showcase
# Stress test 1000 skinned meshes.
cargo run --example many_foxes
The per-frame CPU cost of a skinned mesh increases by roughly 4%. The cost of loading a skinned mesh from a glTF increases by less than 1%.
To see the mesh and joint AABBs in your own app, add SkinnedAabbDebugPlugin:
use bevy_mod_skinned_aabb::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins((
SkinnedAabbPlugin,
// Enable debug rendering.
SkinnedAabbDebugPlugin::enable_by_default(),
))
.run();
}
The debug rendering will be enabled by default. You can also leave it disabled by default but enable it with keyboard shortcuts:
use bevy_mod_skinned_aabb::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins((
SkinnedAabbPlugin,
// Add the debug rendering but leave it disabled by default.
SkinnedAabbDebugPlugin::disable_by_default(),
))
.add_systems(
Update,
(
// Press J to toggle joint AABBs.
toggle_draw_joint_aabbs.run_if(input_just_pressed(KeyCode::KeyJ)),
// Press M to toggle mesh AABBs.
toggle_draw_mesh_aabbs.run_if(input_just_pressed(KeyCode::KeyM)),
),
)
.run();
}