MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / ProcessGroupBoolean

Method ProcessGroupBoolean

Source/Engine/Visject/VisjectGraph.cpp:1112–1162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1110}
1111
1112void VisjectExecutor::ProcessGroupBoolean(Box* box, Node* node, Value& value)
1113{
1114 switch (node->TypeID)
1115 {
1116 // NOT
1117 case 1:
1118 {
1119 const bool a = (bool)tryGetValue(node->GetBox(0), Value::False);
1120 value = !a;
1121 break;
1122 }
1123 // AND, OR, XOR, NOR, NAND
1124 case 2:
1125 case 3:
1126 case 4:
1127 case 5:
1128 case 6:
1129 {
1130 const bool a = (bool)tryGetValue(node->GetBox(0), 0, node->Values[0]);
1131 const bool b = (bool)tryGetValue(node->GetBox(1), 1, node->Values[1]);
1132 bool result = false;
1133 switch (node->TypeID)
1134 {
1135 // AND
1136 case 2:
1137 result = a && b;
1138 break;
1139 // OR
1140 case 3:
1141 result = a || b;
1142 break;
1143 // XOR
1144 case 4:
1145 result = !a != !b;
1146 break;
1147 // NOR
1148 case 5:
1149 result = !(a || b);
1150 break;
1151 // NAND
1152 case 6:
1153 result = !(a && b);
1154 break;
1155 }
1156 value = result;
1157 break;
1158 }
1159 default:
1160 break;
1161 }
1162}
1163
1164void VisjectExecutor::ProcessGroupBitwise(Box* box, Node* node, Value& value)
1165{

Callers

nothing calls this directly

Calls 1

GetBoxMethod · 0.45

Tested by

no test coverage detected