Skip to content

Commit

Permalink
math: Remove leftover noop conversion and comment from `Rgba::reflect…
Browse files Browse the repository at this point in the history
…()`.

Now that the alpha component is `ZeroOne` and the other numbers involved
are `PositiveSign`, no NaN checks are present.
  • Loading branch information
kpreid committed Oct 31, 2024
1 parent 0fa5152 commit fc36de4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions all-is-cubes-base/src/math/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,7 @@ impl Rgba {
#[inline]
#[doc(hidden)] // not sure if good public API
pub fn reflect(self, illumination: Rgb) -> Rgb {
// TODO: do this math without any NaN checks or negative/amplified values.
// by introducing a dedicated RgbaReflectance type with constrained components?
self.to_rgb() * illumination * PositiveSign::from(self.alpha)
self.to_rgb() * illumination * self.alpha
}
}

Expand Down

0 comments on commit fc36de4

Please sign in to comment.