|
|
@@ -1,6 +1,6 @@
|
|
|
import TempNode from '../core/TempNode.js';
|
|
|
import { sub, mul, div, mod, equal } from './OperatorNode.js';
|
|
|
-import { addMethodChaining, nodeObject, nodeProxyIntention, float, vec2, vec3, vec4, Fn } from '../tsl/TSLCore.js';
|
|
|
+import { addMethodChaining, nodeObject, nodeProxy, float, vec2, vec3, vec4, Fn } from '../tsl/TSLCore.js';
|
|
|
import { WebGLCoordinateSystem, WebGPUCoordinateSystem } from '../../constants.js';
|
|
|
|
|
|
/**
|
|
|
@@ -429,7 +429,7 @@ export const PI2 = /*@__PURE__*/ float( Math.PI * 2 );
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node<bool>}
|
|
|
*/
|
|
|
-export const all = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ALL ).setParameterLength( 1 );
|
|
|
+export const all = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ALL ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns `true` if any components of `x` are `true`.
|
|
|
@@ -439,7 +439,7 @@ export const all = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ALL ).se
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node<bool>}
|
|
|
*/
|
|
|
-export const any = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ANY ).setParameterLength( 1 );
|
|
|
+export const any = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ANY ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Converts a quantity in degrees to radians.
|
|
|
@@ -449,7 +449,7 @@ export const any = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ANY ).se
|
|
|
* @param {Node | number} x - The input in degrees.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const radians = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.RADIANS ).setParameterLength( 1 );
|
|
|
+export const radians = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RADIANS ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Convert a quantity in radians to degrees.
|
|
|
@@ -459,7 +459,7 @@ export const radians = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.RADI
|
|
|
* @param {Node | number} x - The input in radians.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const degrees = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.DEGREES ).setParameterLength( 1 );
|
|
|
+export const degrees = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DEGREES ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the natural exponentiation of the parameter.
|
|
|
@@ -469,7 +469,7 @@ export const degrees = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.DEGR
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const exp = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.EXP ).setParameterLength( 1 );
|
|
|
+export const exp = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns 2 raised to the power of the parameter.
|
|
|
@@ -479,7 +479,7 @@ export const exp = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.EXP ).se
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const exp2 = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.EXP2 ).setParameterLength( 1 );
|
|
|
+export const exp2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP2 ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the natural logarithm of the parameter.
|
|
|
@@ -489,7 +489,7 @@ export const exp2 = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.EXP2 ).
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const log = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.LOG ).setParameterLength( 1 );
|
|
|
+export const log = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the base 2 logarithm of the parameter.
|
|
|
@@ -499,7 +499,7 @@ export const log = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.LOG ).se
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const log2 = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.LOG2 ).setParameterLength( 1 );
|
|
|
+export const log2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG2 ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the square root of the parameter.
|
|
|
@@ -509,7 +509,7 @@ export const log2 = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.LOG2 ).
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const sqrt = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.SQRT ).setParameterLength( 1 );
|
|
|
+export const sqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SQRT ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the inverse of the square root of the parameter.
|
|
|
@@ -519,7 +519,7 @@ export const sqrt = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.SQRT ).
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const inverseSqrt = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.INVERSE_SQRT ).setParameterLength( 1 );
|
|
|
+export const inverseSqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.INVERSE_SQRT ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Finds the nearest integer less than or equal to the parameter.
|
|
|
@@ -529,7 +529,7 @@ export const inverseSqrt = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const floor = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.FLOOR ).setParameterLength( 1 );
|
|
|
+export const floor = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FLOOR ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Finds the nearest integer that is greater than or equal to the parameter.
|
|
|
@@ -539,7 +539,7 @@ export const floor = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.FLOOR
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const ceil = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.CEIL ).setParameterLength( 1 );
|
|
|
+export const ceil = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CEIL ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Calculates the unit vector in the same direction as the original vector.
|
|
|
@@ -549,7 +549,7 @@ export const ceil = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.CEIL ).
|
|
|
* @param {Node} x - The input vector.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const normalize = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.NORMALIZE ).setParameterLength( 1 );
|
|
|
+export const normalize = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NORMALIZE ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Computes the fractional part of the parameter.
|
|
|
@@ -559,7 +559,7 @@ export const normalize = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.NO
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const fract = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.FRACT ).setParameterLength( 1 );
|
|
|
+export const fract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FRACT ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the sine of the parameter.
|
|
|
@@ -569,7 +569,7 @@ export const fract = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.FRACT
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const sin = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.SIN ).setParameterLength( 1 );
|
|
|
+export const sin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIN ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the cosine of the parameter.
|
|
|
@@ -579,7 +579,7 @@ export const sin = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.SIN ).se
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const cos = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.COS ).setParameterLength( 1 );
|
|
|
+export const cos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.COS ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the tangent of the parameter.
|
|
|
@@ -589,7 +589,7 @@ export const cos = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.COS ).se
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const tan = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.TAN ).setParameterLength( 1 );
|
|
|
+export const tan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TAN ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the arcsine of the parameter.
|
|
|
@@ -599,7 +599,7 @@ export const tan = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.TAN ).se
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const asin = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ASIN ).setParameterLength( 1 );
|
|
|
+export const asin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ASIN ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the arccosine of the parameter.
|
|
|
@@ -609,7 +609,7 @@ export const asin = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ASIN ).
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const acos = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ACOS ).setParameterLength( 1 );
|
|
|
+export const acos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ACOS ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the arc-tangent of the parameter.
|
|
|
@@ -621,7 +621,7 @@ export const acos = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ACOS ).
|
|
|
* @param {?(Node | number)} x - The x parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const atan = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ATAN ).setParameterLength( 1, 2 );
|
|
|
+export const atan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ATAN ).setParameterLength( 1, 2 );
|
|
|
|
|
|
/**
|
|
|
* Returns the absolute value of the parameter.
|
|
|
@@ -631,7 +631,7 @@ export const atan = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ATAN ).
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const abs = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ABS ).setParameterLength( 1 );
|
|
|
+export const abs = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ABS ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Extracts the sign of the parameter.
|
|
|
@@ -641,7 +641,7 @@ export const abs = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ABS ).se
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const sign = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.SIGN ).setParameterLength( 1 );
|
|
|
+export const sign = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIGN ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Calculates the length of a vector.
|
|
|
@@ -651,7 +651,7 @@ export const sign = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.SIGN ).
|
|
|
* @param {Node} x - The parameter.
|
|
|
* @returns {Node<float>}
|
|
|
*/
|
|
|
-export const length = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.LENGTH ).setParameterLength( 1 );
|
|
|
+export const length = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LENGTH ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Negates the value of the parameter (-x).
|
|
|
@@ -661,7 +661,7 @@ export const length = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.LENGT
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const negate = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.NEGATE ).setParameterLength( 1 );
|
|
|
+export const negate = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NEGATE ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Return `1` minus the parameter.
|
|
|
@@ -671,7 +671,7 @@ export const negate = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.NEGAT
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const oneMinus = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ONE_MINUS ).setParameterLength( 1 );
|
|
|
+export const oneMinus = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ONE_MINUS ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the partial derivative of the parameter with respect to x.
|
|
|
@@ -681,7 +681,7 @@ export const oneMinus = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ONE
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const dFdx = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.DFDX ).setParameterLength( 1 );
|
|
|
+export const dFdx = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDX ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the partial derivative of the parameter with respect to y.
|
|
|
@@ -691,7 +691,7 @@ export const dFdx = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.DFDX ).
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const dFdy = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.DFDY ).setParameterLength( 1 );
|
|
|
+export const dFdy = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDY ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Rounds the parameter to the nearest integer.
|
|
|
@@ -701,7 +701,7 @@ export const dFdy = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.DFDY ).
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const round = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ROUND ).setParameterLength( 1 );
|
|
|
+export const round = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ROUND ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the reciprocal of the parameter `(1/x)`.
|
|
|
@@ -711,7 +711,7 @@ export const round = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.ROUND
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const reciprocal = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.RECIPROCAL ).setParameterLength( 1 );
|
|
|
+export const reciprocal = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RECIPROCAL ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Truncates the parameter, removing the fractional part.
|
|
|
@@ -721,7 +721,7 @@ export const reciprocal = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.R
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const trunc = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.TRUNC ).setParameterLength( 1 );
|
|
|
+export const trunc = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRUNC ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the sum of the absolute derivatives in x and y.
|
|
|
@@ -731,7 +731,7 @@ export const trunc = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.TRUNC
|
|
|
* @param {Node | number} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const fwidth = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.FWIDTH ).setParameterLength( 1 );
|
|
|
+export const fwidth = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FWIDTH ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the transpose of a matrix.
|
|
|
@@ -741,7 +741,7 @@ export const fwidth = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.FWIDT
|
|
|
* @param {Node<mat2|mat3|mat4>} x - The parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const transpose = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.TRANSPOSE ).setParameterLength( 1 );
|
|
|
+export const transpose = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRANSPOSE ).setParameterLength( 1 );
|
|
|
|
|
|
// 2 inputs
|
|
|
|
|
|
@@ -754,7 +754,7 @@ export const transpose = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.TR
|
|
|
* @param {string} y - The new type.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const bitcast = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.BITCAST ).setParameterLength( 2 );
|
|
|
+export const bitcast = /*@__PURE__*/ nodeProxy( MathNode, MathNode.BITCAST ).setParameterLength( 2 );
|
|
|
|
|
|
/**
|
|
|
* Returns `true` if `x` equals `y`.
|
|
|
@@ -781,7 +781,7 @@ export const equals = ( x, y ) => { // @deprecated, r172
|
|
|
* @param {...(Node | number)} values - The values to compare.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const min = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.MIN ).setParameterLength( 2, Infinity );
|
|
|
+export const min = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MIN ).setParameterLength( 2, Infinity );
|
|
|
|
|
|
/**
|
|
|
* Returns the greatest of the given values.
|
|
|
@@ -791,7 +791,7 @@ export const min = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.MIN ).se
|
|
|
* @param {...(Node | number)} values - The values to compare.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const max = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.MAX ).setParameterLength( 2, Infinity );
|
|
|
+export const max = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MAX ).setParameterLength( 2, Infinity );
|
|
|
|
|
|
/**
|
|
|
* Generate a step function by comparing two values.
|
|
|
@@ -802,7 +802,7 @@ export const max = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.MAX ).se
|
|
|
* @param {Node | number} y - The x parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const step = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.STEP ).setParameterLength( 2 );
|
|
|
+export const step = /*@__PURE__*/ nodeProxy( MathNode, MathNode.STEP ).setParameterLength( 2 );
|
|
|
|
|
|
/**
|
|
|
* Calculates the reflection direction for an incident vector.
|
|
|
@@ -813,7 +813,7 @@ export const step = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.STEP ).
|
|
|
* @param {Node<vec2|vec3|vec4>} N - The normal vector.
|
|
|
* @returns {Node<vec2|vec3|vec4>}
|
|
|
*/
|
|
|
-export const reflect = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.REFLECT ).setParameterLength( 2 );
|
|
|
+export const reflect = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFLECT ).setParameterLength( 2 );
|
|
|
|
|
|
/**
|
|
|
* Calculates the distance between two points.
|
|
|
@@ -824,7 +824,7 @@ export const reflect = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.REFL
|
|
|
* @param {Node<vec2|vec3|vec4>} y - The second point.
|
|
|
* @returns {Node<float>}
|
|
|
*/
|
|
|
-export const distance = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.DISTANCE ).setParameterLength( 2 );
|
|
|
+export const distance = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DISTANCE ).setParameterLength( 2 );
|
|
|
|
|
|
/**
|
|
|
* Calculates the absolute difference between two values.
|
|
|
@@ -835,7 +835,7 @@ export const distance = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.DIS
|
|
|
* @param {Node | number} y - The second parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const difference = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.DIFFERENCE ).setParameterLength( 2 );
|
|
|
+export const difference = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DIFFERENCE ).setParameterLength( 2 );
|
|
|
|
|
|
/**
|
|
|
* Calculates the dot product of two vectors.
|
|
|
@@ -846,7 +846,7 @@ export const difference = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.D
|
|
|
* @param {Node<vec2|vec3|vec4>} y - The second vector.
|
|
|
* @returns {Node<float>}
|
|
|
*/
|
|
|
-export const dot = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.DOT ).setParameterLength( 2 );
|
|
|
+export const dot = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DOT ).setParameterLength( 2 );
|
|
|
|
|
|
/**
|
|
|
* Calculates the cross product of two vectors.
|
|
|
@@ -857,7 +857,7 @@ export const dot = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.DOT ).se
|
|
|
* @param {Node<vec2|vec3|vec4>} y - The second vector.
|
|
|
* @returns {Node<vec2|vec3|vec4>}
|
|
|
*/
|
|
|
-export const cross = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.CROSS ).setParameterLength( 2 );
|
|
|
+export const cross = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CROSS ).setParameterLength( 2 );
|
|
|
|
|
|
/**
|
|
|
* Return the value of the first parameter raised to the power of the second one.
|
|
|
@@ -868,7 +868,7 @@ export const cross = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.CROSS
|
|
|
* @param {Node | number} y - The second parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const pow = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.POW ).setParameterLength( 2 );
|
|
|
+export const pow = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW ).setParameterLength( 2 );
|
|
|
|
|
|
/**
|
|
|
* Returns the square of the parameter.
|
|
|
@@ -878,7 +878,7 @@ export const pow = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.POW ).se
|
|
|
* @param {Node | number} x - The first parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const pow2 = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.POW, 2 ).setParameterLength( 1 );
|
|
|
+export const pow2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 2 ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the cube of the parameter.
|
|
|
@@ -888,7 +888,7 @@ export const pow2 = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.POW, 2
|
|
|
* @param {Node | number} x - The first parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const pow3 = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.POW, 3 ).setParameterLength( 1 );
|
|
|
+export const pow3 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 3 ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Returns the fourth power of the parameter.
|
|
|
@@ -898,7 +898,7 @@ export const pow3 = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.POW, 3
|
|
|
* @param {Node | number} x - The first parameter.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const pow4 = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.POW, 4 ).setParameterLength( 1 );
|
|
|
+export const pow4 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 4 ).setParameterLength( 1 );
|
|
|
|
|
|
/**
|
|
|
* Transforms the direction of a vector by a matrix and then normalizes the result.
|
|
|
@@ -909,7 +909,7 @@ export const pow4 = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.POW, 4
|
|
|
* @param {Node<mat2|mat3|mat4>} matrix - The transformation matrix.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const transformDirection = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.TRANSFORM_DIRECTION ).setParameterLength( 2 );
|
|
|
+export const transformDirection = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRANSFORM_DIRECTION ).setParameterLength( 2 );
|
|
|
|
|
|
/**
|
|
|
* Returns the cube root of a number.
|
|
|
@@ -941,7 +941,7 @@ export const lengthSq = ( a ) => dot( a, a );
|
|
|
* @param {Node | number} t - The interpolation value.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const mix = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.MIX ).setParameterLength( 3 );
|
|
|
+export const mix = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MIX ).setParameterLength( 3 );
|
|
|
|
|
|
/**
|
|
|
* Constrains a value to lie between two further values.
|
|
|
@@ -975,7 +975,7 @@ export const saturate = ( value ) => clamp( value );
|
|
|
* @param {Node<float>} eta - The ratio of indices of refraction.
|
|
|
* @returns {Node<vec2|vec3|vec4>}
|
|
|
*/
|
|
|
-export const refract = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.REFRACT ).setParameterLength( 3 );
|
|
|
+export const refract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFRACT ).setParameterLength( 3 );
|
|
|
|
|
|
/**
|
|
|
* Performs a Hermite interpolation between two values.
|
|
|
@@ -987,7 +987,7 @@ export const refract = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.REFR
|
|
|
* @param {Node | number} x - The source value for interpolation.
|
|
|
* @returns {Node}
|
|
|
*/
|
|
|
-export const smoothstep = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.SMOOTHSTEP ).setParameterLength( 3 );
|
|
|
+export const smoothstep = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SMOOTHSTEP ).setParameterLength( 3 );
|
|
|
|
|
|
/**
|
|
|
* Returns a vector pointing in the same direction as another.
|
|
|
@@ -999,7 +999,7 @@ export const smoothstep = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.S
|
|
|
* @param {Node<vec2|vec3|vec4>} Nref - The reference vector.
|
|
|
* @returns {Node<vec2|vec3|vec4>}
|
|
|
*/
|
|
|
-export const faceForward = /*@__PURE__*/ nodeProxyIntention( MathNode, MathNode.FACEFORWARD ).setParameterLength( 3 );
|
|
|
+export const faceForward = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FACEFORWARD ).setParameterLength( 3 );
|
|
|
|
|
|
/**
|
|
|
* Returns a random value for the given uv.
|