Mass properties: add a max number of iterations for the local-frame rotation computation.

This commit is contained in:
Sébastien Crozet
2020-09-01 17:35:32 +02:00
parent 2f2a073ce4
commit fc0b3bf394
3 changed files with 20 additions and 16 deletions

View File

@@ -228,7 +228,7 @@ impl PhysxWorld {
// Update mass properties.
for (rapier_handle, physx_handle) in rapier2physx.iter() {
let rb = &bodies[*rapier_handle];
if let Some(mut ra) = scene.get_dynamic_mut(*physx_handle) {
if let Some(rp) = scene.get_dynamic_mut(*physx_handle) {
let densities: Vec<_> = rb
.colliders()
.iter()
@@ -237,7 +237,7 @@ impl PhysxWorld {
unsafe {
physx_sys::PxRigidBodyExt_updateMassAndInertia_mut(
ra.as_ptr_mut().ptr as *mut physx_sys::PxRigidBody,
rp.as_ptr_mut().ptr as *mut physx_sys::PxRigidBody,
densities.as_ptr(),
densities.len() as u32,
std::ptr::null(),