diff options
| author | Crozet Sébastien <developer@crozet.re> | 2020-10-27 09:20:40 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2020-10-27 09:20:44 +0100 |
| commit | 8c872dc0af9ece127a87b4adb112b0e1ed6ab249 (patch) | |
| tree | 309c79a7cf538e47218c92a90784bd1a2c3c04d7 /src/geometry/contact_generator | |
| parent | dbdd797d5934ee76b0358b6cf845575ce0ef29af (diff) | |
| download | rapier-8c872dc0af9ece127a87b4adb112b0e1ed6ab249.tar.gz rapier-8c872dc0af9ece127a87b4adb112b0e1ed6ab249.tar.bz2 rapier-8c872dc0af9ece127a87b4adb112b0e1ed6ab249.zip | |
Replace the Rounded<S> type by a non-generic RoundCylinder type.
Diffstat (limited to 'src/geometry/contact_generator')
| -rw-r--r-- | src/geometry/contact_generator/pfm_pfm_contact_generator.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/geometry/contact_generator/pfm_pfm_contact_generator.rs b/src/geometry/contact_generator/pfm_pfm_contact_generator.rs index 62a38ae..1dcae33 100644 --- a/src/geometry/contact_generator/pfm_pfm_contact_generator.rs +++ b/src/geometry/contact_generator/pfm_pfm_contact_generator.rs @@ -24,11 +24,11 @@ impl Default for PfmPfmContactManifoldGeneratorWorkspace { } pub fn generate_contacts_pfm_pfm(ctxt: &mut PrimitiveContactGenerationContext) { - if let (Some((pfm1, round_radius1)), Some((pfm2, round_radius2))) = ( + if let (Some((pfm1, border_radius1)), Some((pfm2, border_radius2))) = ( ctxt.shape1.as_polygonal_feature_map(), ctxt.shape2.as_polygonal_feature_map(), ) { - do_generate_contacts(pfm1, round_radius1, pfm2, round_radius2, ctxt); + do_generate_contacts(pfm1, border_radius1, pfm2, border_radius2, ctxt); ctxt.manifold.update_warmstart_multiplier(); ctxt.manifold.sort_contacts(ctxt.prediction_distance); } @@ -36,9 +36,9 @@ pub fn generate_contacts_pfm_pfm(ctxt: &mut PrimitiveContactGenerationContext) { fn do_generate_contacts( pfm1: &dyn PolygonalFeatureMap, - round_radius1: f32, + border_radius1: f32, pfm2: &dyn PolygonalFeatureMap, - round_radius2: f32, + border_radius2: f32, ctxt: &mut PrimitiveContactGenerationContext, ) { let pos12 = ctxt.position1.inverse() * ctxt.position2; @@ -61,7 +61,7 @@ fn do_generate_contacts( .downcast_mut() .expect("Invalid workspace type, expected a PfmPfmContactManifoldGeneratorWorkspace."); - let total_prediction = ctxt.prediction_distance + round_radius1 + round_radius2; + let total_prediction = ctxt.prediction_distance + border_radius1 + border_radius2; let contact = query::contact_support_map_support_map_with_params( &Isometry::identity(), pfm1, @@ -93,11 +93,11 @@ fn do_generate_contacts( ctxt.manifold, ); - if round_radius1 != 0.0 || round_radius2 != 0.0 { + if border_radius1 != 0.0 || border_radius2 != 0.0 { for contact in &mut ctxt.manifold.points { - contact.local_p1 += *normal1 * round_radius1; - contact.local_p2 += *normal2 * round_radius2; - contact.dist -= round_radius1 + round_radius2; + contact.local_p1 += *normal1 * border_radius1; + contact.local_p2 += *normal2 * border_radius2; + contact.dist -= border_radius1 + border_radius2; } } |
