pub struct ParticleRng { /* private fields */ }Expand description
A deterministic xorshift64* pseudo-random generator used by particle emitters.
The engine intentionally avoids both the rand crate (dependency weight
for a wasm target) and js_sys::Math::random (non-deterministic, and
unusable outside a JS runtime, which would make host-side unit tests
impossible). A seeded generator keeps emitter behavior reproducible.
Implementations§
Source§impl ParticleRng
Implements deterministic pseudo-random number generation for ParticleRng.
impl ParticleRng
Implements deterministic pseudo-random number generation for ParticleRng.
Sourcepub fn with_seed(seed: u64) -> ParticleRng
pub fn with_seed(seed: u64) -> ParticleRng
Sourcepub fn next_u64(&mut self) -> u64
pub fn next_u64(&mut self) -> u64
Advances the generator and returns the next 64-bit value.
§Returns
u64- The next pseudo-random value.
Trait Implementations§
Source§impl Clone for ParticleRng
impl Clone for ParticleRng
Source§fn clone(&self) -> ParticleRng
fn clone(&self) -> ParticleRng
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ParticleRng
Source§impl Debug for ParticleRng
impl Debug for ParticleRng
Source§impl Default for ParticleRng
Implements Default for ParticleRng using the default seed.
impl Default for ParticleRng
Implements Default for ParticleRng using the default seed.
Source§fn default() -> ParticleRng
fn default() -> ParticleRng
Returns the “default value” for a type. Read more
Source§impl PartialEq for ParticleRng
impl PartialEq for ParticleRng
Source§impl PartialOrd for ParticleRng
impl PartialOrd for ParticleRng
impl StructuralPartialEq for ParticleRng
Auto Trait Implementations§
impl Freeze for ParticleRng
impl RefUnwindSafe for ParticleRng
impl Send for ParticleRng
impl Sync for ParticleRng
impl Unpin for ParticleRng
impl UnsafeUnpin for ParticleRng
impl UnwindSafe for ParticleRng
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