Trait Random

Source
pub trait Random {
    // Required methods
    fn rand_unit<R: Rng>(rng: &mut R) -> Self;
    fn rand_sphere<R: Rng>(rng: &mut R) -> Self;
    fn rand_constrained_sphere<R: Rng>(rng: &mut R, r1: f32, r2: f32) -> Self;
    fn rand_uniform<R: Rng>(rng: &mut R) -> Self;
}

Required Methods§

Source

fn rand_unit<R: Rng>(rng: &mut R) -> Self

Source

fn rand_sphere<R: Rng>(rng: &mut R) -> Self

Source

fn rand_constrained_sphere<R: Rng>(rng: &mut R, r1: f32, r2: f32) -> Self

Generate a vector withing a sphere with inner and outer radii

Source

fn rand_uniform<R: Rng>(rng: &mut R) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Random for f32

Source§

fn rand_unit<R: Rng>(rng: &mut R) -> Self

Source§

fn rand_sphere<R: Rng>(rng: &mut R) -> Self

Source§

fn rand_constrained_sphere<R: Rng>(rng: &mut R, r1: f32, r2: f32) -> Self

Source§

fn rand_uniform<R: Rng>(rng: &mut R) -> Self

Source§

impl Random for f64

Source§

fn rand_unit<R: Rng>(rng: &mut R) -> Self

Source§

fn rand_sphere<R: Rng>(rng: &mut R) -> Self

Source§

fn rand_constrained_sphere<R: Rng>(rng: &mut R, r1: f32, r2: f32) -> Self

Source§

fn rand_uniform<R: Rng>(rng: &mut R) -> Self

Source§

impl Random for Vec2

Source§

fn rand_unit<R: Rng>(rng: &mut R) -> Self

Source§

fn rand_sphere<R: Rng>(rng: &mut R) -> Self

Source§

fn rand_constrained_sphere<R: Rng>(rng: &mut R, r1: f32, r2: f32) -> Self

Source§

fn rand_uniform<R: Rng>(rng: &mut R) -> Self

Source§

impl Random for Vec3

Source§

fn rand_unit<R: Rng>(rng: &mut R) -> Self

Source§

fn rand_sphere<R: Rng>(rng: &mut R) -> Self

Source§

fn rand_constrained_sphere<R: Rng>(rng: &mut R, r1: f32, r2: f32) -> Self

Source§

fn rand_uniform<R: Rng>(rng: &mut R) -> Self

Implementors§