1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29



#[derive(Clone,Debug,Copy, Serialize, Deserialize)]
#[repr(u16)]
pub enum RigidBodyType{
    Active=0,
    Passive,
}

#[derive(Clone,Debug,Copy, Serialize, Deserialize)]
#[repr(u16)]
pub enum RigidBodyShape{
    Cuboid,
    Sphere,
    Capsule,
    Cylinder,
    Cone,
    ConvexHull,
    Mesh,
}

#[derive(Clone,Debug,Copy,Component, Serialize, Deserialize)]
#[repr(C)]
pub struct RigidBody{
    pub ty: RigidBodyType,
    pub shape: RigidBodyShape,
    pub friction: f32,
}