Replace util ctor's with constants

I don't need functions to create new vectors, I just want a constant
that I can clone. The compiler probably does the same thing in both
cases, but this is more semantically accurate to that goal.
This commit is contained in:
2025-08-20 10:31:03 -05:00
parent 83fa670d35
commit 309931b7f6
4 changed files with 27 additions and 24 deletions

View File

@@ -141,7 +141,7 @@ impl Material {
Vec3::dot(scattered.dir, rec.normal) > 0.0
}
Material::Dielectric { index_refraction } => {
*attenuation = Vec3::ones();
*attenuation = Vec3::ONES;
let refraction_ratio = if rec.front_face {
1.0 / index_refraction
} else {