TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ Evaluate()

NodeOutput MathFunctionNode::Evaluate ( NodeInputParam  input,
NodeEditorPin pin 
)
virtual

Implements NodeEditorNode.

Definition at line 18 of file MathFunctionNode.cpp.

19{
20 try
21 {
22 if (input.maxZ == 0)
23 {
24 input.maxZ = 1;
25 }
26
27 x = (input.x / input.maxX) * 2 - 1;
28 y = (input.y / input.maxY) * 2 - 1;
29 z = (input.z / input.maxZ) * 2 - 1;
30 return NodeOutput({(float)parser->Eval() * factor});
31 }
32
33 catch (...)
34 {
35 }
36
37 return NodeOutput({0.0f});
38}