Module utils

Source
Expand description

utils module provides some useful helper functions of random generation and gradient scale

Functionsยง

distance_squared
Return squared distance between to points
explosion_gradient_1
A sample function defining the gradient of the Particle
explosion_gradient_2
A sample function defining the gradient of the Particle
explosion_gradient_3
A sample function defining the gradient of the Particle
gen_points_arc
Generate random Vec2 on an arc
gen_points_circle
Generate random Vec2 within a circle range
gen_points_circle_normal
Generate random Vec2 within a circle range with normal distribution
gen_points_circle_normal_dev
Generate random Vec2 within a circle range with normal distribution
gen_points_fan
Generate random Vec2 within a fan-shape range
gen_points_on_circle
Generate random Vec2 on a circle
linear_gradient_1
A sample function defining the gradient of the Particle
round
Round a Vec2 from (f32, f32) to (isize, isize)