Math category - Stingray Flow Node Reference

Sub-categories

Nodes

Outputs

Value 1

float

Numeric result

Value 2

float

Numeric result

Variables

Initialize

string

Function

string

Inputs

float

Input 1

Numeric variable

float

Input 2

Numeric variable

float

Input 3

Numeric variable

float

Input 4

Numeric variable

event

Reset

Event that executes the Initialize function again, setting the node into its initial state

The ´initialize´ function is run once and ´function´ each time. The node have four (optional) input variables and two output result values.

Multiple statements in the expression fields (´initialize´ and ´function´) are delimited by a semicolon. The ´initialize´ expression can declare up to four local variables which can then be used in the ´function´ expression.

Example that declares two local variables ´local1´ and ´tmp3´a and outputs the value 3 to output Value1 at first query of value1 and for each subsequest query decreases the output ´Value´ by 2: 1, -1, -3, -5...

Initialize: local1 = 5; tmp3 = -2 Function: local1 = local1 + tmp3; Value1 = local1

The input variables are accessed by their names and are read-only (Input1, Input2, Input3 and Input4) The local variables are accessed by using their names declared in the Initialize expression. The output variables are accessed by their names and are read/write (Value1 and Value2)

The expressions support the usual operators such as + - * /

There are built in functions than be accessed in both expressions:

d2r(angle_in_radians) r2d(angle_in_degrees) acos(angle_in_radians) asin(angle_in_radians) atan2(x, y) cos(angle_in_radians) sin(angle_in_radians) tan(x) match(a, b) match_2d(a, b, c, d) match_range(t, t0, t1, t2) match_range_2d(at, at0, at1, at2, bt, bt0, bt1, bt2) abs(value) ceil(v) clamp(x, min, max) floor(v) fraction(v) lerp(a, b, p) max(a, b) min(a, b) mod(x, y) rand(min, max) sqrt(v) square(v)

Available in Unit Flow Editor, Level Flow Editor, and External Flow Editor.