diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-02-19 15:21:25 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2021-02-19 15:21:25 +0100 |
| commit | e9f17f32e8dda4b97d2eb7b2118b7373d0c554d0 (patch) | |
| tree | f20df00536634b840d5a9af5e2a040dd86b7306a /src_testbed | |
| parent | a1ddda5077811e07b1f6d067969d692eafa32577 (diff) | |
| download | rapier-e9f17f32e8dda4b97d2eb7b2118b7373d0c554d0.tar.gz rapier-e9f17f32e8dda4b97d2eb7b2118b7373d0c554d0.tar.bz2 rapier-e9f17f32e8dda4b97d2eb7b2118b7373d0c554d0.zip | |
Complete the implementation of non-simd joint motor for the revolute joint.
Diffstat (limited to 'src_testbed')
| -rw-r--r-- | src_testbed/nphysics_backend.rs | 11 | ||||
| -rw-r--r-- | src_testbed/physx_backend.rs | 27 |
2 files changed, 25 insertions, 13 deletions
diff --git a/src_testbed/nphysics_backend.rs b/src_testbed/nphysics_backend.rs index cce56e8..698e255 100644 --- a/src_testbed/nphysics_backend.rs +++ b/src_testbed/nphysics_backend.rs @@ -121,12 +121,11 @@ impl NPhysicsWorld { } nphysics_joints.insert(c); - } - JointParams::GenericJoint(_) => { - eprintln!( - "Joint type currently unsupported by the nphysics backend: GenericJoint." - ) - } + } // JointParams::GenericJoint(_) => { + // eprintln!( + // "Joint type currently unsupported by the nphysics backend: GenericJoint." + // ) + // } } } diff --git a/src_testbed/physx_backend.rs b/src_testbed/physx_backend.rs index 011a450..f2a4f8a 100644 --- a/src_testbed/physx_backend.rs +++ b/src_testbed/physx_backend.rs @@ -344,13 +344,27 @@ impl PhysxWorld { .into_physx() .into(); - physx_sys::phys_PxRevoluteJointCreate( + let revolute_joint = physx_sys::phys_PxRevoluteJointCreate( physics.as_mut_ptr(), actor1, &frame1 as *const _, actor2, &frame2 as *const _, ); + + physx_sys::PxRevoluteJoint_setDriveVelocity_mut( + revolute_joint, + params.motor_target_vel, + true, + ); + + if params.motor_damping != 0.0 { + physx_sys::PxRevoluteJoint_setRevoluteJointFlag_mut( + revolute_joint, + physx_sys::PxRevoluteJointFlag::eDRIVE_ENABLED, + true, + ); + } } JointParams::PrismaticJoint(params) => { @@ -420,12 +434,11 @@ impl PhysxWorld { actor2, &frame2 as *const _, ); - } - JointParams::GenericJoint(_) => { - eprintln!( - "Joint type currently unsupported by the nphysics backend: GenericJoint." - ) - } + } // JointParams::GenericJoint(_) => { + // eprintln!( + // "Joint type currently unsupported by the PhysX backend: GenericJoint." + // ) + // } } } } |
