set density/inertia for computed mesh

This commit is contained in:
yuni 2024-04-16 02:31:25 +02:00
parent cf34ab5a63
commit 830d371e36

View file

@ -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())