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) -> Self
pub const fn new(seed: u64) -> Self
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 UnsafeUnpin 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