Repository: FlaxEngine/FlaxEngine
File: Source/Engine/Visject/VisjectGraph.cpp (C++)

Code before:
        // Near Equal
    case 42:
    {
        const Value a = tryGetValue(node->GetBox(0), node->Values[0]);
        const Value b = tryGetValue(node->GetBox(1), node->Values[1]).Cast(a.Type);
        const float epsilon = (float)tryGetValue(node->GetBox(2), node->Values[2]);
        value = Value::NearEqual(a, b, epsilon);
        break;
    }
        // Enum Value
    case 45:
        value = (uint64)tryGetValue(node->GetBox(0), Value::Zero);
        break;
        // Enum AND
    case 46:
        value = tryGetValue(node->GetBox(0), Value::Zero);
        if (value.Type.Type == VariantType::Enum)
            value.AsUint64 = value.AsUint64 & (uint64)tryGetValue(node->GetBox(1), Value::Zero);
        break;
        // Enum OR
    case 47:
        value = tryGetValue(node->GetBox(0), Value::Zero);
        if (value.Type.Type == VariantType::Enum)
            value.AsUint64 = value.AsUint64 | (uint64)tryGetValue(node->GetBox(1), Value::Zero);
        break;

    case 48:
    {
        const float inVal  = tryGetValue(node->GetBox(0), node->Values[0]).AsFloat;
        const Vector2 rangeA = tryGetValue(node->GetBox(1), node->Values[1]).AsVector2();
        const Vector2 rangeB = tryGetValue(node->GetBox(2), node->Values[2]).AsVector2();

        auto mapFunc = rangeB.X + (inVal - rangeA.X) * (rangeB.Y - rangeB.X) / (rangeA.Y - rangeA.X);
        
        // Clamp value?
        value = node->Values[3].AsBool ? Math::Clamp(mapFunc, rangeB.X, rangeB.Y) : mapFunc;
        break;
    }
    default:
        break;
    }
}

void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value)
{
    switch (node->TypeID)
    {
        // Pack
    case 20:
    {
        float vX = (float)tryGetValue(node->GetBox(1), node->Values[0]);

Review comment (suggestion):
Missing `// Remap` comment to mark the node type impl section.

Code after:
        // Near Equal
    case 42:
    {
        const Value a = tryGetValue(node->GetBox(0), node->Values[0]);
        const Value b = tryGetValue(node->GetBox(1), node->Values[1]).Cast(a.Type);
        const float epsilon = (float)tryGetValue(node->GetBox(2), node->Values[2]);
        value = Value::NearEqual(a, b, epsilon);
        break;
    }
        // Enum Value
    case 45:
        value = (uint64)tryGetValue(node->GetBox(0), Value::Zero);
        break;
        // Enum AND
    case 46:
        value = tryGetValue(node->GetBox(0), Value::Zero);
        if (value.Type.Type == VariantType::Enum)
            value.AsUint64 = value.AsUint64 & (uint64)tryGetValue(node->GetBox(1), Value::Zero);
        break;
        // Enum OR
    case 47:
        value = tryGetValue(node->GetBox(0), Value::Zero);
        if (value.Type.Type == VariantType::Enum)
            value.AsUint64 = value.AsUint64 | (uint64)tryGetValue(node->GetBox(1), Value::Zero);
        break;
        // Remap
    case 48:
    {
        const float inVal  = tryGetValue(node->GetBox(0), node->Values[0]).AsFloat;
        const Vector2 rangeA = tryGetValue(node->GetBox(1), node->Values[1]).AsVector2();
        const Vector2 rangeB = tryGetValue(node->GetBox(2), node->Values[2]).AsVector2();
        const bool clamp = tryGetValue(node->GetBox(3), node->Values[3]).AsBool;

        auto mapFunc = rangeB.X + (inVal - rangeA.X) * (rangeB.Y - rangeB.X) / (rangeA.Y - rangeA.X);
        
        // Clamp value?
        value = clamp ? Math::Clamp(mapFunc, rangeB.X, rangeB.Y) : mapFunc;
        break;
    }
    default:
        break;
    }
}

void VisjectExecutor::ProcessGroupPacking(Box* box, Node* node, Value& value)
{
    switch (node->TypeID)
    {
        // Pack
    case 20:
    {