Skip to content

Commit 7273183

Browse files
committed
[fix] documentation.
1 parent c0f17be commit 7273183

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

crates/lambda-rs-platform/src/physics/rapier2d.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,8 +1298,8 @@ impl PhysicsBackend2D {
12981298
/// duplicates for compound bodies.
12991299
///
13001300
/// # Returns
1301-
/// Returns `()` after appending any newly-started events to the backend
1302-
/// queue.
1301+
/// Returns `()` after appending any newly-started or newly-ended events to
1302+
/// the backend queue.
13031303
fn collect_collision_events_2d(&mut self) {
13041304
let mut current_body_pair_contacts: HashMap<
13051305
BodyPairKey2D,
@@ -1833,14 +1833,16 @@ fn validate_velocity(x: f32, y: f32) -> Result<(), RigidBody2DBackendError> {
18331833

18341834
/// Normalizes a finite 2D query vector.
18351835
///
1836+
/// Query directions are normalized inside the backend so geometric helpers can
1837+
/// treat Rapier's `time_of_impact` as world-space distance. Keeping that
1838+
/// normalization in one helper avoids subtle drift between different query
1839+
/// paths and keeps zero-length rejection consistent.
1840+
///
18361841
/// # Arguments
18371842
/// - `vector`: The vector to normalize.
18381843
///
18391844
/// # Returns
18401845
/// Returns the normalized vector when the input has non-zero finite length.
1841-
///
1842-
/// Ray queries normalize directions so Rapier's `time_of_impact` value matches
1843-
/// the world-space travel distance expected by the public API.
18441846
fn normalize_query_vector_2d(vector: [f32; 2]) -> Option<[f32; 2]> {
18451847
let length = vector[0].hypot(vector[1]);
18461848

0 commit comments

Comments
 (0)