pub struct SceneRng { /* private fields */ }Expand description
Deterministic xorshift, so scenes are reproducible across runs and machines.
Implementations§
Source§impl SceneRng
impl SceneRng
Sourcepub const fn new(seed: u64) -> SceneRng
pub const fn new(seed: u64) -> SceneRng
Seed the generator. Zero is remapped: xorshift is stuck at zero.
Sourcepub fn coordinate(&mut self, bound: i64) -> f64
pub fn coordinate(&mut self, bound: i64) -> f64
Integer coordinate in [-bound, bound).
Integers, not arbitrary floats: they keep the degenerate constructions below exactly degenerate, which is the entire point of the scene.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SceneRng
impl RefUnwindSafe for SceneRng
impl Send for SceneRng
impl Sync for SceneRng
impl Unpin for SceneRng
impl UnwindSafe for SceneRng
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more