polygonjs-engine
Version:
node-based webgl 3D engine https://polygonjs.com
145 lines (144 loc) • 3.77 kB
TypeScript
/**
* The following expressions are available to use in most parameters:
*
* ## variables
*
* - $F: current frame
* - $T: current time
* - $CH: current param name
* - $CEX: input centroid x component
* - $CEY: input centroid y component
* - $CEZ: input centroid z component
*
* Those variables are aliases to the javascript math module:
*
* - $E
* - $LN2
* - $LN10
* - $LOG10E
* - $LOG2E
* - $PI
* - $SQRT1_2
* - $SQRT2
*
* ## math expressions
*
* The following are native javascript functions:
*
* - abs
* - acos
* - acosh
* - asin
* - asinh
* - atan
* - atan2
* - atanh
* - ceil
* - cos
* - cosh
* - exp
* - expm1
* - floor
* - log
* - log1p
* - log2
* - log10
* - max
* - min
* - pow
* - random (which aliases to Math.rand())
* - round
* - sign
* - sin
* - sinh
* - sqrt
* - tan
* - tanh
*
* If you are targetting ES6 (available in modern browsers), you can also have:
*
* - cbrt
* - hypot
* - log10
* - trunc
*
* The following are aliases from the [Polygonjs CoreMath](https://github.com/polygonjs/polygonjs-engine/blob/master/src/core/math/_Module.ts) module:
*
* - fit
* - fit01
* - fract
* - deg2rad
* - rad2deg
* - rand
* - clamp
*
* And the following are alias to the [Polygonjs Easing](https://github.com/polygonjs/polygonjs-engine/blob/master/src/core/math/Easing.ts) module:
*
* - linear
* - ease_i
* - ease_o
* - ease_io
* - ease_i2
* - ease_o2
* - ease_io2
* - ease_i3
* - ease_o3
* - ease_io3
* - ease_i4
* - ease_o4
* - ease_io4
* - ease_i_sin
* - ease_o_sin
* - ease_io_sin
* - ease_i_elastic
* - ease_o_elastic
* - ease_io_elastic
*
*
* ## string expressions:
*
* - precision (alias to the [CoreString](https://github.com/polygonjs/polygonjs-engine/blob/master/src/core/String.ts) module precision method)
* - [strCharsCount](/docs/expressions/strCharsCount)
* - [strConcat](/docs/expressions/strConcat)
* - [strIndex](/docs/expressions/strIndex)
* - [strSub](/docs/expressions/strSub)
*
* */
import { BaseParamType } from '../../params/_Base';
import { CoreGraphNode } from '../../../core/graph/CoreGraphNode';
import { ParsedTree } from './ParsedTree';
import jsep from 'jsep';
import { BaseTraverser } from './_Base';
import { MethodDependency } from '../MethodDependency';
export declare class FunctionGenerator extends BaseTraverser {
param: BaseParamType;
private function;
private _attribute_requirements_controller;
private function_main_string;
private methods;
private method_index;
method_dependencies: MethodDependency[];
immutable_dependencies: CoreGraphNode[];
constructor(param: BaseParamType);
parse_tree(parsed_tree: ParsedTree): void;
reset(): void;
function_body(): string;
eval_allowed(): boolean;
eval_function(): any;
protected traverse_CallExpression(node: jsep.CallExpression): string | undefined;
protected traverse_BinaryExpression(node: jsep.BinaryExpression): string;
protected traverse_LogicalExpression(node: jsep.LogicalExpression): string;
protected traverse_MemberExpression(node: jsep.MemberExpression): string;
protected traverse_UnaryExpression(node: jsep.UnaryExpression): string;
protected traverse_Literal(node: jsep.Literal): string;
protected traverse_Identifier(node: jsep.Identifier): string | undefined;
protected traverse_Identifier_F(): string;
protected traverse_Identifier_FPS(): string;
protected traverse_Identifier_T(): string;
protected traverse_Identifier_CH(): string;
protected traverse_Identifier_CEX(): string;
protected traverse_Identifier_CEY(): string;
protected traverse_Identifier_CEZ(): string;
private _method_centroid;
private _create_method_and_dependencies;
}