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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
pub use self::generic_joint::*;
pub use self::joint::*;
pub use self::rigid_body::*;
pub use self::fixed_joint::*;
pub use self::prismatic_joint::*;
pub use self::revolute_joint::*;
use bevy::reflect::{FromReflect, Reflect};
use rapier::dynamics::CoefficientCombineRule as RapierCoefficientCombineRule;
#[cfg(feature = "dim3")]
pub use self::spherical_joint::*;
mod generic_joint;
mod joint;
mod rigid_body;
mod fixed_joint;
mod prismatic_joint;
mod revolute_joint;
#[cfg(feature = "dim3")]
mod spherical_joint;
#[derive(Copy, Clone, Debug, PartialEq, Eq, Reflect, FromReflect)]
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
pub enum CoefficientCombineRule {
Average = 0,
Min,
Multiply,
Max,
}
impl Default for CoefficientCombineRule {
fn default() -> Self {
CoefficientCombineRule::Average
}
}
impl From<CoefficientCombineRule> for RapierCoefficientCombineRule {
fn from(combine_rule: CoefficientCombineRule) -> RapierCoefficientCombineRule {
match combine_rule {
CoefficientCombineRule::Average => RapierCoefficientCombineRule::Average,
CoefficientCombineRule::Min => RapierCoefficientCombineRule::Min,
CoefficientCombineRule::Multiply => RapierCoefficientCombineRule::Multiply,
CoefficientCombineRule::Max => RapierCoefficientCombineRule::Max,
}
}
}