|
1 | | -use bevy::{ |
2 | | - ecs::{entity::Entity, system::Commands}, |
3 | | - math::Isometry3d, |
4 | | - platform::collections::HashMap, |
5 | | - prelude::default, |
6 | | - reflect::Reflect, |
7 | | - transform::components::Transform, |
8 | | -}; |
| 1 | +use bevy::{ecs::entity::Entity, platform::collections::HashMap, reflect::Reflect}; |
| 2 | +#[cfg(feature = "physics_avian")] |
| 3 | +use bevy::{ecs::system::Commands, math::Isometry3d}; |
9 | 4 |
|
10 | | -use crate::core::ragdoll::definition::{BodyId, ColliderId, JointId, JointVariant, Ragdoll}; |
| 5 | +#[cfg(feature = "physics_avian")] |
| 6 | +use crate::core::ragdoll::definition::Ragdoll; |
| 7 | +use crate::core::ragdoll::definition::{BodyId, ColliderId, JointId}; |
11 | 8 |
|
12 | 9 | #[derive(Reflect)] |
13 | 10 | pub struct SpawnedRagdoll { |
@@ -36,7 +33,7 @@ pub fn spawn_ragdoll_avian( |
36 | 33 | commands: &mut Commands, |
37 | 34 | ) -> SpawnedRagdoll { |
38 | 35 | use avian3d::prelude::{AngleLimit, CollisionLayers, RevoluteJoint, RigidBody, SphericalJoint}; |
39 | | - use bevy::ecs::name::Name; |
| 36 | + use bevy::{ecs::name::Name, transform::components::Transform, utils::default}; |
40 | 37 |
|
41 | 38 | let root = commands |
42 | 39 | .spawn(( |
@@ -103,7 +100,7 @@ pub fn spawn_ragdoll_avian( |
103 | 100 | } |
104 | 101 |
|
105 | 102 | for joint in ragdoll.joints.values() { |
106 | | - use crate::core::ragdoll::definition::JointLabel; |
| 103 | + use crate::core::ragdoll::definition::{JointLabel, JointVariant}; |
107 | 104 |
|
108 | 105 | let joint_entity = match &joint.variant { |
109 | 106 | JointVariant::Spherical(spherical_joint) => { |
|
0 commit comments