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

         {"deformGroup":"taillightglass_R_break", "deformMaterialBase":"pilot25_spadie_glass", "deformMaterialDamaged":"pilot25_spadie_glass_dmg"},
         ["pilot25_spadie_taillightsglass_R", ["pilot25_spadie_taillight_R"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>extglassbreaksound1", "deformVolume":0.3}],

         {"deformGroup":"taillightglass_R_break", "deformMaterialBase":"pilot25_spadie_lights", "deformMaterialDamaged":"pilot25_spadie_lights"},
         ["pilot25_spadie_taillight_R", ["pilot25_spadie_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},"flareScale":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},"flareScale":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":"pilot25_spadie_taillight_R"},
         ["tl1r", -0.78369, 2.37674, 1.05260],
         ["tl2r", -0.70385, 2.45074, 0.89618],
         ["tl3r", -0.82725, 2.37674, 0.91801],
         ["tl4r", -0.86249, 2.16081, 0.97378],
         {"selfCollision":false},
         {"nodeWeight":0.4},
         ["tl5r", -0.78969, 2.27274, 0.96530],
         {"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":"pilot25_spadie_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":""},
    ],
},
"pilot25_spadie_taillight_L": {
    "information":{
        "authors":"BeamNG",
        "name":"Left Taillight",
        "value":110,
    },
    "slotType" : "pilot25_spadie_taillight_L",
    "flexbodies": [
         ["mesh", "[group]:", "nonFlexMaterials"],
         ["pilot25_spadie_taillights_frame_L", ["pilot25_spadie_taillight_L"]],

         {"deformGroup":"taillightglass_L_break", "deformMaterialBase":"pilot25_spadie_glass", "deformMaterialDamaged":"pilot25_spadie_glass_dmg"},
         ["pilot25_spadie_taillightsglass_L", ["pilot25_spadie_taillight_L"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>extglassbreaksound1", "deformVolume":0.3}],

         {"deformGroup":"taillightglass_L_break", "deformMaterialBase":"pilot25_spadie_lights", "deformMaterialDamaged":"pilot25_spadie_lights"},
         ["pilot25_spadie_taillight_L", ["pilot25_spadie_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},"flareScale":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},"flareScale":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":"pilot25_spadie_taillight_L"},
         ["tl1l", 0.78369, 2.37674, 1.05260],
         ["tl2l", 0.70385, 2.45074, 0.89618],
         ["tl3l", 0.82725, 2.37674, 0.91801],
         ["tl4l", 0.86249, 2.16081, 0.97378],
         {"selfCollision":false},
         {"nodeWeight":0.4},
         ["tl5l", 0.78969, 2.27274, 0.96530],
         {"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":"pilot25_spadie_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":""},
    ],
},
}