TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ Evaluate()

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

Implements NodeEditorNode.

Definition at line 9 of file SquareNode.cpp.

10{
11 float x = 1;
12
13 if (inputPins[0]->IsLinked())
14 {
15 x = inputPins[0]->other->Evaluate(input).value;
16 }
17
18 else
19 {
20 x = value1;
21 }
22
23 x = x * x;
24
25 if (inputPins[1]->IsLinked())
26 {
27 x *= inputPins[1]->other->Evaluate(input).value;
28 }
29
30 else
31 {
32 x *= value2;
33 }
34
35 return NodeOutput({ x });
36}