1+ export type MethodCallDef = {
2+ name :string
3+ params :number
4+ desc :string
5+ symbol ?:string
6+
7+ /**
8+ * If true it means the name is the name of a function, not the name of a method in the 1st input.
9+ */
10+ isStandalone ?:boolean
11+ }
12+
13+ export const mathOperations :MethodCallDef [ ] = [
14+ { "name" : "add" , "params" : 2 , "desc" : "Return the addition of two or more value." , "symbol" : "+" } ,
15+ { "name" : "sub" , "params" : 2 , "desc" : "Return the subtraction of two or more value." , "symbol" : "−" } ,
16+ { "name" : "mul" , "params" : 2 , "desc" : "Return the multiplication of two or more value." , "symbol" : "×" } ,
17+ { "name" : "div" , "params" : 2 , "desc" : "Return the division of two or more value." , "symbol" : "÷" } ,
18+ { "name" : "assign" , "params" : 2 , "desc" : "Assign one or more value to a and return the same." , "symbol" : "=" } ,
19+ { "name" : "mod" , "params" : 2 , "desc" : "Computes the remainder of dividing the first node by the second." , "symbol" : "%" } ,
20+ { "name" : "equal" , "params" : 2 , "desc" : "Checks if two nodes are equal." , "symbol" : "==" } ,
21+ { "name" : "notEqual" , "params" : 2 , "desc" : "Checks if two nodes are not equal." , "symbol" : "≠" } ,
22+ { "name" : "lessThan" , "params" : 2 , "desc" : "Checks if the first node is less than the second." , "symbol" : "<" } ,
23+ { "name" : "greaterThan" , "params" : 2 , "desc" : "Checks if the first node is greater than the second." , "symbol" : ">" } ,
24+ { "name" : "lessThanEqual" , "params" : 2 , "desc" : "Checks if the first node is less than or equal to the second." , "symbol" : "≤" } ,
25+ { "name" : "greaterThanEqual" , "params" : 2 , "desc" : "Checks if the first node is greater than or equal to the second." , "symbol" : "≥" } ,
26+ { "name" : "and" , "params" : 2 , "desc" : "Performs logical AND on two nodes." , "symbol" : "&&" } ,
27+ { "name" : "or" , "params" : 2 , "desc" : "Performs logical OR on two nodes." , "symbol" : "||" } ,
28+ { "name" : "not" , "params" : 1 , "desc" : "Performs logical NOT on a node." , "symbol" : "!" } ,
29+ { "name" : "xor" , "params" : 2 , "desc" : "Performs logical XOR on two nodes." , "symbol" : "⊕" } ,
30+ { "name" : "bitAnd" , "params" : 2 , "desc" : "Performs bitwise AND on two nodes." , "symbol" : "&" } ,
31+ { "name" : "bitNot" , "params" : 1 , "desc" : "Performs bitwise NOT on a node." , "symbol" : "~" } ,
32+ { "name" : "bitOr" , "params" : 2 , "desc" : "Performs bitwise OR on two nodes." , "symbol" : "|" } ,
33+ { "name" : "bitXor" , "params" : 2 , "desc" : "Performs bitwise XOR on two nodes." , "symbol" : "^" } ,
34+ { "name" : "shiftLeft" , "params" : 2 , "desc" : "Shifts a node to the left." , "symbol" : "<<" } ,
35+ { "name" : "shiftRight" , "params" : 2 , "desc" : "Shifts a node to the right." , "symbol" : ">>" }
36+ ] ;
37+
38+ export const mathFunctions :MethodCallDef [ ] = [
39+ { "name" : "EPSILON" , "params" : 0 , "desc" : "A small value used to handle floating-point precision errors." } ,
40+ { "name" : "INFINITY" , "params" : 0 , "desc" : "Represent infinity." } ,
41+ { "name" : "abs" , "params" : 1 , "desc" : "Return the absolute value of the parameter." } ,
42+ { "name" : "acos" , "params" : 1 , "desc" : "Return the arccosine of the parameter." } ,
43+ { "name" : "all" , "params" : 1 , "desc" : "Return true if all components of x are true." } ,
44+ { "name" : "any" , "params" : 1 , "desc" : "Return true if any component of x is true." } ,
45+ { "name" : "asin" , "params" : 1 , "desc" : "Return the arcsine of the parameter." } ,
46+ { "name" : "atan" , "params" : 2 , "desc" : "Return the arc-tangent of the parameters." } ,
47+ { "name" : "bitcast" , "params" : 2 , "desc" : "Reinterpret the bits of a value as a different type." } ,
48+ { "name" : "cbrt" , "params" : 1 , "desc" : "Return the cube root of the parameter." } ,
49+ { "name" : "ceil" , "params" : 1 , "desc" : "Find the nearest integer that is greater than or equal to the parameter." } ,
50+ { "name" : "clamp" , "params" : 3 , "desc" : "Constrain a value to lie between two further values." } ,
51+ { "name" : "cos" , "params" : 1 , "desc" : "Return the cosine of the parameter." } ,
52+ { "name" : "cross" , "params" : 2 , "desc" : "Calculate the cross product of two vectors." } ,
53+ { "name" : "dFdx" , "params" : 1 , "desc" : "Return the partial derivative of an argument with respect to x." } ,
54+ { "name" : "dFdy" , "params" : 1 , "desc" : "Return the partial derivative of an argument with respect to y." } ,
55+ { "name" : "degrees" , "params" : 1 , "desc" : "Convert a quantity in radians to degrees." } ,
56+ { "name" : "difference" , "params" : 2 , "desc" : "Calculate the absolute difference between two values." } ,
57+ { "name" : "distance" , "params" : 2 , "desc" : "Calculate the distance between two points." } ,
58+ { "name" : "dot" , "params" : 2 , "desc" : "Calculate the dot product of two vectors." } ,
59+ { "name" : "equals" , "params" : 2 , "desc" : "Return true if x equals y." } ,
60+ { "name" : "exp" , "params" : 1 , "desc" : "Return the natural exponentiation of the parameter." } ,
61+ { "name" : "exp2" , "params" : 1 , "desc" : "Return 2 raised to the power of the parameter." } ,
62+ { "name" : "faceforward" , "params" : 3 , "desc" : "Return a vector pointing in the same direction as another." } ,
63+ { "name" : "floor" , "params" : 1 , "desc" : "Find the nearest integer less than or equal to the parameter." } ,
64+ { "name" : "fract" , "params" : 1 , "desc" : "Compute the fractional part of the argument." } ,
65+ { "name" : "fwidth" , "params" : 1 , "desc" : "Return the sum of the absolute derivatives in x and y." } ,
66+ { "name" : "inverseSqrt" , "params" : 1 , "desc" : "Return the inverse of the square root of the parameter." } ,
67+ { "name" : "invert" , "params" : 1 , "desc" : "Invert an alpha parameter ( 1. - x )." } ,
68+ { "name" : "length" , "params" : 1 , "desc" : "Calculate the length of a vector." } ,
69+ { "name" : "lengthSq" , "params" : 1 , "desc" : "Calculate the squared length of a vector." } ,
70+ { "name" : "log" , "params" : 1 , "desc" : "Return the natural logarithm of the parameter." } ,
71+ { "name" : "log2" , "params" : 1 , "desc" : "Return the base 2 logarithm of the parameter." } ,
72+ { "name" : "max" , "params" : 2 , "desc" : "Return the greater of two values." } ,
73+ { "name" : "min" , "params" : 2 , "desc" : "Return the lesser of two values." } ,
74+ { "name" : "mix" , "params" : 3 , "desc" : "Linearly interpolate between two values." } ,
75+ { "name" : "negate" , "params" : 1 , "desc" : "Negate the value of the parameter ( -x )." } ,
76+ { "name" : "normalize" , "params" : 1 , "desc" : "Calculate the unit vector in the same direction as the original vector." } ,
77+ { "name" : "oneMinus" , "params" : 1 , "desc" : "Return 1 minus the parameter." } ,
78+ { "name" : "pow" , "params" : 2 , "desc" : "Return the value of the first parameter raised to the power of the second." } ,
79+ { "name" : "pow2" , "params" : 1 , "desc" : "Return the square of the parameter." } ,
80+ { "name" : "pow3" , "params" : 1 , "desc" : "Return the cube of the parameter." } ,
81+ { "name" : "pow4" , "params" : 1 , "desc" : "Return the fourth power of the parameter." } ,
82+ { "name" : "radians" , "params" : 1 , "desc" : "Convert a quantity in degrees to radians." } ,
83+ { "name" : "reciprocal" , "params" : 1 , "desc" : "Return the reciprocal of the parameter (1/x)." } ,
84+ { "name" : "reflect" , "params" : 2 , "desc" : "Calculate the reflection direction for an incident vector." } ,
85+ { "name" : "refract" , "params" : 3 , "desc" : "Calculate the refraction direction for an incident vector." } ,
86+ { "name" : "round" , "params" : 1 , "desc" : "Round the parameter to the nearest integer." } ,
87+ { "name" : "saturate" , "params" : 1 , "desc" : "Constrain a value between 0 and 1." } ,
88+ { "name" : "sign" , "params" : 1 , "desc" : "Extract the sign of the parameter." } ,
89+ { "name" : "sin" , "params" : 1 , "desc" : "Return the sine of the parameter." } ,
90+ { "name" : "smoothstep" , "params" : 3 , "desc" : "Perform Hermite interpolation between two values." } ,
91+ { "name" : "sqrt" , "params" : 1 , "desc" : "Return the square root of the parameter." } ,
92+ { "name" : "step" , "params" : 2 , "desc" : "Generate a step function by comparing two values." } ,
93+ { "name" : "tan" , "params" : 1 , "desc" : "Return the tangent of the parameter." } ,
94+ { "name" : "transformDirection" , "params" : 2 , "desc" : "Transform the direction of a vector by a matrix and then normalize the result." } ,
95+ { "name" : "trunc" , "params" : 1 , "desc" : "Truncate the parameter, removing the fractional part." }
96+ ]
0 commit comments