Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
34
pub fn reflect(v: Vec3, n: Vec3) -> Vec3 {
35
v - 2.0 * v.dot(n) * n
36
}
37
38
pub fn refract(v: Vec3, n: Vec3, ni_over_nt: f32) -> Option<Vec3> {
39
let uv = v.normalized();
Callers
1
scatter
Method · 0.85
Calls
1
dot
Method · 0.45
Tested by
no test coverage detected