MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ turbulence()

VectorField MayaFlux::Kinesis::ForceFields::turbulence ( float  strength,
Stochastic::Stochastic  rng = Stochastic::Stochastic() 
)
inline

Uniform random force field using Stochastic infrastructure.

Parameters
strengthMaximum magnitude per axis
rngStochastic generator instance (captured by value, caller controls seed)
Returns
VectorField: glm::vec3 -> glm::vec3

Produces a different random vector on each evaluation. Position input is ignored: the field is spatially uniform but temporally varying. For spatially coherent noise, compose with a Perlin/simplex generator.

Definition at line 40 of file ForceFields.hpp.

41{
42 return { .fn = [strength, rng](const glm::vec3&) mutable -> glm::vec3 {
43 return glm::vec3(
44 rng(-1.0F, 1.0F),
45 rng(-1.0F, 1.0F),
46 rng(-1.0F, 1.0F))
47 * strength;
48 } };
49}

References MayaFlux::Kinesis::Tendency< D, R >::fn.

Referenced by MayaFlux::Nodes::Network::PhysicsOperator::apply_turbulence().

+ Here is the caller graph for this function: