Struct bevy_rng::RngPlugin[][src]

pub struct RngPlugin { /* fields omitted */ }

RngPlugin allows you to inject a (optionally seeded) random number generator into your systems.

Once the plugin is active, you can use Local<bevy_rng::Rng> to get the rng instance.

Using Local<T> ensures you get a unique copy of the rng for each individual system, which is important, because systems have no deterministic order, which will result in non-deterministic rng results.

You are still responsible for deterministically generating random numbers inside an individual system, which (currently) means you can't generate random numbers when iterating over entities, as entity iteration also isn't ordered currently.

Trait Implementations

impl Clone for RngPlugin[src]

impl Debug for RngPlugin[src]

impl Default for RngPlugin[src]

impl Eq for RngPlugin[src]

impl From<&'_ str> for RngPlugin[src]

impl From<String> for RngPlugin[src]

impl From<u64> for RngPlugin[src]

impl Hash for RngPlugin[src]

impl Ord for RngPlugin[src]

impl PartialEq<RngPlugin> for RngPlugin[src]

impl PartialOrd<RngPlugin> for RngPlugin[src]

impl Plugin for RngPlugin[src]

impl StructuralEq for RngPlugin[src]

impl StructuralPartialEq for RngPlugin[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash + ?Sized

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> Component for T where
    T: 'static + Send + Sync

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> From<T> for T[src]

impl<T> FromResources for T where
    T: Default

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Resource for T where
    T: 'static + Send + Sync

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> TypeData for T where
    T: 'static + Send + Sync + Clone

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,