diff options
| author | Sébastien Crozet <developer@crozet.re> | 2021-07-30 10:54:25 +0200 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2021-07-30 11:09:15 +0200 |
| commit | 37a90a5409fc306981e925e4867922e8ee51c045 (patch) | |
| tree | c22cc7e450599f954a1d3e577dcb8cb6d194f5e2 /src | |
| parent | 729e510c001dcdfccff042155143be95883195a3 (diff) | |
| download | rapier-37a90a5409fc306981e925e4867922e8ee51c045.tar.gz rapier-37a90a5409fc306981e925e4867922e8ee51c045.tar.bz2 rapier-37a90a5409fc306981e925e4867922e8ee51c045.zip | |
Add missing comments.
Diffstat (limited to 'src')
| -rw-r--r-- | src/geometry/broad_phase_multi_sap/broad_phase_pair_event.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/geometry/broad_phase_multi_sap/broad_phase_pair_event.rs b/src/geometry/broad_phase_multi_sap/broad_phase_pair_event.rs index fdc9bfd..f72d1df 100644 --- a/src/geometry/broad_phase_multi_sap/broad_phase_pair_event.rs +++ b/src/geometry/broad_phase_multi_sap/broad_phase_pair_event.rs @@ -2,12 +2,16 @@ use crate::geometry::ColliderHandle; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] +/// A pair of collider handles. pub struct ColliderPair { + /// The handle of the first collider involved in this pair. pub collider1: ColliderHandle, + /// The handle of the second ocllider involved in this pair. pub collider2: ColliderHandle, } impl ColliderPair { + /// Creates a new pair of collider handles. pub fn new(collider1: ColliderHandle, collider2: ColliderHandle) -> Self { ColliderPair { collider1, @@ -15,10 +19,12 @@ impl ColliderPair { } } + /// Swaps the two collider handles in `self`. pub fn swap(self) -> Self { Self::new(self.collider2, self.collider1) } + /// Constructs a pair of artificial handles that are not guaranteed to be valid.. pub fn zero() -> Self { Self { collider1: ColliderHandle::from_raw_parts(0, 0), @@ -27,7 +33,10 @@ impl ColliderPair { } } +/// An event emitted by the broad-phase. pub enum BroadPhasePairEvent { + /// A potential new collision pair has been detected by the broad-phase. AddPair(ColliderPair), + /// The two colliders are guaranteed not to touch any more. DeletePair(ColliderPair), } |
