MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / random_snorm_vec

Function random_snorm_vec

examples/cuda/gpu/path_tracer_gpu/src/math.rs:20–22  ·  view source on GitHub ↗

Creates a random vector with each element being in the range of [-1.0, 1.0] (signed normalized).

(state: &mut DefaultRand)

Source from the content-addressed store, hash-verified

18
19/// Creates a random vector with each element being in the range of [-1.0, 1.0] (signed normalized).
20pub fn random_snorm_vec(state: &mut DefaultRand) -> Vec3 {
21 random_unit_vec(state).map(norm_f32_to_snorm)
22}
23
24pub fn random_in_unit_sphere(state: &mut DefaultRand) -> Vec3 {
25 loop {

Callers 1

random_in_unit_sphereFunction · 0.85

Calls 1

random_unit_vecFunction · 0.85

Tested by

no test coverage detected