Available on crate feature
rand
only.Expand description
This module contains tools related to random sampling.
To use this, the “rand” feature must be enabled.
Modules§
- mesh_
sampling - Functionality related to random sampling from triangle meshes.
- shape_
sampling - The
ShapeSample
trait, allowing random sampling from geometric shapes. - standard
- This module holds local implementations of the
Distribution
trait forStandard
, which allow certain Bevy math types (those whose values can be randomly generated without additional input other than anRng
) to be produced usingrand
’s APIs. It also holdsFromRng
, an ergonomic extension to that functionality which permits the omission of type annotations.
Structs§
- Boundary
Of - A wrapper struct that allows boundary sampling from a
ShapeSample
type directly as aDistribution
. - Interior
Of - A wrapper struct that allows interior sampling from a
ShapeSample
type directly as aDistribution
. - Uniform
Mesh Sampler - A distribution that caches data to allow fast sampling from a collection of triangles.
Generally used through
sample
orsample_iter
.
Traits§
- FromRng
- Ergonomics trait for a type with a
Standard
distribution, allowing values to be generated uniformly from anRng
by a method in its own namespace. - Shape
Sample - Exposes methods to uniformly sample a variety of primitive shapes.