@@ -84,21 +84,16 @@ where
84
84
OA : AdvanceCallback < L , D > ,
85
85
{
86
86
unsafe {
87
- let ( collision_callback, collision_user_data) = on_collide
88
- . map ( OC :: into_cb_user_data)
89
- . unwrap_or ( ( None , null_mut ( ) ) ) ;
90
- let ( trigger_callback, trigger_user_data) = on_trigger
91
- . map ( OT :: into_cb_user_data)
92
- . unwrap_or ( ( None , null_mut ( ) ) ) ;
93
- let ( constraint_break_callback, constraint_break_user_data) = on_constraint_break
94
- . map ( OCB :: into_cb_user_data)
95
- . unwrap_or ( ( None , null_mut ( ) ) ) ;
96
- let ( wake_sleep_callback, wake_sleep_user_data) = on_wake_sleep
97
- . map ( OWS :: into_cb_user_data)
98
- . unwrap_or ( ( None , null_mut ( ) ) ) ;
99
- let ( advance_callback, advance_user_data) = on_advance
100
- . map ( OA :: into_cb_user_data)
101
- . unwrap_or ( ( None , null_mut ( ) ) ) ;
87
+ let ( collision_callback, collision_user_data) =
88
+ on_collide. map_or ( ( None , null_mut ( ) ) , OC :: into_cb_user_data) ;
89
+ let ( trigger_callback, trigger_user_data) =
90
+ on_trigger. map_or ( ( None , null_mut ( ) ) , OT :: into_cb_user_data) ;
91
+ let ( constraint_break_callback, constraint_break_user_data) =
92
+ on_constraint_break. map_or ( ( None , null_mut ( ) ) , OCB :: into_cb_user_data) ;
93
+ let ( wake_sleep_callback, wake_sleep_user_data) =
94
+ on_wake_sleep. map_or ( ( None , null_mut ( ) ) , OWS :: into_cb_user_data) ;
95
+ let ( advance_callback, advance_user_data) =
96
+ on_advance. map_or ( ( None , null_mut ( ) ) , OA :: into_cb_user_data) ;
102
97
103
98
Owner :: from_raw (
104
99
create_simulation_event_callbacks ( & SimulationEventCallbackInfo {
@@ -239,8 +234,8 @@ trait ConstraintBreakCallbackRaw: ConstraintBreakCallback {
239
234
}
240
235
}
241
236
242
- /// A trait for onWake() and onSleep() callbacks. Parametrized by the ArticulationLink,
243
- /// RigidStatic, and RigidDynamic types of the scene it is in.
237
+ /// A trait for ` onWake()` and ` onSleep()` callbacks. Parametrized by the [` ArticulationLink`] ,
238
+ /// [` RigidStatic`] , and [` RigidDynamic`] types of the scene it is in.
244
239
pub trait WakeSleepCallback < L : ArticulationLink , S : RigidStatic , D : RigidDynamic > : Sized {
245
240
fn on_wake_sleep ( & mut self , actors : & [ & ActorMap < L , S , D > ] , is_waking : bool ) ;
246
241
}
@@ -282,10 +277,10 @@ where
282
277
}
283
278
284
279
/// A trait for the Advance Callback. onAdvance() is called during simulation, so it must
285
- /// be thread safe, and `self` is not mutable. Parametrized by the ArticulationLink
286
- /// and RigidDynamic types of the scene it is in.
280
+ /// be thread safe, and `self` is not mutable. Parametrized by the ` ArticulationLink`
281
+ /// and ` RigidDynamic` types of the scene it is in.
287
282
pub trait AdvanceCallback < L : ArticulationLink , D : RigidDynamic > : Sized {
288
- /// All actors with PxRigidBodyFlag::eENABLE_POSE_INTEGRATION_PREVIEW set will be passed into here
283
+ /// All actors with ` PxRigidBodyFlag::eENABLE_POSE_INTEGRATION_PREVIEW` set will be passed into here
289
284
/// once the simulate call has updated their position.
290
285
fn on_advance ( & self , actors : & [ & RigidBodyMap < L , D > ] , transforms : & [ PxTransform ] ) ;
291
286
}
0 commit comments