wiremod/wire

E2 mix functions implemented backwards

Denneisk opened this issue · 3 comments

e2function vector mix(vector vec1, vector vec2, ratio)
return Vector(
vec1[1] * ratio + vec2[1] * (1-ratio),
vec1[2] * ratio + vec2[2] * (1-ratio),
vec1[3] * ratio + vec2[3] * (1-ratio)
)
end

mix(vvn) is implemented so that mix(vec1, vec2, 0) == vec2. The same applies to all other mix functions (vector2, vector4). This is confusing compared to typical definitions of similar functions.

The expected behavior is mix(vec1, vec2, 0) == vec1.

Not sure how no-one has complained about this before.

Vurv78 commented

With #2721, could probably fix this ordering issue with the color type and deprecate this function. And then maybe add lerp(vvn) too.

Agreed, it's definitely backwards, and I've known for ages. I just never complained because fixing something like this requires either deprecating functions or breaking backwards-compat (lol)

when e2 literally breaks chips by fixing its self lmao

does this mean e2 functions by being broken