@@ -978,6 +978,8 @@ pub struct RigidBodyActivation {
978978 pub linear_threshold : Real ,
979979 /// The angular linear velocity bellow which the body can fall asleep.
980980 pub angular_threshold : Real ,
981+ /// The amount of time the rigid-body must remain below the thresholds to be put to sleep.
982+ pub time_until_sleep : Real ,
981983 /// Since how much time can this body sleep?
982984 pub time_since_can_sleep : Real ,
983985 /// Is this body sleeping?
@@ -1012,6 +1014,7 @@ impl RigidBodyActivation {
10121014 RigidBodyActivation {
10131015 linear_threshold : Self :: default_linear_threshold ( ) ,
10141016 angular_threshold : Self :: default_angular_threshold ( ) ,
1017+ time_until_sleep : Self :: default_time_until_sleep ( ) ,
10151018 time_since_can_sleep : 0.0 ,
10161019 sleeping : false ,
10171020 }
@@ -1022,8 +1025,9 @@ impl RigidBodyActivation {
10221025 RigidBodyActivation {
10231026 linear_threshold : Self :: default_linear_threshold ( ) ,
10241027 angular_threshold : Self :: default_angular_threshold ( ) ,
1025- sleeping : true ,
1028+ time_until_sleep : Self :: default_time_until_sleep ( ) ,
10261029 time_since_can_sleep : Self :: default_time_until_sleep ( ) ,
1030+ sleeping : true ,
10271031 }
10281032 }
10291033
@@ -1055,6 +1059,6 @@ impl RigidBodyActivation {
10551059 #[ inline]
10561060 pub fn sleep ( & mut self ) {
10571061 self . sleeping = true ;
1058- self . time_since_can_sleep = Self :: default_time_until_sleep ( ) ;
1062+ self . time_since_can_sleep = self . time_until_sleep ;
10591063 }
10601064}
0 commit comments