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

Function reflect

examples/cuda/gpu/path_tracer_gpu/src/math.rs:34–36  ·  view source on GitHub ↗
(v: Vec3, n: Vec3)

Source from the content-addressed store, hash-verified

32}
33
34pub fn reflect(v: Vec3, n: Vec3) -> Vec3 {
35 v - 2.0 * v.dot(n) * n
36}
37
38pub fn refract(v: Vec3, n: Vec3, ni_over_nt: f32) -> Option<Vec3> {
39 let uv = v.normalized();

Callers 1

scatterMethod · 0.85

Calls 1

dotMethod · 0.45

Tested by

no test coverage detected