From d18bcf2fbcaf797c652ebe465dc8b475e94627fb Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 16 Jun 2023 12:44:08 +0700 Subject: [PATCH 1/6] doc: Fix rustdoc::bare_urls warnings. Bare URLs should be wrapped in `<...>` to turn them into links. --- src/transformation/ear_clipping.rs | 2 +- src/transformation/hertel_mehlhorn.rs | 4 ++-- src/transformation/vhacd/parameters.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/transformation/ear_clipping.rs b/src/transformation/ear_clipping.rs index 951550c9..faacc9cc 100644 --- a/src/transformation/ear_clipping.rs +++ b/src/transformation/ear_clipping.rs @@ -1,5 +1,5 @@ //! Ear-clipping algorithm for creating a triangle mesh from a simple polygon. -//! Based on https://github.com/ivanfratric/polypartition, contributed by embotech AG. +//! Based on , contributed by embotech AG. use crate::{ math::{Point, Real}, diff --git a/src/transformation/hertel_mehlhorn.rs b/src/transformation/hertel_mehlhorn.rs index 307c0d49..208b9193 100644 --- a/src/transformation/hertel_mehlhorn.rs +++ b/src/transformation/hertel_mehlhorn.rs @@ -1,5 +1,5 @@ //! Hertel-Mehlhorn algorithm for convex partitioning. -//! Based on https://github.com/ivanfratric/polypartition, contributed by embotech AG. +//! Based on , contributed by embotech AG. use crate::math::{Point, Real}; use crate::utils::point_in_triangle::{corner_direction, Orientation}; @@ -26,7 +26,7 @@ fn find_edge_index_in_polygon(p1: u32, p2: u32, indices: &[u32]) -> Option<(usiz /// polygons is created. However, in practice it works much better than that and often returns the optimal /// partitioning. /// -/// This algorithm is described in https://people.mpi-inf.mpg.de/~mehlhorn/ftp/FastTriangulation.pdf +/// This algorithm is described in . pub fn hertel_mehlhorn(vertices: &[Point], indices: &[[u32; 3]]) -> Vec>> { hertel_mehlhorn_idx(vertices, indices) .into_iter() diff --git a/src/transformation/vhacd/parameters.rs b/src/transformation/vhacd/parameters.rs index e97b4b4c..bb5dec92 100644 --- a/src/transformation/vhacd/parameters.rs +++ b/src/transformation/vhacd/parameters.rs @@ -3,7 +3,7 @@ use crate::transformation::voxelization::FillMode; /// Parameters controlling the VHACD convex decomposition. /// -/// See https://github.com/Unity-Technologies/VHACD#parameters for details. +/// See for details. #[derive(Debug, Clone, PartialEq)] pub struct VHACDParameters { /// Maximum concavity. From 046cce486304fa3c636d8aa405095fe619452add Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 16 Jun 2023 12:44:25 +0700 Subject: [PATCH 2/6] doc: Typo: height -> eight. Aabb splits into 8 parts (when `dim3` enabled). --- src/bounding_volume/aabb.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bounding_volume/aabb.rs b/src/bounding_volume/aabb.rs index 7cd321e3..9e8420a0 100644 --- a/src/bounding_volume/aabb.rs +++ b/src/bounding_volume/aabb.rs @@ -320,7 +320,7 @@ impl Aabb { ] } - /// Splits this Aabb at its center, into height parts (as in an octree). + /// Splits this Aabb at its center, into eight parts (as in an octree). #[inline] #[cfg(feature = "dim3")] pub fn split_at_center(&self) -> [Aabb; 8] { From 5a1b63dab6dd1373877f3bf1d3f513cbbc95de9f Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 16 Jun 2023 13:00:06 +0700 Subject: [PATCH 3/6] tests + doc: Typo: bellow -> below. --- crates/parry2d/tests/geometry/ray_cast.rs | 4 ++-- src/bounding_volume/aabb.rs | 4 ++-- src/partitioning/visitor.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/parry2d/tests/geometry/ray_cast.rs b/crates/parry2d/tests/geometry/ray_cast.rs index 57dcdc28..a040e361 100644 --- a/crates/parry2d/tests/geometry/ray_cast.rs +++ b/crates/parry2d/tests/geometry/ray_cast.rs @@ -34,7 +34,7 @@ fn collinear_raycast_starting_on_segment() { } #[test] -fn collinear_raycast_starting_bellow_segment() { +fn collinear_raycast_starting_below_segment() { let m1 = Isometry2::identity(); let ray = Ray::new(Point2::new(0.0, -2.0), Vector2::new(0.0, 1.0)); let seg = Segment::new(Point2::new(0.0, 1.0), Point2::new(0.0, -1.0)); @@ -84,7 +84,7 @@ fn perpendicular_raycast_starting_above_segment() { } #[test] -fn perpendicular_raycast_starting_bellow_segment() { +fn perpendicular_raycast_starting_below_segment() { let segment = Segment::new(Point2::new(0.0f32, -10.0), Point2::new(0.0, 10.0)); let ray = Ray::new(Point2::new(0.0, -11.0), Vector2::new(1.0, 0.0)); assert!(!segment.intersects_local_ray(&ray, std::f32::MAX)); diff --git a/src/bounding_volume/aabb.rs b/src/bounding_volume/aabb.rs index 9e8420a0..870ed6e7 100644 --- a/src/bounding_volume/aabb.rs +++ b/src/bounding_volume/aabb.rs @@ -40,7 +40,7 @@ impl Aabb { /// /// y 3 - 2 /// | 7 − 6 | - /// ___ x | | 1 (the zero is bellow 3 and on the left of 1, hidden by the 4-5-6-7 face.) + /// ___ x | | 1 (the zero is below 3 and on the left of 1, hidden by the 4-5-6-7 face.) /// / 4 - 5 /// z #[cfg(feature = "dim3")] @@ -68,7 +68,7 @@ impl Aabb { /// /// y 3 - 2 /// | 7 − 6 | - /// ___ x | | 1 (the zero is bellow 3 and on the left of 1, hidden by the 4-5-6-7 face.) + /// ___ x | | 1 (the zero is below 3 and on the left of 1, hidden by the 4-5-6-7 face.) /// / 4 - 5 /// z #[cfg(feature = "dim3")] diff --git a/src/partitioning/visitor.rs b/src/partitioning/visitor.rs index 17376ab7..3fd48be2 100644 --- a/src/partitioning/visitor.rs +++ b/src/partitioning/visitor.rs @@ -95,7 +95,7 @@ pub trait SimdSimultaneousVisitor { /* * - * Parallel visitors bellow. + * Parallel visitors below. * */ From 16a85ef59bbe3651be7ad2956a1af6d27c03ac92 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 16 Jun 2023 19:27:11 +0700 Subject: [PATCH 4/6] doc: Fix intra-doc links in query/mod.rs --- src/query/mod.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/query/mod.rs b/src/query/mod.rs index a256345d..f95dc1cf 100644 --- a/src/query/mod.rs +++ b/src/query/mod.rs @@ -3,17 +3,17 @@ //! # General cases //! The most general methods provided by this module are: //! -//! * [`query::closest_points()`] to compute the closest points between two shapes. -//! * [`query::distance()`] to compute the distance between two shapes. -//! * [`query::contact()`] to compute one pair of contact points between two shapes, including penetrating contact. -//! * [`query::intersection_test()`] to determine if two shapes are intersecting or not. -//! * [`query::time_of_impact()`] to determine when two shapes undergoing translational motions hit for the first time. -//! * [`query::nonlinear_time_of_impact()`] to determine when two shapes undergoing continuous rigid motions hit for the first time. +//! * [`closest_points()`] to compute the closest points between two shapes. +//! * [`distance()`] to compute the distance between two shapes. +//! * [`contact()`] to compute one pair of contact points between two shapes, including penetrating contact. +//! * [`intersection_test()`] to determine if two shapes are intersecting or not. +//! * [`time_of_impact()`] to determine when two shapes undergoing translational motions hit for the first time. +//! * [`nonlinear_time_of_impact()`] to determine when two shapes undergoing continuous rigid motions hit for the first time. //! //! Ray-casting and point-projection can be achieved by importing traits: //! -//! * [`query::RayCast`] for ray-casting. -//! * [`query::PointQuery`] for point projection. +//! * [`RayCast`] for ray-casting. +//! * [`PointQuery`] for point projection. //! //! # Specific cases //! The functions exported by the `details` submodule are more specific versions of the ones described above. From 4809ea523dd77ed329bb60775ea6a11e0beb3934 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Fri, 16 Jun 2023 19:27:38 +0700 Subject: [PATCH 5/6] doc: Fix layout of ASCII drawing in Aabb docs. --- src/bounding_volume/aabb.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/bounding_volume/aabb.rs b/src/bounding_volume/aabb.rs index 870ed6e7..041704b1 100644 --- a/src/bounding_volume/aabb.rs +++ b/src/bounding_volume/aabb.rs @@ -38,11 +38,13 @@ impl Aabb { /// Here is how the faces are numbered, assuming /// a right-handed coordinate system: /// + /// ```text /// y 3 - 2 /// | 7 − 6 | - /// ___ x | | 1 (the zero is below 3 and on the left of 1, hidden by the 4-5-6-7 face.) - /// / 4 - 5 + /// ___ x | | 1 (the zero is below 3 and on the left of 1, + /// / 4 - 5 hidden by the 4-5-6-7 face.) /// z + /// ``` #[cfg(feature = "dim3")] pub const EDGES_VERTEX_IDS: [(usize, usize); 12] = [ (0, 1), @@ -66,11 +68,13 @@ impl Aabb { /// Here is how the faces are numbered, assuming /// a right-handed coordinate system: /// + /// ```text /// y 3 - 2 /// | 7 − 6 | - /// ___ x | | 1 (the zero is below 3 and on the left of 1, hidden by the 4-5-6-7 face.) - /// / 4 - 5 + /// ___ x | | 1 (the zero is below 3 and on the left of 1, + /// / 4 - 5 hidden by the 4-5-6-7 face.) /// z + /// ``` #[cfg(feature = "dim3")] pub const FACES_VERTEX_IDS: [(usize, usize, usize, usize); 6] = [ (1, 2, 6, 5), From b9739587c9f858fd9b2d7dbef39ea1f5437ab6ed Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Sat, 5 Aug 2023 23:15:17 +0700 Subject: [PATCH 6/6] doc: Improve formatting and linking of `Aabb`. --- src/bounding_volume/aabb.rs | 50 +++++++++---------- src/bounding_volume/aabb_ball.rs | 4 +- src/bounding_volume/aabb_convex_polygon.rs | 4 +- src/bounding_volume/aabb_convex_polyhedron.rs | 4 +- src/bounding_volume/aabb_cuboid.rs | 4 +- src/bounding_volume/aabb_halfspace.rs | 4 +- src/bounding_volume/aabb_heightfield.rs | 4 +- src/bounding_volume/aabb_support_map.rs | 12 ++--- src/bounding_volume/aabb_triangle.rs | 4 +- src/bounding_volume/aabb_utils.rs | 8 +-- src/query/split/split_aabb.rs | 8 +-- src/shape/compound.rs | 2 +- src/shape/heightfield2.rs | 2 +- src/shape/heightfield3.rs | 2 +- src/shape/shape.rs | 6 +-- 15 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/bounding_volume/aabb.rs b/src/bounding_volume/aabb.rs index 041704b1..0e84bd04 100644 --- a/src/bounding_volume/aabb.rs +++ b/src/bounding_volume/aabb.rs @@ -31,9 +31,9 @@ pub struct Aabb { } impl Aabb { - /// The vertex indices of each edge of this Aabb. + /// The vertex indices of each edge of this `Aabb`. /// - /// This gives, for each edge of this Aabb, the indices of its + /// This gives, for each edge of this `Aabb`, the indices of its /// vertices when taken from the `self.vertices()` array. /// Here is how the faces are numbered, assuming /// a right-handed coordinate system: @@ -61,9 +61,9 @@ impl Aabb { (3, 7), ]; - /// The vertex indices of each face of this Aabb. + /// The vertex indices of each face of this `Aabb`. /// - /// This gives, for each face of this Aabb, the indices of its + /// This gives, for each face of this `Aabb`, the indices of its /// vertices when taken from the `self.vertices()` array. /// Here is how the faces are numbered, assuming /// a right-handed coordinate system: @@ -96,9 +96,9 @@ impl Aabb { Aabb { mins, maxs } } - /// Creates an invalid Aabb with `mins` components set to `Real::max_values` and `maxs`components set to `-Real::max_values`. + /// Creates an invalid `Aabb` with `mins` components set to `Real::max_values` and `maxs`components set to `-Real::max_values`. /// - /// This is often used as the initial values of some Aabb merging algorithms. + /// This is often used as the initial values of some `Aabb` merging algorithms. #[inline] pub fn new_invalid() -> Self { Self::new( @@ -107,13 +107,13 @@ impl Aabb { ) } - /// Creates a new Aabb from its center and its half-extents. + /// Creates a new `Aabb` from its center and its half-extents. #[inline] pub fn from_half_extents(center: Point, half_extents: Vector) -> Self { Self::new(center - half_extents, center + half_extents) } - /// Creates a new Aabb from a set of points. + /// Creates a new `Aabb` from a set of points. pub fn from_points<'a, I>(pts: I) -> Self where I: IntoIterator>, @@ -121,20 +121,20 @@ impl Aabb { super::aabb_utils::local_point_cloud_aabb(pts) } - /// The center of this Aabb. + /// The center of this `Aabb`. #[inline] pub fn center(&self) -> Point { na::center(&self.mins, &self.maxs) } - /// The half extents of this Aabb. + /// The half extents of this `Aabb`. #[inline] pub fn half_extents(&self) -> Vector { let half: Real = na::convert::(0.5); (self.maxs - self.mins) * half } - /// The volume of this Aabb. + /// The volume of this `Aabb`. #[inline] pub fn volume(&self) -> Real { let extents = self.extents(); @@ -144,19 +144,19 @@ impl Aabb { return extents.x * extents.y * extents.z; } - /// The extents of this Aabb. + /// The extents of this `Aabb`. #[inline] pub fn extents(&self) -> Vector { self.maxs - self.mins } - /// Enlarges this Aabb so it also contains the point `pt`. + /// Enlarges this `Aabb` so it also contains the point `pt`. pub fn take_point(&mut self, pt: Point) { self.mins = self.mins.coords.inf(&pt.coords).into(); self.maxs = self.maxs.coords.sup(&pt.coords).into(); } - /// Computes the Aabb bounding `self` transformed by `m`. + /// Computes the `Aabb` bounding `self` transformed by `m`. #[inline] pub fn transform_by(&self, m: &Isometry) -> Self { let ls_center = self.center(); @@ -176,7 +176,7 @@ impl Aabb { } } - /// The smallest bounding sphere containing this Aabb. + /// The smallest bounding sphere containing this `Aabb`. #[inline] pub fn bounding_sphere(&self) -> BoundingSphere { let center = self.center(); @@ -195,7 +195,7 @@ impl Aabb { true } - /// Computes the intersection of this Aabb and another one. + /// Computes the intersection of this `Aabb` and another one. pub fn intersection(&self, other: &Aabb) -> Option { let result = Aabb { mins: Point::from(self.mins.coords.sup(&other.mins.coords)), @@ -211,17 +211,17 @@ impl Aabb { Some(result) } - /// Returns the difference between this Aabb and `rhs`. + /// Returns the difference between this `Aabb` and `rhs`. /// - /// Removing another Aabb from `self` will result in zero, one, or up to 4 (in 2D) or 8 (in 3D) + /// Removing another `Aabb` from `self` will result in zero, one, or up to 4 (in 2D) or 8 (in 3D) /// new smaller Aabbs. pub fn difference(&self, rhs: &Aabb) -> ArrayVec { self.difference_with_cut_sequence(rhs).0 } - /// Returns the difference between this Aabb and `rhs`. + /// Returns the difference between this `Aabb` and `rhs`. /// - /// Removing another Aabb from `self` will result in zero, one, or up to 4 (in 2D) or 8 (in 3D) + /// Removing another `Aabb` from `self` will result in zero, one, or up to 4 (in 2D) or 8 (in 3D) /// new smaller Aabbs. /// /// # Return @@ -276,7 +276,7 @@ impl Aabb { (result, cut_sequence) } - /// Computes the vertices of this Aabb. + /// Computes the vertices of this `Aabb`. #[inline] #[cfg(feature = "dim2")] pub fn vertices(&self) -> [Point; 4] { @@ -288,7 +288,7 @@ impl Aabb { ] } - /// Computes the vertices of this Aabb. + /// Computes the vertices of this `Aabb`. #[inline] #[cfg(feature = "dim3")] pub fn vertices(&self) -> [Point; 8] { @@ -304,7 +304,7 @@ impl Aabb { ] } - /// Splits this Aabb at its center, into four parts (as in a quad-tree). + /// Splits this `Aabb` at its center, into four parts (as in a quad-tree). #[inline] #[cfg(feature = "dim2")] pub fn split_at_center(&self) -> [Aabb; 4] { @@ -324,7 +324,7 @@ impl Aabb { ] } - /// Splits this Aabb at its center, into eight parts (as in an octree). + /// Splits this `Aabb` at its center, into eight parts (as in an octree). #[inline] #[cfg(feature = "dim3")] pub fn split_at_center(&self) -> [Aabb; 8] { @@ -366,7 +366,7 @@ impl Aabb { ] } - /// Projects every point of Aabb on an arbitrary axis. + /// Projects every point of `Aabb` on an arbitrary axis. pub fn project_on_axis(&self, axis: &UnitVector) -> (Real, Real) { let cuboid = Cuboid::new(self.half_extents()); let shift = cuboid diff --git a/src/bounding_volume/aabb_ball.rs b/src/bounding_volume/aabb_ball.rs index 6d99cfc0..5d75021d 100644 --- a/src/bounding_volume/aabb_ball.rs +++ b/src/bounding_volume/aabb_ball.rs @@ -20,13 +20,13 @@ pub fn local_ball_aabb(radius: Real) -> Aabb { } impl Ball { - /// Computes the world-space Aabb of this ball transformed by `pos`. + /// Computes the world-space [`Aabb`] of this ball transformed by `pos`. #[inline] pub fn aabb(&self, pos: &Isometry) -> Aabb { ball_aabb(&Point::::from(pos.translation.vector), self.radius) } - /// Computes the local-space Aabb of this ball. + /// Computes the local-space [`Aabb`] of this ball. #[inline] pub fn local_aabb(&self) -> Aabb { local_ball_aabb(self.radius) diff --git a/src/bounding_volume/aabb_convex_polygon.rs b/src/bounding_volume/aabb_convex_polygon.rs index 0ef3e90b..521dfc75 100644 --- a/src/bounding_volume/aabb_convex_polygon.rs +++ b/src/bounding_volume/aabb_convex_polygon.rs @@ -3,13 +3,13 @@ use crate::math::{Isometry, Real}; use crate::shape::ConvexPolygon; impl ConvexPolygon { - /// Computes the world-space Aabb of this convex polygon, transformed by `pos`. + /// Computes the world-space [`Aabb`] of this convex polygon, transformed by `pos`. #[inline] pub fn aabb(&self, pos: &Isometry) -> Aabb { super::details::point_cloud_aabb(pos, self.points()) } - /// Computes the local-space Aabb of this convex polygon. + /// Computes the local-space [`Aabb`] of this convex polygon. #[inline] pub fn local_aabb(&self) -> Aabb { super::details::local_point_cloud_aabb(self.points()) diff --git a/src/bounding_volume/aabb_convex_polyhedron.rs b/src/bounding_volume/aabb_convex_polyhedron.rs index 35092fe9..790cee5e 100644 --- a/src/bounding_volume/aabb_convex_polyhedron.rs +++ b/src/bounding_volume/aabb_convex_polyhedron.rs @@ -3,13 +3,13 @@ use crate::math::{Isometry, Real}; use crate::shape::ConvexPolyhedron; impl ConvexPolyhedron { - /// Computes the world-space Aabb of this convex polyhedron, transformed by `pos`. + /// Computes the world-space [`Aabb`] of this convex polyhedron, transformed by `pos`. #[inline] pub fn aabb(&self, pos: &Isometry) -> Aabb { super::details::point_cloud_aabb(pos, self.points()) } - /// Computes the local-space Aabb of this convex polyhedron. + /// Computes the local-space [`Aabb`] of this convex polyhedron. #[inline] pub fn local_aabb(&self) -> Aabb { super::details::local_point_cloud_aabb(self.points()) diff --git a/src/bounding_volume/aabb_cuboid.rs b/src/bounding_volume/aabb_cuboid.rs index 097350e6..4bb2ebe2 100644 --- a/src/bounding_volume/aabb_cuboid.rs +++ b/src/bounding_volume/aabb_cuboid.rs @@ -4,7 +4,7 @@ use crate::shape::Cuboid; use crate::utils::IsometryOps; impl Cuboid { - /// Computes the world-space Aabb of this cuboid, transformed by `pos`. + /// Computes the world-space [`Aabb`] of this cuboid, transformed by `pos`. #[inline] pub fn aabb(&self, pos: &Isometry) -> Aabb { let center = Point::from(pos.translation.vector); @@ -13,7 +13,7 @@ impl Cuboid { Aabb::from_half_extents(center, ws_half_extents) } - /// Computes the local-space Aabb of this cuboid. + /// Computes the local-space [`Aabb`] of this cuboid. #[inline] pub fn local_aabb(&self) -> Aabb { let half_extents = Point::from(self.half_extents); diff --git a/src/bounding_volume/aabb_halfspace.rs b/src/bounding_volume/aabb_halfspace.rs index b4a5d029..017a04a0 100644 --- a/src/bounding_volume/aabb_halfspace.rs +++ b/src/bounding_volume/aabb_halfspace.rs @@ -5,13 +5,13 @@ use crate::shape::HalfSpace; use na; impl HalfSpace { - /// Computes the world-space Aabb of this half-space. + /// Computes the world-space [`Aabb`] of this half-space. #[inline] pub fn aabb(&self, _pos: &Isometry) -> Aabb { self.local_aabb() } - /// Computes the local-space Aabb of this half-space. + /// Computes the local-space [`Aabb`] of this half-space. #[inline] pub fn local_aabb(&self) -> Aabb { // We divide by 2.0 so that we can still make some operations with it (like loosening) diff --git a/src/bounding_volume/aabb_heightfield.rs b/src/bounding_volume/aabb_heightfield.rs index b3ec6ca2..67d6fe0a 100644 --- a/src/bounding_volume/aabb_heightfield.rs +++ b/src/bounding_volume/aabb_heightfield.rs @@ -3,13 +3,13 @@ use crate::math::{Isometry, Real}; use crate::shape::{GenericHeightField, HeightFieldStorage}; impl GenericHeightField { - /// Computes the world-space Aabb of this heightfield, transformed by `pos`. + /// Computes the world-space [`Aabb`] of this heightfield, transformed by `pos`. #[inline] pub fn aabb(&self, pos: &Isometry) -> Aabb { self.root_aabb().transform_by(pos) } - /// Computes the local-space Aabb of this heightfield. + /// Computes the local-space [`Aabb`] of this heightfield. #[inline] pub fn local_aabb(&self) -> Aabb { self.root_aabb().clone() diff --git a/src/bounding_volume/aabb_support_map.rs b/src/bounding_volume/aabb_support_map.rs index 57e04b92..754d8ff3 100644 --- a/src/bounding_volume/aabb_support_map.rs +++ b/src/bounding_volume/aabb_support_map.rs @@ -7,13 +7,13 @@ use crate::shape::{Cone, Cylinder}; #[cfg(feature = "dim3")] impl Cone { - /// Computes the world-space Aabb of this cone, transformed by `pos`. + /// Computes the world-space [`Aabb`] of this cone, transformed by `pos`. #[inline] pub fn aabb(&self, pos: &Isometry) -> Aabb { bounding_volume::details::support_map_aabb(pos, self) } - /// Computes the local-space Aabb of this cone. + /// Computes the local-space [`Aabb`] of this cone. #[inline] pub fn local_aabb(&self) -> Aabb { bounding_volume::details::local_support_map_aabb(self) @@ -22,13 +22,13 @@ impl Cone { #[cfg(feature = "dim3")] impl Cylinder { - /// Computes the world-space Aabb of this cylinder, transformed by `pos`. + /// Computes the world-space [`Aabb`] of this cylinder, transformed by `pos`. #[inline] pub fn aabb(&self, pos: &Isometry) -> Aabb { bounding_volume::details::support_map_aabb(pos, self) } - /// Computes the local-space Aabb of this cylinder. + /// Computes the local-space [`Aabb`] of this cylinder. #[inline] pub fn local_aabb(&self) -> Aabb { bounding_volume::details::local_support_map_aabb(self) @@ -36,13 +36,13 @@ impl Cylinder { } impl Segment { - /// Computes the world-space Aabb of this segment, transformed by `pos`. + /// Computes the world-space [`Aabb`] of this segment, transformed by `pos`. #[inline] pub fn aabb(&self, pos: &Isometry) -> Aabb { self.transformed(pos).local_aabb() } - /// Computes the local-space Aabb of this segment. + /// Computes the local-space [`Aabb`] of this segment. #[inline] pub fn local_aabb(&self) -> Aabb { bounding_volume::details::local_support_map_aabb(self) diff --git a/src/bounding_volume/aabb_triangle.rs b/src/bounding_volume/aabb_triangle.rs index 6963152f..1c8867c0 100644 --- a/src/bounding_volume/aabb_triangle.rs +++ b/src/bounding_volume/aabb_triangle.rs @@ -5,13 +5,13 @@ use crate::{ }; impl Triangle { - /// Computes the world-space Aabb of this triangle, transformed by `pos`. + /// Computes the world-space [`Aabb`] of this triangle, transformed by `pos`. #[inline] pub fn aabb(&self, pos: &Isometry) -> Aabb { self.transformed(pos).local_aabb() } - /// Computes the local-space Aabb of this triangle. + /// Computes the local-space [`Aabb`] of this triangle. #[inline] pub fn local_aabb(&self) -> Aabb { let a = self.a.coords; diff --git a/src/bounding_volume/aabb_utils.rs b/src/bounding_volume/aabb_utils.rs index 390f415e..07376b1a 100644 --- a/src/bounding_volume/aabb_utils.rs +++ b/src/bounding_volume/aabb_utils.rs @@ -5,7 +5,7 @@ use crate::math::{Isometry, Point, Real, Vector, DIM}; use crate::shape::SupportMap; use na; -/// Computes the Aabb of an support mapped shape. +/// Computes the [`Aabb`] of an [support mapped shape](SupportMap). #[cfg(feature = "dim3")] pub fn support_map_aabb(m: &Isometry, i: &G) -> Aabb where @@ -30,7 +30,7 @@ where Aabb::new(Point::from(min), Point::from(max)) } -/// Computes the Aabb of an support mapped shape. +/// Computes the [`Aabb`] of an [support mapped shape](SupportMap). pub fn local_support_map_aabb(i: &G) -> Aabb where G: SupportMap, @@ -54,7 +54,7 @@ where Aabb::new(Point::from(min), Point::from(max)) } -/// Computes the Aabb of a set of points transformed by `m`. +/// Computes the [`Aabb`] of a set of points transformed by `m`. pub fn point_cloud_aabb<'a, I>(m: &Isometry, pts: I) -> Aabb where I: IntoIterator>, @@ -77,7 +77,7 @@ where Aabb::new(min, max) } -/// Computes the Aabb of a set of points. +/// Computes the [`Aabb`] of a set of points. pub fn local_point_cloud_aabb<'a, I>(pts: I) -> Aabb where I: IntoIterator>, diff --git a/src/query/split/split_aabb.rs b/src/query/split/split_aabb.rs index d7ea6df9..9d23168c 100644 --- a/src/query/split/split_aabb.rs +++ b/src/query/split/split_aabb.rs @@ -3,15 +3,15 @@ use crate::math::Real; use crate::query::SplitResult; impl Aabb { - /// Splits this Aabb along the given canonical axis. + /// Splits this `Aabb` along the given canonical axis. /// - /// This will split the Aabb by a plane with a normal with it’s `axis`-th component set to 1. + /// This will split the `Aabb` by a plane with a normal with it’s `axis`-th component set to 1. /// The splitting plane is shifted wrt. the origin by the `bias` (i.e. it passes through the point /// equal to `normal * bias`). /// /// # Result - /// Returns the result of the split. The first Aabb returned is the piece lying on the negative - /// half-space delimited by the splitting plane. The second Aabb returned is the piece lying on the + /// Returns the result of the split. The first `Aabb` returned is the piece lying on the negative + /// half-space delimited by the splitting plane. The second `Aabb` returned is the piece lying on the /// positive half-space delimited by the splitting plane. pub fn canonical_split(&self, axis: usize, bias: Real, epsilon: Real) -> SplitResult { if self.mins[axis] >= bias - epsilon { diff --git a/src/shape/compound.rs b/src/shape/compound.rs index 9f665ce0..024fded9 100644 --- a/src/shape/compound.rs +++ b/src/shape/compound.rs @@ -96,7 +96,7 @@ impl Compound { &self.shapes[..] } - /// The Aabb of this compound in its local-space. + /// The [`Aabb`] of this compound in its local-space. #[inline] pub fn local_aabb(&self) -> &Aabb { &self.aabb diff --git a/src/shape/heightfield2.rs b/src/shape/heightfield2.rs index c9b4d66d..afa1f3bc 100644 --- a/src/shape/heightfield2.rs +++ b/src/shape/heightfield2.rs @@ -193,7 +193,7 @@ impl GenericHeightField { self } - /// The Aabb of this heightfield. + /// The [`Aabb`] of this heightfield. pub fn root_aabb(&self) -> &Aabb { &self.aabb } diff --git a/src/shape/heightfield3.rs b/src/shape/heightfield3.rs index 4c0d9b55..55e908e1 100644 --- a/src/shape/heightfield3.rs +++ b/src/shape/heightfield3.rs @@ -548,7 +548,7 @@ impl GenericHeightField { 1.0 / (self.heights.nrows() as Real - 1.0) } - /// The Aabb of this heightmap. + /// The [`Aabb`] of this heightmap. pub fn root_aabb(&self) -> &Aabb { &self.aabb } diff --git a/src/shape/shape.rs b/src/shape/shape.rs index 2af8c011..38dd1318 100644 --- a/src/shape/shape.rs +++ b/src/shape/shape.rs @@ -272,7 +272,7 @@ impl DeserializableTypedShape { /// Trait implemented by shapes usable by Rapier. pub trait Shape: RayCast + PointQuery + DowncastSync { - /// Computes the Aabb of this shape. + /// Computes the [`Aabb`] of this shape. fn compute_local_aabb(&self) -> Aabb; /// Computes the bounding-sphere of this shape. fn compute_local_bounding_sphere(&self) -> BoundingSphere; @@ -281,7 +281,7 @@ pub trait Shape: RayCast + PointQuery + DowncastSync { #[cfg(feature = "std")] fn clone_box(&self) -> Box; - /// Computes the Aabb of this shape with the given position. + /// Computes the [`Aabb`] of this shape with the given position. fn compute_aabb(&self, position: &Isometry) -> Aabb { self.compute_local_aabb().transform_by(position) } @@ -346,7 +346,7 @@ pub trait Shape: RayCast + PointQuery + DowncastSync { None } - /// Computes the swept Aabb of this shape, i.e., the space it would occupy by moving from + /// Computes the swept [`Aabb`] of this shape, i.e., the space it would occupy by moving from /// the given start position to the given end position. fn compute_swept_aabb(&self, start_pos: &Isometry, end_pos: &Isometry) -> Aabb { let aabb1 = self.compute_aabb(start_pos);