From 795668d018bb1a678081e1fcb67f81714152f09d Mon Sep 17 00:00:00 2001 From: Robert Dorn Date: Fri, 20 Dec 2024 10:24:45 +0100 Subject: [PATCH] fixed Mix node with float2, float3, float4 as C input --- .../nodes/math/arithmetic/Mix.ts | 18 +++---- src/authoring/AuthoringNodeSpecs.ts | 52 ------------------- 2 files changed, 9 insertions(+), 61 deletions(-) diff --git a/src/BasicBehaveEngine/nodes/math/arithmetic/Mix.ts b/src/BasicBehaveEngine/nodes/math/arithmetic/Mix.ts index 70172a0..11124db 100644 --- a/src/BasicBehaveEngine/nodes/math/arithmetic/Mix.ts +++ b/src/BasicBehaveEngine/nodes/math/arithmetic/Mix.ts @@ -32,23 +32,23 @@ export class Mix extends BehaveEngineNode { break; case "float2": val = [ - this.mix(a[0], b[0], c), - this.mix(a[1], b[1], c) + this.mix(a[0], b[0], c[0]), + this.mix(a[1], b[1], c[1]) ] break; case "float3": val = [ - this.mix(a[0], b[0], c), - this.mix(a[1], b[1], c), - this.mix(a[2], b[2], c), + this.mix(a[0], b[0], c[0]), + this.mix(a[1], b[1], c[1]), + this.mix(a[2], b[2], c[2]), ] break; case "float4": val = [ - this.mix(a[0], b[0], c), - this.mix(a[1], b[1], c), - this.mix(a[2], b[2], c), - this.mix(a[3], b[3], c), + this.mix(a[0], b[0], c[0]), + this.mix(a[1], b[1], c[1]), + this.mix(a[2], b[2], c[2]), + this.mix(a[3], b[3], c[3]), ] break default: diff --git a/src/authoring/AuthoringNodeSpecs.ts b/src/authoring/AuthoringNodeSpecs.ts index e5cce93..acbd5c2 100644 --- a/src/authoring/AuthoringNodeSpecs.ts +++ b/src/authoring/AuthoringNodeSpecs.ts @@ -2200,58 +2200,6 @@ export const arithmeticNodes = [ ] } }, - { - type: "math/mix", - description: "Linear interpolation operation", - configuration: [], - input: { - flows: [], - values: [ - { - id: "a", - description: "First Arg", - types: [ - "float", - "float2", - "float3", - "float4" - ] - }, - { - id: "b", - description: "Second Arg", - types: [ - "float", - "float2", - "float3", - "float4" - ] - }, - { - id: "c", - description: "Unclamped interpolation coefficient", - types: [ - "float" - ] - } - ] - }, - output: { - flows: [], - values: [ - { - id: "value", - description: "mix of a and b", - types: [ - "float", - "float2", - "float3", - "float4" - ] - } - ] - } - }, { type: "math/clamp", description: "Clamp operation",