Skip to content

E2 mix functions implemented backwards #2716

@Denneisk

Description

@Denneisk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions