pub struct VectorsInUnitBall;Expand description
A uniform distribution of 3-vectors inside the (closed) unit ball.
Trait Implementations§
Source§impl Clone for VectorsInUnitBall
impl Clone for VectorsInUnitBall
Source§fn clone(&self) -> VectorsInUnitBall
fn clone(&self) -> VectorsInUnitBall
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VectorsInUnitBall
impl Debug for VectorsInUnitBall
Source§impl Default for VectorsInUnitBall
impl Default for VectorsInUnitBall
Source§fn default() -> VectorsInUnitBall
fn default() -> VectorsInUnitBall
Returns the “default value” for a type. Read more
Source§impl Distrib for VectorsInUnitBall
impl Distrib for VectorsInUnitBall
Source§fn sample(&self, rng: &mut DefaultRng) -> Vec3
fn sample(&self, rng: &mut DefaultRng) -> Vec3
Returns a 3-vector uniformly sampled from the unit ball.
§Example
use retrofire_core::math::rand::*;
let rng = &mut DefaultRng::default();
let vec = VectorsInUnitBall.sample(rng);
assert!(vec.len_sqr() <= 1.0);impl Copy for VectorsInUnitBall
Auto Trait Implementations§
impl Freeze for VectorsInUnitBall
impl RefUnwindSafe for VectorsInUnitBall
impl Send for VectorsInUnitBall
impl Sync for VectorsInUnitBall
impl Unpin for VectorsInUnitBall
impl UnwindSafe for VectorsInUnitBall
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more