aboutsummaryrefslogtreecommitdiff
path: root/src/geometry
diff options
context:
space:
mode:
authorSébastien Crozet <sebcrozet@dimforge.com>2024-04-28 15:53:49 +0200
committerSébastien Crozet <sebastien@crozet.re>2024-04-30 23:10:46 +0200
commit929aa6b9259b95d48cf6a84df40486132b21f088 (patch)
treed50e3f483154ef33226eb2de25c5a54ff898d52f /src/geometry
parent97f7c1b4b22c5ea29f5a34b5d02563dca4b0da35 (diff)
downloadrapier-929aa6b9259b95d48cf6a84df40486132b21f088.tar.gz
rapier-929aa6b9259b95d48cf6a84df40486132b21f088.tar.bz2
rapier-929aa6b9259b95d48cf6a84df40486132b21f088.zip
feat: rename collision_skin to contact_skin
Diffstat (limited to 'src/geometry')
-rw-r--r--src/geometry/broad_phase_multi_sap/broad_phase_multi_sap.rs2
-rw-r--r--src/geometry/collider.rs30
-rw-r--r--src/geometry/contact_pair.rs2
-rw-r--r--src/geometry/narrow_phase.rs8
4 files changed, 21 insertions, 21 deletions
diff --git a/src/geometry/broad_phase_multi_sap/broad_phase_multi_sap.rs b/src/geometry/broad_phase_multi_sap/broad_phase_multi_sap.rs
index d20ed31..0fa499f 100644
--- a/src/geometry/broad_phase_multi_sap/broad_phase_multi_sap.rs
+++ b/src/geometry/broad_phase_multi_sap/broad_phase_multi_sap.rs
@@ -362,7 +362,7 @@ impl BroadPhaseMultiSap {
let next_aabb = collider
.shape
.compute_aabb(next_position)
- .loosened(collider.collision_skin() + prediction_distance / 2.0);
+ .loosened(collider.contact_skin() + prediction_distance / 2.0);
aabb.merge(&next_aabb);
}
diff --git a/src/geometry/collider.rs b/src/geometry/collider.rs
index 617881a..e02b0f2 100644
--- a/src/geometry/collider.rs
+++ b/src/geometry/collider.rs
@@ -30,7 +30,7 @@ pub struct Collider {
pub(crate) material: ColliderMaterial,
pub(crate) flags: ColliderFlags,
pub(crate) bf_data: ColliderBroadPhaseData,
- collision_skin: Real,
+ contact_skin: Real,
contact_force_event_threshold: Real,
/// User-defined data associated to this collider.
pub user_data: u128,
@@ -110,7 +110,7 @@ impl Collider {
bf_data: _bf_data, // Internal ids must not be overwritten.
contact_force_event_threshold,
user_data,
- collision_skin,
+ contact_skin,
} = other;
if self.parent.is_none() {
@@ -125,7 +125,7 @@ impl Collider {
self.user_data = *user_data;
self.flags = *flags;
self.changes = ColliderChanges::all();
- self.collision_skin = *collision_skin;
+ self.contact_skin = *contact_skin;
}
/// The physics hooks enabled for this collider.
@@ -159,13 +159,13 @@ impl Collider {
}
/// The collision skin of this collider.
- pub fn collision_skin(&self) -> Real {
- self.collision_skin
+ pub fn contact_skin(&self) -> Real {
+ self.contact_skin
}
/// Sets the collision skin of this collider.
- pub fn set_collision_skin(&mut self, skin_thickness: Real) {
- self.collision_skin = skin_thickness;
+ pub fn set_contact_skin(&mut self, skin_thickness: Real) {
+ self.contact_skin = skin_thickness;
}
/// The friction coefficient of this collider.
@@ -452,17 +452,17 @@ impl Collider {
/// Compute the axis-aligned bounding box of this collider.
///
/// This AABB doesn’t take into account the collider’s collision skin.
- /// [`Collider::collision_skin`].
+ /// [`Collider::contact_skin`].
pub fn compute_aabb(&self) -> Aabb {
self.shape.compute_aabb(&self.pos)
}
/// Compute the axis-aligned bounding box of this collider, taking into account the
- /// [`Collider::collision_skin`] and prediction distance.
+ /// [`Collider::contact_skin`] and prediction distance.
pub fn compute_collision_aabb(&self, prediction: Real) -> Aabb {
self.shape
.compute_aabb(&self.pos)
- .loosened(self.collision_skin + prediction)
+ .loosened(self.contact_skin + prediction)
}
/// Compute the axis-aligned bounding box of this collider moving from its current position
@@ -520,7 +520,7 @@ pub struct ColliderBuilder {
/// The total force magnitude beyond which a contact force event can be emitted.
pub contact_force_event_threshold: Real,
/// An extract thickness around the collider shape to keep them further apart when in collision.
- pub collision_skin: Real,
+ pub contact_skin: Real,
}
impl ColliderBuilder {
@@ -543,7 +543,7 @@ impl ColliderBuilder {
active_events: ActiveEvents::empty(),
enabled: true,
contact_force_event_threshold: 0.0,
- collision_skin: 0.0,
+ contact_skin: 0.0,
}
}
@@ -982,8 +982,8 @@ impl ColliderBuilder {
/// it creates a small gap between colliding object (equal to the sum of their skin). If the
/// skin is sufficiently small, this might not be visually significant or can be hidden by the
/// rendering assets.
- pub fn collision_skin(mut self, skin_thickness: Real) -> Self {
- self.collision_skin = skin_thickness;
+ pub fn contact_skin(mut self, skin_thickness: Real) -> Self {
+ self.contact_skin = skin_thickness;
self
}
@@ -1034,7 +1034,7 @@ impl ColliderBuilder {
flags,
coll_type,
contact_force_event_threshold: self.contact_force_event_threshold,
- collision_skin: self.collision_skin,
+ contact_skin: self.contact_skin,
user_data: self.user_data,
}
}
diff --git a/src/geometry/contact_pair.rs b/src/geometry/contact_pair.rs
index 55fec2b..ee3a6ac 100644
--- a/src/geometry/contact_pair.rs
+++ b/src/geometry/contact_pair.rs
@@ -117,7 +117,7 @@ pub struct ContactPair {
///
/// All contact manifold contain themselves contact points between the colliders.
/// Note that contact points in the contact manifold do not take into account the
- /// [`Collider::collision_skin`] which only affects the constraint solver and the
+ /// [`Collider::contact_skin`] which only affects the constraint solver and the
/// [`SolverContact`].
pub manifolds: Vec<ContactManifold>,
/// Is there any active contact in this contact pair?
diff --git a/src/geometry/narrow_phase.rs b/src/geometry/narrow_phase.rs
index bd2256b..9b0e1d3 100644
--- a/src/geometry/narrow_phase.rs
+++ b/src/geometry/narrow_phase.rs
@@ -898,7 +898,7 @@ impl NarrowPhase {
let pos12 = co1.pos.inv_mul(&co2.pos);
- let collision_skin_sum = co1.collision_skin() + co2.collision_skin();
+ let contact_skin_sum = co1.contact_skin() + co2.contact_skin();
let soft_ccd_prediction1 = rb1.map(|rb| rb.soft_ccd_prediction()).unwrap_or(0.0);
let soft_ccd_prediction2 = rb2.map(|rb| rb.soft_ccd_prediction()).unwrap_or(0.0);
let effective_prediction_distance = if soft_ccd_prediction1 > 0.0 || soft_ccd_prediction2 > 0.0 {
@@ -918,9 +918,9 @@ impl NarrowPhase {
prediction_distance.max(
- dt * (linvel1 - linvel2).norm()) + collision_skin_sum
+ dt * (linvel1 - linvel2).norm()) + contact_skin_sum
} else {
- prediction_distance + collision_skin_sum
+ prediction_distance + contact_skin_sum
};
let _ = query_dispatcher.contact_manifolds(
@@ -969,7 +969,7 @@ impl NarrowPhase {
break;
}
- let effective_contact_dist = contact.dist - co1.collision_skin() - co2.collision_skin();
+ let effective_contact_dist = contact.dist - co1.contact_skin() - co2.contact_skin();
let keep_solver_contact = effective_contact_dist < prediction_distance || {
let world_pt1 = world_pos1 * contact.local_p1;