It seems like the incoming ray is not used in any of the calculations of the scattering_pdf member functions. Although there is no error nor negative side-effects, this parameter could be removed.
|
double scattering_pdf( |
|
const ray& r_in, const hit_record& rec, const ray& scattered |
|
) const override { |
|
auto cosine = dot(rec.normal, unit_vector(scattered.direction())); |
|
return cosine < 0 ? 0 : cosine/pi; |
|
} |
This parameter is in both the current v3 revision and the upcoming v4 revision.