@@ -28,6 +28,8 @@ pub enum Command {
28
28
GetBasePositionAndOrientation ( RigidBodyHandle ) ,
29
29
ResetBasePositionAndOrientation ( RigidBodyHandle , Point3 < f64 > , Vector4 < f64 > ) ,
30
30
31
+ ResetBaseVelocity ( RigidBodyHandle , Option < Vector3 < f64 > > , Option < Vector3 < f64 > > ) ,
32
+
31
33
SetAngularFactor ( RigidBodyHandle , Vector3 < f64 > ) ,
32
34
33
35
ApplyCentralImpulse ( RigidBodyHandle , Vector3 < f64 > ) ,
@@ -118,7 +120,7 @@ impl Command {
118
120
) ;
119
121
}
120
122
121
- // with USE_MAXIMAL_COORDINATES physics client creates btRigidBody instead of btMultiBody
123
+ // with USE_MAXIMAL_COORDINATES physics client creates btRigidBody instead of btMultiBody
122
124
unsafe {
123
125
:: sys:: b3CreateMultiBodyUseMaximalCoordinates ( command) ;
124
126
}
@@ -253,6 +255,23 @@ impl Command {
253
255
CommandHandle { handle : command }
254
256
}
255
257
258
+ & Command :: ResetBaseVelocity ( ref body, lin_vel_opt, ang_vel_opt) => {
259
+ let command = unsafe { :: sys:: b3CreatePoseCommandInit ( client. handle , body. unique_id ) } ;
260
+ if let Some ( lin_vel) = lin_vel_opt {
261
+ let mut lin_vel_arr: [ f64 ; 3 ] = lin_vel. into ( ) ;
262
+ unsafe {
263
+ :: sys:: b3CreatePoseCommandSetBaseLinearVelocity ( command, lin_vel_arr. as_mut_ptr ( ) ) ;
264
+ }
265
+ }
266
+ if let Some ( ang_vel) = ang_vel_opt {
267
+ let mut ang_vel_arr: [ f64 ; 3 ] = ang_vel. into ( ) ;
268
+ unsafe {
269
+ :: sys:: b3CreatePoseCommandSetBaseAngularVelocity ( command, ang_vel_arr. as_mut_ptr ( ) ) ;
270
+ }
271
+ }
272
+ CommandHandle { handle : command }
273
+ }
274
+
256
275
& Command :: SetAngularFactor ( ref body, factor) => {
257
276
let mut factor: [ f64 ; 3 ] = factor. into ( ) ;
258
277
let command = unsafe {
0 commit comments