{
"v90_taillight_R": {
    "information":{
        "authors":"BeamNG",
        "name":"LED Right Taillight",
        "value":120,
    },
    "slotType" : "v90_taillight_R",
    "flexbodies": [
         ["mesh", "[group]:", "nonFlexMaterials"],
         ["v90_taillightframe_R", ["v90_taillight_R"]],
         {"deformGroup":"taillightglass_R_break", "deformMaterialBase":"v90_glass", "deformMaterialDamaged":"v90_glass_dmg"},
         ["v90_taillightglass_R", ["v90_taillight_R"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>extglassbreaksound1", "deformVolume":0.3}],
         {"deformGroup":""},
         {"deformGroup":"taillightglass_R_break", "deformMaterialBase":"v90_lights", "deformMaterialDamaged":"v90_lights_dmg"},
         ["v90_tailgatelight_R", ["v90_body"]],
         {"deformGroup":""},
    ],
    "props": [
        ["func"      , "mesh"              , "idRef:", "idX:", "idY:"            , "baseRotation"        , "rotation"                 , "translation"        , "min", "max", "offset", "multiplier"],
        {
            "lightInnerAngle":0,
            "lightOuterAngle":120,
            "lightRange":8,
            "lightColor":{"r":255, "g":10, "b":0, "a":255},
            "lightAttenuation":{"x":0, "y":1, "z":1},
            "lightCastShadows":false,
            "flareName":"vehicleBrakeLightFlare",
        },
        //taillights
        ["brakelights" ,         "SPOTLIGHT"        , "tl4r", "tl3r", "tl2r", {"x":-5, "y":-40, "z":-60} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.3, "y":0.8, "z":-0.02},"flareScale":0.04,"lightBrightness":0.05,"deformGroup":"taillightglass_R_break"}],
        ["lowhighbeam" ,         "SPOTLIGHT"        , "tl4r", "tl3r", "tl2r", {"x":-5, "y":-20, "z":-30} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.3, "y":0.2, "z":-0.02},"flareScale":0.035,"lightBrightness":0.035,"lightRange":8,"deformGroup":"taillightglass_R_break"}],
        ["lowhighbeam" ,         "SPOTLIGHT"        , "tl4r", "tl3r", "tl2r", {"x":-5, "y":-30, "z":-70} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.3, "y":0.2, "z":-0.02},"flareScale":0.035,"lightBrightness":0.035,"lightRange":8,"deformGroup":"taillightglass_R_break"}],
        {"lightColor":{"r":255, "g":255, "b":0, "a":255},},
        ["signal_R" ,         "SPOTLIGHT"        , "tl3r", "tl4r", "tl1r", {"x":190, "y":20, "z":-40} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.4, "y":0.05, "z":0.02},"flareScale":0.035,"lightBrightness":0.035,"deformGroup":"taillightglass_R_break"}],
     ],
    "nodes": [
         ["id", "posX", "posY", "posZ"],
         //--taillight--
         //right
         {"selfCollision":true},
         {"collision":true},
         {"nodeMaterial":"|NM_PLASTIC"},
         {"frictionCoef":0.5},
         {"nodeWeight":0.4},
         {"group":"v90_taillight_R"},
         ["tl1r",-0.625, 2.19, 0.93],
         ["tl2r",-0.725, 2.07, 0.93],
         ["tl3r",-0.615, 2.23, 0.79],
         ["tl4r",-0.76, 2.08, 0.79],
         ["tl5r", -0.805, 1.92, 0.81],
         {"selfCollision":false},
         {"nodeWeight":0.4},
         ["tl6r", -0.655, 2.06, 0.85],
         {"group":""},
    ],

    "beams": [
          ["id1:", "id2:"],
          //--taillight--
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"beamSpring":701000,"beamDamp":20},
          {"beamDeform":10000,"beamStrength":60000},
          //taillight main shape
          {"deformGroup":"taillightglass_R_break", "deformationTriggerRatio":0.05},
          //r
          {"deformLimitExpansion":1.1},
          ["tl1r","tl2r"],
          ["tl3r","tl4r"],
          ["tl1r","tl3r"],
          ["tl2r","tl4r"],

          ["tl1r","tl4r"],
          ["tl2r","tl3r"],

          ["tl2r","tl5r"],
          ["tl4r","tl5r"],

          ["tl6r", "tl1r"],
          ["tl6r", "tl2r"],
          ["tl6r", "tl5r"],
          ["tl6r", "tl4r"],
          ["tl6r", "tl3r"],

          //attach
          {"deformLimitExpansion":""},
          {"beamSpring":501000,"beamDamp":20},
          {"beamDeform":4000,"beamStrength":12000},
          {"breakGroup":"taillight_a_R"},
          ["tl1r", "q4r"],
          ["tl2r", "q4r"],
          ["tl3r", "q4r"],
          ["tl4r", "q4r"],
          ["tl3r", "r4rr"],
          ["tl4r", "r4rr"],
          ["tl3r", "r6rr"],
          ["tl4r", "r6rr"],
          ["tl5r", "q3r"],
          ["tl5r", "q9r"],
          ["tl6r", "q3r"],
          ["tl6r", "q9r"],
          ["tl1r", "r6"],
          ["tl3r", "r6"],
          {"breakGroup":""},
          {"deformGroup":""},

          //taillight support beams
          {"beamType":"|SUPPORT", "beamLongBound":4},
          {"beamSpring":401000,"beamDamp":20},
          {"beamDeform":5000,"beamStrength":330000},
          ["tl2r","q9r"],
          ["tl4r","q9r"],
          ["tl2r","q3r"],
          ["tl1r","q4r"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"deformLimitExpansion":1.1},
    ],
    "triangles": [
            ["id1:","id2:","id3:"],
            //right taillight
            {"groundModel":"plastic"},
            {"group":"v90_taillight_R"},
            {"dragCoef":5},
            ["tl1r","tl3r","tl4r"],
            ["tl1r","tl4r","tl2r"],
            ["tl2r", "tl4r", "tl5r"],
            {"triangleType":"NONCOLLIDABLE"},
            ["tl3r", "tl1r", "tl6r"],
            ["tl6r", "tl1r", "tl2r"],
            ["tl5r", "tl6r", "tl2r"],
            ["tl4r", "tl3r", "tl6r"],
            ["tl5r", "tl4r", "tl6r"],
            {"triangleType":"NORMALTYPE"},
            {"group":""},
    ],
},
"v90_taillight_L": {
    "information":{
        "authors":"BeamNG",
        "name":"LED Left Taillight",
        "value":120,
    },
    "slotType" : "v90_taillight_L",
    "flexbodies": [
         ["mesh", "[group]:", "nonFlexMaterials"],
         {"deformGroup":"taillightglass_L_break", "deformMaterialBase":"v90_glass", "deformMaterialDamaged":"v90_glass_dmg"},
         ["v90_taillightglass_L", ["v90_taillight_L"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>extglassbreaksound2", "deformVolume":0.3}],
         {"deformGroup":""},
         {"deformGroup":"taillightglass_L_break", "deformMaterialBase":"v90_lights", "deformMaterialDamaged":"v90_lights_dmg"},
         ["v90_tailgatelight_L", ["v90_body"]],
         {"deformGroup":""},
    ],
    "props": [
        ["func"      , "mesh"              , "idRef:", "idX:", "idY:"            , "baseRotation"        , "rotation"                 , "translation"        , "min", "max", "offset", "multiplier"],
        {
            "lightInnerAngle":0,
            "lightOuterAngle":120,
            "lightRange":8,
            "lightColor":{"r":255, "g":10, "b":0, "a":255},
            "lightAttenuation":{"x":0, "y":1, "z":1},
            "lightCastShadows":false,
            "flareName":"vehicleBrakeLightFlare",
        },
        //taillights
        ["brakelights" ,         "SPOTLIGHT"        , "tl4l", "tl3l", "tl2l", {"x":185, "y":-40, "z":60} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.3, "y":0.8, "z":0.02},"flareScale":0.04,"lightBrightness":0.05,"deformGroup":"taillightglass_L_break"}],
        ["lowhighbeam" ,         "SPOTLIGHT"        , "tl4l", "tl3l", "tl2l", {"x":185, "y":-20, "z":30} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.3, "y":0.2, "z":0.02},"flareScale":0.035,"lightBrightness":0.035,"lightRange":8,"deformGroup":"taillightglass_L_break"}],
        ["lowhighbeam" ,         "SPOTLIGHT"        , "tl4l", "tl3l", "tl2l", {"x":185, "y":-30, "z":70} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.3, "y":0.2, "z":0.02},"flareScale":0.035,"lightBrightness":0.035,"lightRange":8,"deformGroup":"taillightglass_L_break"}],
        {"lightColor":{"r":255, "g":255, "b":0, "a":255},},
        ["signal_L" ,         "SPOTLIGHT"        , "tl3l", "tl4l", "tl1l", {"x":-20, "y":20, "z":40} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.4, "y":0.05, "z":-0.02},"flareScale":0.035,"lightBrightness":0.035,"deformGroup":"taillightglass_L_break"}],
     ],
    "nodes": [
         ["id", "posX", "posY", "posZ"],
         //--taillight--
         //left
         {"selfCollision":true},
         {"collision":true},
         {"nodeMaterial":"|NM_PLASTIC"},
         {"frictionCoef":0.5},
         {"nodeWeight":0.4},
         {"group":"v90_taillight_L"},
         ["tl1l", 0.625, 2.19, 0.93],
         ["tl2l", 0.725, 2.07, 0.93],
         ["tl3l", 0.615, 2.23, 0.79],
         ["tl4l", 0.76, 2.08, 0.79],
         ["tl5l", 0.805, 1.92, 0.81],
         {"selfCollision":false},
         {"nodeWeight":0.4},
         ["tl6l", 0.655, 2.06, 0.85],
         {"group":""},

    ],
    "beams": [
          ["id1:", "id2:"],
          //--taillight--
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"beamSpring":701000,"beamDamp":20},
          {"beamDeform":10000,"beamStrength":60000},
          //taillight main shape
          {"deformGroup":"taillightglass_L_break", "deformationTriggerRatio":0.05},
          //l
          {"deformLimitExpansion":1.1},
          ["tl1l","tl2l"],
          ["tl3l","tl4l"],
          ["tl1l","tl3l"],
          ["tl2l","tl4l"],

          ["tl1l","tl4l"],
          ["tl2l","tl3l"],

          ["tl2l","tl5l"],
          ["tl4l","tl5l"],

          ["tl6l", "tl1l"],
          ["tl6l", "tl2l"],
          ["tl6l", "tl5l"],
          ["tl6l", "tl4l"],
          ["tl6l", "tl3l"],
          //attach
          {"deformLimitExpansion":""},
          {"beamSpring":501000,"beamDamp":20},
          {"beamDeform":4000,"beamStrength":12000},
          //l
          {"breakGroup":"taillight_a_L"},
          ["tl1l", "q4l"],
          ["tl2l", "q4l"],
          ["tl3l", "q4l"],
          ["tl4l", "q4l"],
          ["tl3l", "r4ll"],
          ["tl4l", "r4ll"],
          ["tl3l", "r6ll"],
          ["tl4l", "r6ll"],
          ["tl5l", "q3l"],
          ["tl5l", "q9l"],
          ["tl6l", "q3l"],
          ["tl6l", "q9l"],
          ["tl1l", "r6"],
          ["tl3l", "r6"],
          {"breakGroup":""},
          {"deformGroup":""},

          //taillight support beams
          {"beamType":"|SUPPORT", "beamLongBound":4},
          {"beamSpring":401000,"beamDamp":20},
          {"beamDeform":5000,"beamStrength":330000},
          ["tl2l","q9l"],
          ["tl4l","q9l"],
          ["tl2l","q3l"],
          ["tl1l","q4l"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"deformLimitExpansion":1.1},
    ],
    "triangles": [
            ["id1:","id2:","id3:"],
            //left taillight
            {"groundModel":"plastic"},
            {"group":"v90_taillight_L"},
            {"dragCoef":4},
            ["tl3l","tl1l","tl4l"],
            ["tl4l","tl1l","tl2l"],
            ["tl4l", "tl2l", "tl5l"],
            {"triangleType":"NONCOLLIDABLE"},
            ["tl1l", "tl3l", "tl6l"],
            ["tl1l", "tl6l", "tl2l"],
            ["tl6l", "tl5l", "tl2l"],
            ["tl3l", "tl4l", "tl6l"],
            ["tl4l", "tl5l", "tl6l"],
            {"triangleType":"NORMALTYPE"},
            {"group":""},
    ],
},
}
