{
"sprtg_taillight_R2": {
    "information":{
        "authors":"BeamNG",
        "name":"Right Taillight",
        "value":110,
    },
    "slotType" : "sprtg_taillight_R2",
    "flexbodies": [
         ["mesh", "[group]:", "nonFlexMaterials"],
         ["sprtg_taillights_frame_R2", ["sprtg_taillight_R"]],

         {"deformGroup":"taillightglass_R_break", "deformMaterialBase":"sprtg_glass", "deformMaterialDamaged":"sprtg_glass_dmg"},
         ["sprtg_taillightsglass_R2", ["sprtg_taillight_R"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>extglassbreaksound1", "deformVolume":0.3}],

         {"deformGroup":"taillightglass_R_break", "deformMaterialBase":"sprtg_blacke", "deformMaterialDamaged":"sprtg_blacke"},
         ["sprtg_taillight_R2", ["sprtg_taillight_R"]],
         {"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"        , "tl3r", "tl2r", "tl1r", {"x":-40, "y":0, "z":-20} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.2, "y":0.75, "z":0.03},"flareScale":0.0,"lightBrightness":0.06,"deformGroup":"taillightglass_R_break"}],
        ["lowhighbeam" ,         "SPOTLIGHT"        , "tl3r", "tl2r", "tl1r", {"x":-40, "y":0, "z":-20} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.2, "y":0.35, "z":0.03},"flareScale":0.0,"lightBrightness":0.04,"lightRange":8,"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":"sprtg_taillight_R"},
         ["tl1r",-0.7026,2.2532,1.0955],
         ["tl2r",-0.6648,2.2925,0.8925],
         ["tl3r",-0.7909,2.208,0.9131],
         ["tl4r",-0.8639,1.9846,0.9656],
         {"selfCollision":false},
         {"nodeWeight":0.4},
         ["tl5r",-0.7459,2.0892,0.9577],
         {"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},
          {"deformLimitExpansion":1.2},
          ["tl1r", "tl2r"],
          ["tl2r", "tl3r"],
          ["tl3r", "tl4r"],
          ["tl4r", "tl1r"],
          ["tl1r", "tl3r"],
          ["tl5r", "tl2r"],
          ["tl5r", "tl3r"],
          ["tl5r", "tl4r"],
          ["tl5r", "tl1r"],

          //attach
          {"deformLimitExpansion":""},
          {"beamSpring":501000,"beamDamp":20},
          {"beamDeform":4000,"beamStrength":12000},
          {"breakGroup":"taillight_a_R"},
          ["tl1r", "q3r"],
          ["tl1r", "r4rr"],
          ["tl1r", "q2r"],
          ["tl1r", "q6r"],
          ["tl1r", "r3rr"],

          ["tl3r", "q3r"],
          ["tl3r", "r4rr"],
          ["tl3r", "q2r"],
          ["tl3r", "q6r"],
          ["tl3r", "r3rr"],

          ["tl4r", "q5r"],
          ["tl4r", "q6r"],
          ["tl4r", "q2r"],
          ["tl4r", "r3rr"],
          ["tl4r", "r4rr"],
          ["tl4r", "q1r"],
          {"breakGroup":""},
          {"deformGroup":""},

          //taillight support beams
          {"beamType":"|SUPPORT", "beamLongBound":4},
          {"beamSpring":401000,"beamDamp":20},
          {"beamDeform":5000,"beamStrength":330000},
          ["tl3r", "q3r"],
          ["tl2r", "q3r"],
          ["tl4r", "q2r"],
          ["tl4r", "q5r"],
          ["tl4r", "q7r"],
          ["tl4r", "q1r"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"deformLimitExpansion":1.2},
    ],
    "triangles": [
            ["id1:","id2:","id3:"],
            //right taillight
            {"groundModel":"plastic"},
            {"group":"sprtg_taillight_R"},
            {"dragCoef":5},
            ["tl1r", "tl2r", "tl3r"],
            ["tl1r", "tl3r", "tl4r"],
            {"triangleType":"NONCOLLIDABLE"},
            ["tl1r", "tl5r", "tl2r"],
            ["tl5r", "tl3r", "tl2r"],
            ["tl5r", "tl4r", "tl3r"],
            ["tl1r", "tl4r", "tl5r"],
            {"triangleType":"NORMALTYPE"},
            {"group":""},
    ],
},
"sprtg_taillight_L2": {
    "information":{
        "authors":"BeamNG",
        "name":"Left Taillight",
        "value":110,
    },
    "slotType" : "sprtg_taillight_L2",
    "flexbodies": [
         ["mesh", "[group]:", "nonFlexMaterials"],
         ["sprtg_taillights_frame_L2", ["sprtg_taillight_L"]],

         {"deformGroup":"taillightglass_L_break", "deformMaterialBase":"sprtg_glass", "deformMaterialDamaged":"sprtg_glass_dmg"},
         ["sprtg_taillightsglass_L2", ["sprtg_taillight_L"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>extglassbreaksound1", "deformVolume":0.3}],

         {"deformGroup":"taillightglass_L_break", "deformMaterialBase":"sprtg_blacke", "deformMaterialDamaged":"sprtg_blacke"},
         ["sprtg_taillight_L2", ["sprtg_taillight_L"]],
         {"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"        , "tl3l", "tl2l", "tl1l", {"x":-40, "y":0, "z":200} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.2, "y":0.75, "z":-0.03},"flareScale":0.0,"lightBrightness":0.06,"deformGroup":"taillightglass_L_break"}],
        ["lowhighbeam" ,         "SPOTLIGHT"        , "tl3l", "tl2l", "tl1l", {"x":-40, "y":0, "z":200} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.2, "y":0.35, "z":-0.03},"flareScale":0.0,"lightBrightness":0.04,"lightRange":8,"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":"sprtg_taillight_L"},
         ["tl1l",0.7026,2.2532,1.0955],
         ["tl2l",0.6648,2.2925,0.8925],
         ["tl3l",0.7909,2.208,0.9131],
         ["tl4l",0.8639,1.9846,0.9656],
         {"selfCollision":false},
         {"nodeWeight":0.4},
         ["tl5l",0.7459,2.0892,0.9577],
         {"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},
          {"deformLimitExpansion":1.2},
          ["tl1l", "tl2l"],
          ["tl2l", "tl3l"],
          ["tl3l", "tl4l"],
          ["tl4l", "tl1l"],
          ["tl1l", "tl3l"],
          ["tl5l", "tl2l"],
          ["tl5l", "tl3l"],
          ["tl5l", "tl4l"],
          ["tl5l", "tl1l"],

          //attach
          {"deformLimitExpansion":""},
          {"beamSpring":501000,"beamDamp":20},
          {"beamDeform":4000,"beamStrength":12000},
          {"breakGroup":"taillight_a_L"},
          ["tl1l", "q3l"],
          ["tl1l", "r4ll"],
          ["tl1l", "q2l"],
          ["tl1l", "q6l"],
          ["tl1l", "r3ll"],

          ["tl3l", "q3l"],
          ["tl3l", "r4ll"],
          ["tl3l", "q2l"],
          ["tl3l", "q6l"],
          ["tl3l", "r3ll"],

          ["tl4l", "q5l"],
          ["tl4l", "q6l"],
          ["tl4l", "q2l"],
          ["tl4l", "r3ll"],
          ["tl4l", "r4ll"],
          ["tl4l", "q1l"],
          {"breakGroup":""},
          {"deformGroup":""},

          //taillight support beams
          {"beamType":"|SUPPORT", "beamLongBound":4},
          {"beamSpring":401000,"beamDamp":20},
          {"beamDeform":5000,"beamStrength":330000},
          ["tl3l", "q3l"],
          ["tl2l", "q3l"],
          ["tl4l", "q2l"],
          ["tl4l", "q5l"],
          ["tl4l", "q7l"],
          ["tl4l", "q1l"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"deformLimitExpansion":1.2},
    ],
    "triangles": [
            ["id1:","id2:","id3:"],
            //right taillight
            {"groundModel":"plastic"},
            {"group":"sprtg_taillight_L"},
            {"dragCoef":5},
            ["tl2l", "tl1l", "tl3l"],
            ["tl3l", "tl1l", "tl4l"],
            {"triangleType":"NONCOLLIDABLE"},
            ["tl5l", "tl1l", "tl2l"],
            ["tl3l", "tl5l", "tl2l"],
            ["tl4l", "tl5l", "tl3l"],
            ["tl4l", "tl1l", "tl5l"],
            {"triangleType":"NORMALTYPE"},
            {"group":""},
    ],
},
}