From b85fb91a864889c7adfc180b1b56f4f1bf2011c6 Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Wed, 3 Aug 2022 08:14:38 +0200 Subject: [PATCH] [orx-keyframer] Add mod and round functions --- orx-jvm/orx-keyframer/src/main/kotlin/Expressions.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/orx-jvm/orx-keyframer/src/main/kotlin/Expressions.kt b/orx-jvm/orx-keyframer/src/main/kotlin/Expressions.kt index f8a5c476..6a40ca95 100644 --- a/orx-jvm/orx-keyframer/src/main/kotlin/Expressions.kt +++ b/orx-jvm/orx-keyframer/src/main/kotlin/Expressions.kt @@ -285,6 +285,7 @@ internal class ExpressionListener(val functions: FunctionExtensions = FunctionEx "exp" -> { x -> exp(x[0]) } "abs" -> { x -> abs(x[0]) } "floor" -> { x -> floor(x[0]) } + "round" -> { x -> round(x[0]) } "ceil" -> { x -> ceil(x[0]) } "saturate" -> { x -> x[0].coerceIn(0.0, 1.0) } else -> functions.functions1[name]?.let { { x: DoubleArray -> it.invoke(x[0]) } } @@ -300,6 +301,7 @@ internal class ExpressionListener(val functions: FunctionExtensions = FunctionEx "max" -> { x -> max(x[0], x[1]) } "min" -> { x -> min(x[0], x[1]) } "pow" -> { x -> x[0].pow(x[1]) } + "mod" -> { x -> x[0].mod(x[1]) } "atan2" -> { x -> atan2(x[0], x[1]) } "random" -> { x -> Double.uniform(x[0], x[1]) } "length" -> { x -> Vector2(x[0], x[1]).length }