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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use na::{self, Real};
pub struct IntegrationParameters<N: Real> {
pub dt: N,
pub erp: N,
pub warmstart_coeff: N,
pub restitution_velocity_threshold: N,
pub allowed_linear_error: N,
pub allowed_angular_error: N,
pub max_linear_correction: N,
pub max_angular_correction: N,
pub max_stabilization_multiplier: N,
pub max_velocity_iterations: usize,
pub max_position_iterations: usize,
}
impl<N: Real> IntegrationParameters<N> {
pub fn new(
dt: N,
erp: N,
warmstart_coeff: N,
restitution_velocity_threshold: N,
allowed_linear_error: N,
allowed_angular_error: N,
max_linear_correction: N,
max_angular_correction: N,
max_stabilization_multiplier: N,
max_velocity_iterations: usize,
max_position_iterations: usize,
) -> Self {
IntegrationParameters {
dt,
erp,
warmstart_coeff,
restitution_velocity_threshold,
allowed_linear_error,
allowed_angular_error,
max_linear_correction,
max_angular_correction,
max_stabilization_multiplier,
max_velocity_iterations,
max_position_iterations,
}
}
}
impl<N: Real> Default for IntegrationParameters<N> {
fn default() -> Self {
Self::new(
na::convert(1.0 / 60.0),
na::convert(0.2),
na::convert(1.0),
na::convert(1.0),
na::convert(0.001),
na::convert(0.001),
na::convert(100.0),
na::convert(0.2),
na::convert(0.2),
8,
3,
)
}
}