From 9afa98e9059dd54525c00b93ee231e57c512e0c3 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 11 Sep 2023 13:59:10 +0200 Subject: [PATCH] Fix `Random Range` nodes in CPU particles/script graphs when using `int` #1341 --- Source/Engine/Visject/VisjectGraph.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Engine/Visject/VisjectGraph.cpp b/Source/Engine/Visject/VisjectGraph.cpp index ca4495f67..1cee5d46e 100644 --- a/Source/Engine/Visject/VisjectGraph.cpp +++ b/Source/Engine/Visject/VisjectGraph.cpp @@ -1279,16 +1279,16 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value) // Random Float Range case 213: { - auto a = tryGetValue(node->TryGetBox(1), node->Values[0]).AsFloat; - auto b = tryGetValue(node->TryGetBox(2), node->Values[1]).AsFloat; + auto a = (float)tryGetValue(node->TryGetBox(1), node->Values[0]); + auto b = (float)tryGetValue(node->TryGetBox(2), node->Values[1]); value = Math::Lerp(a, b, RAND); break; } // Random Vector2 Range case 214: { - auto a = tryGetValue(node->TryGetBox(1), node->Values[0]).AsFloat2(); - auto b = tryGetValue(node->TryGetBox(2), node->Values[1]).AsFloat2(); + auto a = (Float2)tryGetValue(node->TryGetBox(1), node->Values[0]); + auto b = (Float2)tryGetValue(node->TryGetBox(2), node->Values[1]); value = Float2( Math::Lerp(a.X, b.X, RAND), Math::Lerp(a.Y, b.Y, RAND) @@ -1298,8 +1298,8 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value) // Random Vector3 Range case 215: { - auto a = tryGetValue(node->TryGetBox(1), node->Values[0]).AsFloat3(); - auto b = tryGetValue(node->TryGetBox(2), node->Values[1]).AsFloat3(); + auto a = (Float3)tryGetValue(node->TryGetBox(1), node->Values[0]); + auto b = (Float3)tryGetValue(node->TryGetBox(2), node->Values[1]); value = Float3( Math::Lerp(a.X, b.X, RAND), Math::Lerp(a.Y, b.Y, RAND), @@ -1310,8 +1310,8 @@ void VisjectExecutor::ProcessGroupParticles(Box* box, Node* node, Value& value) // Random Vector4 Range case 216: { - auto a = tryGetValue(node->TryGetBox(1), node->Values[0]).AsFloat4(); - auto b = tryGetValue(node->TryGetBox(2), node->Values[1]).AsFloat4(); + auto a = (Float4)tryGetValue(node->TryGetBox(1), node->Values[0]); + auto b = (Float4)tryGetValue(node->TryGetBox(2), node->Values[1]); value = Float4( Math::Lerp(a.X, b.X, RAND), Math::Lerp(a.Y, b.Y, RAND),