pub struct RngPlugin { /* private fields */ }Expand description
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§
Source§impl Ord for RngPlugin
impl Ord for RngPlugin
Source§impl PartialOrd for RngPlugin
impl PartialOrd for RngPlugin
impl Eq for RngPlugin
impl StructuralPartialEq for RngPlugin
Auto Trait Implementations§
impl Freeze for RngPlugin
impl RefUnwindSafe for RngPlugin
impl Send for RngPlugin
impl Sync for RngPlugin
impl Unpin for RngPlugin
impl UnwindSafe for RngPlugin
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> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromResources for Twhere
T: Default,
impl<T> FromResources for Twhere
T: Default,
Source§fn from_resources(_resources: &Resources) -> T
fn from_resources(_resources: &Resources) -> T
Creates
Self using data from the Resources collection