diff options
Diffstat (limited to 'rotord/src/nodes_maths.h')
| -rw-r--r-- | rotord/src/nodes_maths.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/rotord/src/nodes_maths.h b/rotord/src/nodes_maths.h index eb685eb..760040d 100644 --- a/rotord/src/nodes_maths.h +++ b/rotord/src/nodes_maths.h @@ -61,12 +61,14 @@ namespace Rotor { #define ARITHMETIC_cos 8 #define ARITHMETIC_ease 9 #define ARITHMETIC_jolt 10 +#define ARITHMETIC_floor 11 +#define ARITHMETIC_2pow 12 class Arithmetic: public Signal_node { public: Arithmetic(){ create_signal_input("signal","Signal"); create_parameter("value","number","Value or signal for operation","Value",1.0f); - create_attribute("operator","operator for image","Operator","+",{"+","-","*","/","%","^","sin","cos","ease","jolt"}); + create_attribute("operator","operator for image","Operator","+",{"+","-","*","/","%","^","sin","cos","ease","jolt","floor","2pow"}); title="Arithmetic"; description="Performs arithmetic on a signal with a signal or value"; }; @@ -116,6 +118,12 @@ namespace Rotor { case ARITHMETIC_jolt: return ((1.0-parameters["value"]->value)*in)+(parameters["value"]->value*(0.5f+((sin((fmod(in,1.0f)+1.0f)*M_PI))*0.5f))); break; + case ARITHMETIC_floor: + return floor(in); + break; + case ARITHMETIC_2pow: + return pow(2,in); + break; } } } |
