Add missing constructor for random_distributions::UniformSquare

This commit is contained in:
Matthew Gordon 2021-10-03 11:00:14 -04:00
parent fac841295e
commit eee0da42c3
1 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,12 @@ pub struct UniformSquare {
size: f64,
}
impl UniformSquare {
pub fn new(corner: Vec2, size: f64) -> UniformSquare {
UniformSquare { corner, size }
}
}
impl RandomDistribution<Vec2> for UniformSquare {
fn value(&self) -> Vec2 {
let mut rng = thread_rng();