diff options
| author | Sébastien Crozet <developer@crozet.re> | 2022-07-10 09:41:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-10 09:41:57 +0200 |
| commit | ebb9473491858a4621dae7dd2f768fad49ad0ef2 (patch) | |
| tree | 0e247d21029c36a4775a7020dd59573a490accca /src_testbed/physx_backend.rs | |
| parent | 573affd73cf8f9d1c998f68535b5832a33c73848 (diff) | |
| parent | ee10a90f9bb2a1b3c045c41aeb7569123891e757 (diff) | |
| download | rapier-0.14.tar.gz rapier-0.14.tar.bz2 rapier-0.14.zip | |
Merge pull request #365 from dimforge/release-0.14v0.14
Release v0.14
Diffstat (limited to 'src_testbed/physx_backend.rs')
| -rw-r--r-- | src_testbed/physx_backend.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src_testbed/physx_backend.rs b/src_testbed/physx_backend.rs index 0a839b9..d4b2a75 100644 --- a/src_testbed/physx_backend.rs +++ b/src_testbed/physx_backend.rs @@ -78,10 +78,20 @@ impl IntoPhysx for Point3<f32> { } } +impl IntoPhysx for UnitQuaternion<f32> { + type Output = PxQuat; + fn into_physx(self) -> Self::Output { + PxQuat::new(self.i, self.j, self.k, self.w) + } +} + impl IntoPhysx for Isometry3<f32> { type Output = PxTransform; fn into_physx(self) -> Self::Output { - self.into_glam().into() + PxTransform::from_translation_rotation( + &self.translation.vector.into_physx(), + &self.rotation.into_physx(), + ) } } @@ -164,7 +174,7 @@ impl PhysxWorld { gravity: gravity.into_physx(), thread_count: num_threads as u32, broad_phase_type: BroadPhaseType::AutomaticBoxPruning, - solver_type: SolverType::PGS, + solver_type: SolverType::Pgs, friction_type, ccd_max_passes: integration_parameters.max_ccd_substeps as u32, ..SceneDescriptor::new(()) @@ -361,7 +371,7 @@ impl PhysxWorld { if rb.is_ccd_enabled() { physx_sys::PxRigidBody_setRigidBodyFlag_mut( actor, - RigidBodyFlag::EnableCCD as u32, + RigidBodyFlag::EnableCcd as u32, true, ); } |
