Skip to content

Commit b973958

Browse files
doc: Improve formatting and linking of Aabb.
1 parent 4809ea5 commit b973958

15 files changed

+59
-59
lines changed

src/bounding_volume/aabb.rs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ pub struct Aabb {
3131
}
3232

3333
impl Aabb {
34-
/// The vertex indices of each edge of this Aabb.
34+
/// The vertex indices of each edge of this `Aabb`.
3535
///
36-
/// This gives, for each edge of this Aabb, the indices of its
36+
/// This gives, for each edge of this `Aabb`, the indices of its
3737
/// vertices when taken from the `self.vertices()` array.
3838
/// Here is how the faces are numbered, assuming
3939
/// a right-handed coordinate system:
@@ -61,9 +61,9 @@ impl Aabb {
6161
(3, 7),
6262
];
6363

64-
/// The vertex indices of each face of this Aabb.
64+
/// The vertex indices of each face of this `Aabb`.
6565
///
66-
/// This gives, for each face of this Aabb, the indices of its
66+
/// This gives, for each face of this `Aabb`, the indices of its
6767
/// vertices when taken from the `self.vertices()` array.
6868
/// Here is how the faces are numbered, assuming
6969
/// a right-handed coordinate system:
@@ -96,9 +96,9 @@ impl Aabb {
9696
Aabb { mins, maxs }
9797
}
9898

99-
/// Creates an invalid Aabb with `mins` components set to `Real::max_values` and `maxs`components set to `-Real::max_values`.
99+
/// Creates an invalid `Aabb` with `mins` components set to `Real::max_values` and `maxs`components set to `-Real::max_values`.
100100
///
101-
/// This is often used as the initial values of some Aabb merging algorithms.
101+
/// This is often used as the initial values of some `Aabb` merging algorithms.
102102
#[inline]
103103
pub fn new_invalid() -> Self {
104104
Self::new(
@@ -107,34 +107,34 @@ impl Aabb {
107107
)
108108
}
109109

110-
/// Creates a new Aabb from its center and its half-extents.
110+
/// Creates a new `Aabb` from its center and its half-extents.
111111
#[inline]
112112
pub fn from_half_extents(center: Point<Real>, half_extents: Vector<Real>) -> Self {
113113
Self::new(center - half_extents, center + half_extents)
114114
}
115115

116-
/// Creates a new Aabb from a set of points.
116+
/// Creates a new `Aabb` from a set of points.
117117
pub fn from_points<'a, I>(pts: I) -> Self
118118
where
119119
I: IntoIterator<Item = &'a Point<Real>>,
120120
{
121121
super::aabb_utils::local_point_cloud_aabb(pts)
122122
}
123123

124-
/// The center of this Aabb.
124+
/// The center of this `Aabb`.
125125
#[inline]
126126
pub fn center(&self) -> Point<Real> {
127127
na::center(&self.mins, &self.maxs)
128128
}
129129

130-
/// The half extents of this Aabb.
130+
/// The half extents of this `Aabb`.
131131
#[inline]
132132
pub fn half_extents(&self) -> Vector<Real> {
133133
let half: Real = na::convert::<f64, Real>(0.5);
134134
(self.maxs - self.mins) * half
135135
}
136136

137-
/// The volume of this Aabb.
137+
/// The volume of this `Aabb`.
138138
#[inline]
139139
pub fn volume(&self) -> Real {
140140
let extents = self.extents();
@@ -144,19 +144,19 @@ impl Aabb {
144144
return extents.x * extents.y * extents.z;
145145
}
146146

147-
/// The extents of this Aabb.
147+
/// The extents of this `Aabb`.
148148
#[inline]
149149
pub fn extents(&self) -> Vector<Real> {
150150
self.maxs - self.mins
151151
}
152152

153-
/// Enlarges this Aabb so it also contains the point `pt`.
153+
/// Enlarges this `Aabb` so it also contains the point `pt`.
154154
pub fn take_point(&mut self, pt: Point<Real>) {
155155
self.mins = self.mins.coords.inf(&pt.coords).into();
156156
self.maxs = self.maxs.coords.sup(&pt.coords).into();
157157
}
158158

159-
/// Computes the Aabb bounding `self` transformed by `m`.
159+
/// Computes the `Aabb` bounding `self` transformed by `m`.
160160
#[inline]
161161
pub fn transform_by(&self, m: &Isometry<Real>) -> Self {
162162
let ls_center = self.center();
@@ -176,7 +176,7 @@ impl Aabb {
176176
}
177177
}
178178

179-
/// The smallest bounding sphere containing this Aabb.
179+
/// The smallest bounding sphere containing this `Aabb`.
180180
#[inline]
181181
pub fn bounding_sphere(&self) -> BoundingSphere {
182182
let center = self.center();
@@ -195,7 +195,7 @@ impl Aabb {
195195
true
196196
}
197197

198-
/// Computes the intersection of this Aabb and another one.
198+
/// Computes the intersection of this `Aabb` and another one.
199199
pub fn intersection(&self, other: &Aabb) -> Option<Aabb> {
200200
let result = Aabb {
201201
mins: Point::from(self.mins.coords.sup(&other.mins.coords)),
@@ -211,17 +211,17 @@ impl Aabb {
211211
Some(result)
212212
}
213213

214-
/// Returns the difference between this Aabb and `rhs`.
214+
/// Returns the difference between this `Aabb` and `rhs`.
215215
///
216-
/// Removing another Aabb from `self` will result in zero, one, or up to 4 (in 2D) or 8 (in 3D)
216+
/// Removing another `Aabb` from `self` will result in zero, one, or up to 4 (in 2D) or 8 (in 3D)
217217
/// new smaller Aabbs.
218218
pub fn difference(&self, rhs: &Aabb) -> ArrayVec<Self, TWO_DIM> {
219219
self.difference_with_cut_sequence(rhs).0
220220
}
221221

222-
/// Returns the difference between this Aabb and `rhs`.
222+
/// Returns the difference between this `Aabb` and `rhs`.
223223
///
224-
/// Removing another Aabb from `self` will result in zero, one, or up to 4 (in 2D) or 8 (in 3D)
224+
/// Removing another `Aabb` from `self` will result in zero, one, or up to 4 (in 2D) or 8 (in 3D)
225225
/// new smaller Aabbs.
226226
///
227227
/// # Return
@@ -276,7 +276,7 @@ impl Aabb {
276276
(result, cut_sequence)
277277
}
278278

279-
/// Computes the vertices of this Aabb.
279+
/// Computes the vertices of this `Aabb`.
280280
#[inline]
281281
#[cfg(feature = "dim2")]
282282
pub fn vertices(&self) -> [Point<Real>; 4] {
@@ -288,7 +288,7 @@ impl Aabb {
288288
]
289289
}
290290

291-
/// Computes the vertices of this Aabb.
291+
/// Computes the vertices of this `Aabb`.
292292
#[inline]
293293
#[cfg(feature = "dim3")]
294294
pub fn vertices(&self) -> [Point<Real>; 8] {
@@ -304,7 +304,7 @@ impl Aabb {
304304
]
305305
}
306306

307-
/// Splits this Aabb at its center, into four parts (as in a quad-tree).
307+
/// Splits this `Aabb` at its center, into four parts (as in a quad-tree).
308308
#[inline]
309309
#[cfg(feature = "dim2")]
310310
pub fn split_at_center(&self) -> [Aabb; 4] {
@@ -324,7 +324,7 @@ impl Aabb {
324324
]
325325
}
326326

327-
/// Splits this Aabb at its center, into eight parts (as in an octree).
327+
/// Splits this `Aabb` at its center, into eight parts (as in an octree).
328328
#[inline]
329329
#[cfg(feature = "dim3")]
330330
pub fn split_at_center(&self) -> [Aabb; 8] {
@@ -366,7 +366,7 @@ impl Aabb {
366366
]
367367
}
368368

369-
/// Projects every point of Aabb on an arbitrary axis.
369+
/// Projects every point of `Aabb` on an arbitrary axis.
370370
pub fn project_on_axis(&self, axis: &UnitVector<Real>) -> (Real, Real) {
371371
let cuboid = Cuboid::new(self.half_extents());
372372
let shift = cuboid

src/bounding_volume/aabb_ball.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ pub fn local_ball_aabb(radius: Real) -> Aabb {
2020
}
2121

2222
impl Ball {
23-
/// Computes the world-space Aabb of this ball transformed by `pos`.
23+
/// Computes the world-space [`Aabb`] of this ball transformed by `pos`.
2424
#[inline]
2525
pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
2626
ball_aabb(&Point::<Real>::from(pos.translation.vector), self.radius)
2727
}
2828

29-
/// Computes the local-space Aabb of this ball.
29+
/// Computes the local-space [`Aabb`] of this ball.
3030
#[inline]
3131
pub fn local_aabb(&self) -> Aabb {
3232
local_ball_aabb(self.radius)

src/bounding_volume/aabb_convex_polygon.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ use crate::math::{Isometry, Real};
33
use crate::shape::ConvexPolygon;
44

55
impl ConvexPolygon {
6-
/// Computes the world-space Aabb of this convex polygon, transformed by `pos`.
6+
/// Computes the world-space [`Aabb`] of this convex polygon, transformed by `pos`.
77
#[inline]
88
pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
99
super::details::point_cloud_aabb(pos, self.points())
1010
}
1111

12-
/// Computes the local-space Aabb of this convex polygon.
12+
/// Computes the local-space [`Aabb`] of this convex polygon.
1313
#[inline]
1414
pub fn local_aabb(&self) -> Aabb {
1515
super::details::local_point_cloud_aabb(self.points())

src/bounding_volume/aabb_convex_polyhedron.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ use crate::math::{Isometry, Real};
33
use crate::shape::ConvexPolyhedron;
44

55
impl ConvexPolyhedron {
6-
/// Computes the world-space Aabb of this convex polyhedron, transformed by `pos`.
6+
/// Computes the world-space [`Aabb`] of this convex polyhedron, transformed by `pos`.
77
#[inline]
88
pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
99
super::details::point_cloud_aabb(pos, self.points())
1010
}
1111

12-
/// Computes the local-space Aabb of this convex polyhedron.
12+
/// Computes the local-space [`Aabb`] of this convex polyhedron.
1313
#[inline]
1414
pub fn local_aabb(&self) -> Aabb {
1515
super::details::local_point_cloud_aabb(self.points())

src/bounding_volume/aabb_cuboid.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::shape::Cuboid;
44
use crate::utils::IsometryOps;
55

66
impl Cuboid {
7-
/// Computes the world-space Aabb of this cuboid, transformed by `pos`.
7+
/// Computes the world-space [`Aabb`] of this cuboid, transformed by `pos`.
88
#[inline]
99
pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
1010
let center = Point::from(pos.translation.vector);
@@ -13,7 +13,7 @@ impl Cuboid {
1313
Aabb::from_half_extents(center, ws_half_extents)
1414
}
1515

16-
/// Computes the local-space Aabb of this cuboid.
16+
/// Computes the local-space [`Aabb`] of this cuboid.
1717
#[inline]
1818
pub fn local_aabb(&self) -> Aabb {
1919
let half_extents = Point::from(self.half_extents);

src/bounding_volume/aabb_halfspace.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ use crate::shape::HalfSpace;
55
use na;
66

77
impl HalfSpace {
8-
/// Computes the world-space Aabb of this half-space.
8+
/// Computes the world-space [`Aabb`] of this half-space.
99
#[inline]
1010
pub fn aabb(&self, _pos: &Isometry<Real>) -> Aabb {
1111
self.local_aabb()
1212
}
1313

14-
/// Computes the local-space Aabb of this half-space.
14+
/// Computes the local-space [`Aabb`] of this half-space.
1515
#[inline]
1616
pub fn local_aabb(&self) -> Aabb {
1717
// We divide by 2.0 so that we can still make some operations with it (like loosening)

src/bounding_volume/aabb_heightfield.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ use crate::math::{Isometry, Real};
33
use crate::shape::{GenericHeightField, HeightFieldStorage};
44

55
impl<Storage: HeightFieldStorage> GenericHeightField<Storage> {
6-
/// Computes the world-space Aabb of this heightfield, transformed by `pos`.
6+
/// Computes the world-space [`Aabb`] of this heightfield, transformed by `pos`.
77
#[inline]
88
pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
99
self.root_aabb().transform_by(pos)
1010
}
1111

12-
/// Computes the local-space Aabb of this heightfield.
12+
/// Computes the local-space [`Aabb`] of this heightfield.
1313
#[inline]
1414
pub fn local_aabb(&self) -> Aabb {
1515
self.root_aabb().clone()

src/bounding_volume/aabb_support_map.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ use crate::shape::{Cone, Cylinder};
77

88
#[cfg(feature = "dim3")]
99
impl Cone {
10-
/// Computes the world-space Aabb of this cone, transformed by `pos`.
10+
/// Computes the world-space [`Aabb`] of this cone, transformed by `pos`.
1111
#[inline]
1212
pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
1313
bounding_volume::details::support_map_aabb(pos, self)
1414
}
1515

16-
/// Computes the local-space Aabb of this cone.
16+
/// Computes the local-space [`Aabb`] of this cone.
1717
#[inline]
1818
pub fn local_aabb(&self) -> Aabb {
1919
bounding_volume::details::local_support_map_aabb(self)
@@ -22,27 +22,27 @@ impl Cone {
2222

2323
#[cfg(feature = "dim3")]
2424
impl Cylinder {
25-
/// Computes the world-space Aabb of this cylinder, transformed by `pos`.
25+
/// Computes the world-space [`Aabb`] of this cylinder, transformed by `pos`.
2626
#[inline]
2727
pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
2828
bounding_volume::details::support_map_aabb(pos, self)
2929
}
3030

31-
/// Computes the local-space Aabb of this cylinder.
31+
/// Computes the local-space [`Aabb`] of this cylinder.
3232
#[inline]
3333
pub fn local_aabb(&self) -> Aabb {
3434
bounding_volume::details::local_support_map_aabb(self)
3535
}
3636
}
3737

3838
impl Segment {
39-
/// Computes the world-space Aabb of this segment, transformed by `pos`.
39+
/// Computes the world-space [`Aabb`] of this segment, transformed by `pos`.
4040
#[inline]
4141
pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
4242
self.transformed(pos).local_aabb()
4343
}
4444

45-
/// Computes the local-space Aabb of this segment.
45+
/// Computes the local-space [`Aabb`] of this segment.
4646
#[inline]
4747
pub fn local_aabb(&self) -> Aabb {
4848
bounding_volume::details::local_support_map_aabb(self)

src/bounding_volume/aabb_triangle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ use crate::{
55
};
66

77
impl Triangle {
8-
/// Computes the world-space Aabb of this triangle, transformed by `pos`.
8+
/// Computes the world-space [`Aabb`] of this triangle, transformed by `pos`.
99
#[inline]
1010
pub fn aabb(&self, pos: &Isometry<Real>) -> Aabb {
1111
self.transformed(pos).local_aabb()
1212
}
1313

14-
/// Computes the local-space Aabb of this triangle.
14+
/// Computes the local-space [`Aabb`] of this triangle.
1515
#[inline]
1616
pub fn local_aabb(&self) -> Aabb {
1717
let a = self.a.coords;

src/bounding_volume/aabb_utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::math::{Isometry, Point, Real, Vector, DIM};
55
use crate::shape::SupportMap;
66
use na;
77

8-
/// Computes the Aabb of an support mapped shape.
8+
/// Computes the [`Aabb`] of an [support mapped shape](SupportMap).
99
#[cfg(feature = "dim3")]
1010
pub fn support_map_aabb<G>(m: &Isometry<Real>, i: &G) -> Aabb
1111
where
@@ -30,7 +30,7 @@ where
3030
Aabb::new(Point::from(min), Point::from(max))
3131
}
3232

33-
/// Computes the Aabb of an support mapped shape.
33+
/// Computes the [`Aabb`] of an [support mapped shape](SupportMap).
3434
pub fn local_support_map_aabb<G>(i: &G) -> Aabb
3535
where
3636
G: SupportMap,
@@ -54,7 +54,7 @@ where
5454
Aabb::new(Point::from(min), Point::from(max))
5555
}
5656

57-
/// Computes the Aabb of a set of points transformed by `m`.
57+
/// Computes the [`Aabb`] of a set of points transformed by `m`.
5858
pub fn point_cloud_aabb<'a, I>(m: &Isometry<Real>, pts: I) -> Aabb
5959
where
6060
I: IntoIterator<Item = &'a Point<Real>>,
@@ -77,7 +77,7 @@ where
7777
Aabb::new(min, max)
7878
}
7979

80-
/// Computes the Aabb of a set of points.
80+
/// Computes the [`Aabb`] of a set of points.
8181
pub fn local_point_cloud_aabb<'a, I>(pts: I) -> Aabb
8282
where
8383
I: IntoIterator<Item = &'a Point<Real>>,

0 commit comments

Comments
 (0)