diff --git a/src/geometry/orthographic.rs b/src/geometry/orthographic.rs index 7b137641..43bf45c6 100644 --- a/src/geometry/orthographic.rs +++ b/src/geometry/orthographic.rs @@ -691,6 +691,7 @@ impl Distribution> for Standard where Standard: Distribution, { + /// Generate an arbitrary random variate for testing purposes. fn sample(&self, r: &mut R) -> Orthographic3 { use crate::base::helper; let left = r.gen(); diff --git a/src/geometry/perspective.rs b/src/geometry/perspective.rs index 69233952..64861fbd 100644 --- a/src/geometry/perspective.rs +++ b/src/geometry/perspective.rs @@ -275,6 +275,7 @@ impl Distribution> for Standard where Standard: Distribution, { + /// Generate an arbitrary random variate for testing purposes. fn sample<'a, R: Rng + ?Sized>(&self, r: &'a mut R) -> Perspective3 { use crate::base::helper; let znear = r.gen(); diff --git a/src/geometry/point_construction.rs b/src/geometry/point_construction.rs index bf88ece0..47b336f4 100644 --- a/src/geometry/point_construction.rs +++ b/src/geometry/point_construction.rs @@ -164,6 +164,7 @@ where DefaultAllocator: Allocator, Standard: Distribution, { + /// Generate a `Point` where each coordinate is an independent variate from `[0, 1)`. #[inline] fn sample<'a, G: Rng + ?Sized>(&self, rng: &mut G) -> Point { Point::from(rng.gen::>()) diff --git a/src/geometry/similarity_construction.rs b/src/geometry/similarity_construction.rs index 4501bdb7..0c814534 100644 --- a/src/geometry/similarity_construction.rs +++ b/src/geometry/similarity_construction.rs @@ -69,6 +69,7 @@ where DefaultAllocator: Allocator, Standard: Distribution + Distribution, { + /// Generate an arbitrary random variate for testing purposes. #[inline] fn sample<'a, G: Rng + ?Sized>(&self, rng: &mut G) -> Similarity { let mut s = rng.gen(); diff --git a/src/geometry/translation_construction.rs b/src/geometry/translation_construction.rs index 964cd105..c1c02862 100644 --- a/src/geometry/translation_construction.rs +++ b/src/geometry/translation_construction.rs @@ -78,6 +78,7 @@ where DefaultAllocator: Allocator, Standard: Distribution, { + /// Generate an arbitrary random variate for testing purposes. #[inline] fn sample<'a, G: Rng + ?Sized>(&self, rng: &'a mut G) -> Translation { Translation::from(rng.gen::>()) diff --git a/tests/core/helper.rs b/tests/core/helper.rs index ef749da6..ec214fc0 100644 --- a/tests/core/helper.rs +++ b/tests/core/helper.rs @@ -33,6 +33,8 @@ where // This is a wrapper similar to RandComplex, but for non-complex. // This exists only to make generic tests easier to write. +// +// Generates variates in the range [0, 1). #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub struct RandScalar(pub N);