Closed
Description
class metal : public material {
public:
metal(const color& a, double f) : albedo(a), fuzz(f < 1 ? f : 1) {}
virtual bool scatter(
const ray& r_in, const hit_record& rec, color& attenuation, ray& scattered) const override {
...
}
public:
color albedo;
double fuzz;
};
Why we can create metal with negative fuzz? I think we need something like that:
metal(const color& a, double f) : albedo(a), fuzz(abs(f) < 1 ? abs(f) : 1) {}