add Between and Not Equal to Compare Logic

This commit is contained in:
t3du 2021-10-27 10:32:58 -03:00 committed by GitHub
parent ca03897811
commit 130e470290
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,8 @@ class CompareNode extends LogicNode {
switch (property0) {
case "Equal":
cond = Std.isOfType(v1, Vec4) ? v1.equals(v2) : v1 == v2;
case "Not Equal":
cond = Std.isOfType(v1, Vec4) ? !v1.equals(v2) : v1 != v2;
case "Almost Equal":
cond = Std.isOfType(v1, Vec4) ? v1.almostEquals(v2, property1) : Math.abs(v1 - v2) < property1;
case "Greater":
@ -30,6 +32,9 @@ class CompareNode extends LogicNode {
cond = v1 < v2;
case "Less Equal":
cond = v1 <= v2;
case "Between":
var v3: Dynamic = inputs[2].get();
cond = v2 <= v1 && v1 <= v3;
case "Or":
for (input in inputs) {
if (input.get()) {