From 830d371e36ac05a64289793028f1630fa3176ac8 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 16 Apr 2024 02:31:25 +0200 Subject: [PATCH] set density/inertia for computed mesh --- src/commands.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/commands.rs b/src/commands.rs index 0450627..4f704b4 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -482,6 +482,8 @@ fn spawn_entities( actor.insert(AngularVelocity(state.angular_momentum)); actor.insert(ColliderDensity(state.density)); if state.collider_is_mesh { + actor.insert(MassPropertiesBundle::new_computed( + &Collider::sphere(0.5 * state.model_scale as f64), state.density)); actor.insert(AsyncSceneCollider::new(Some( ComputedCollider::TriMesh //ComputedCollider::ConvexDecomposition(VHACDParameters::default())