22 : buffer_(output_buffer),
23 default_color_(default_color),
24 total_weights_(output_buffer.
size(), 0.0f)
26 buffer_.fill(
Color4f(0, 0, 0, 0));
32 Color4f &output_color = buffer_[index];
33 output_color.
r += color.
r * weight;
34 output_color.
g += color.
g * weight;
35 output_color.
b += color.
b * weight;
36 output_color.
a += color.
a * weight;
37 total_weights_[index] += weight;
42 for (
const int64_t i : buffer_.index_range()) {
43 const float weight = total_weights_[i];
44 Color4f &output_color = buffer_[i];
46 const float weight_inv = 1.0f / weight;
47 output_color.
r *= weight_inv;
48 output_color.
g *= weight_inv;
49 output_color.
b *= weight_inv;
50 output_color.
a *= weight_inv;
53 output_color = default_color_;
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void mix_in(const int64_t index, const Color4f &color, const float weight=1.0f)
Color4fMixer(MutableSpan< Color4f > buffer, Color4f default_color={0, 0, 0, 1})