{
"v90_headlight_R": {
    "information":{
        "authors":"BeamNG",
        "name":"LED Right Headlight",
        "value":350,
    },
    "slotType" : "v90_headlight_R",
    "slots": [
        ["type", "default", "description"],
        ["v90_headlightpanel_R","v90_headlightpanel_R", "Right Headlight Access Panel"],
    ],
    "flexbodies": [
         ["mesh", "[group]:", "nonFlexMaterials"],
         ["v90_headlightframe_R", ["v90_headlight_R"]],
         {"deformGroup":"headlightglass_R_break", "deformMaterialBase":"v90_glass", "deformMaterialDamaged":"v90_glass_dmg"},
         ["v90_headlightglass_R", ["v90_headlight_R"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>extglassbreaksound3", "deformVolume":0.4}],
         {"deformGroup":""},
         {"deformGroup":"headlightglass_R_break", "deformMaterialBase":"v90_lights", "deformMaterialDamaged":"v90_lights_dmg"},
         ["v90_headlight_R", ["v90_headlight_R"]],
         {"deformGroup":""},
    ],
    "props": [
        ["func"      , "mesh"              , "idRef:", "idX:", "idY:"            , "baseRotation"        , "rotation"                 , "translation"        , "min", "max", "offset", "multiplier"],
        {
            "lightInnerAngle":70,
            "lightOuterAngle":80,
            "lightColor":{"r":235, "g":245, "b":245, "a":255},
            "lightAttenuation":{"x":0, "y":1, "z":1},
            "lightCastShadows":true,
            "flareName":"vehicleHeadLightFlare",
            "cookieName":"art/special/BNG_light_cookie_headlight.dds"
            "texSize":512,
            "shadowSoftness":0.5,
        },
        //low beams
        ["lowhighbeam"    , "SPOTLIGHT"        , "he4r", "he3r", "he2r", {"x":195, "y":-30, "z":45} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":-0.043, "y":0.633, "z":0.085},"lightRange":50,"lightBrightness":0.7,"flareScale":0.0,"lightOuterAngle":80,"deformGroup":"headlightglass_R_break"}],
        //high beams
        ["highbeam" ,         "SPOTLIGHT"        , "he4r", "he3r", "he2r", {"x":202, "y":-26, "z":40} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.35, "y":0.48, "z":0.095},"lightRange":80,"lightBrightness":0.8,"flareScale":0.0,"lightOuterAngle":80,"deformGroup":"headlightglass_R_break"}],
        //signal
        {
            "lightInnerAngle":0,
            "lightOuterAngle":120,
            "lightRange":8,
            "lightColor":{"r":255, "g":255, "b":0, "a":255},
            "lightAttenuation":{"x":0, "y":1, "z":1},
            "lightCastShadows":false,
            "flareName":"vehicleBrakeLightFlare",
        },
        ["signal_R"    , "SPOTLIGHT"        , "he3r", "he4r", "he1r", {"x":-20, "y":0, "z":-30} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.1, "y":0.2, "z":-0.04},"flareScale":0.03,"lightBrightness":0.03,"deformGroup":"headlightglass_R_break"}],
     ],
    "nodes": [
         ["id", "posX", "posY", "posZ"],
         //--HEADLIGHT--
         //right
         {"selfCollision":true},
         {"collision":true},
         {"nodeMaterial":"|NM_PLASTIC"},
         {"frictionCoef":0.5},
         {"nodeWeight":0.6},
         {"group":"v90_headlight_R"},
         ["he1r",-0.50, -2.10, 0.76],
         ["he3r",-0.49, -2.11, 0.72],
         ["he2r",-0.78, -1.84, 0.78],
         ["he4r",-0.78, -1.88, 0.68],
         //{"selfCollision":false}
         ["he5r",-0.60, -1.76, 0.72],
         {"group":""},
    ],

    "beams": [
          ["id1:", "id2:"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          //--HEADLIGHT--
          {"beamSpring":1001000,"beamDamp":60},
          {"beamDeform":12000,"beamStrength":62000},
          //headlight main shape
          {"deformGroup":"headlightglass_R_break", "deformationTriggerRatio":0.05},
          //r
          {"deformLimitExpansion":1.1},
          ["he1r","he2r"],
          ["he3r","he4r"],
          ["he1r","he3r"],
          ["he2r","he4r"],

          ["he1r","he4r"],
          ["he2r","he3r"],

          ["he1r","he5r"],
          ["he2r","he5r"],
          ["he3r","he5r"],
          ["he4r","he5r"],

          //attach
          {"beamSpring":301000,"beamDamp":60},
          {"beamDeform":3000,"beamStrength":24000},
          //r
          {"deformLimitExpansion":""},
          {"breakGroup":"headlight_R"},
          ["he5r","f15rr"],
          ["he5r","f15r"],
          ["he2r","f15rr"],
          ["he2r","f15r"],
          ["he4r","f15rr"],

          {"beamDeform":3000,"beamStrength":24000},
          {"breakGroup":"headlight_R"},
          ["he1r","f15r"],
          ["he1r","f15rr"],
          ["he3r","f15r"],
          ["he3r","f13rr"],
          //["he1r","f13rr"],

          {"beamDeform":1500,"beamStrength":46000},
          ["he2r","f18r"],
          ["he4r","f18r"],
          ["he3r","f11rr"],
          {"breakGroup":""},
          {"deformGroup":""},

          //headlight support beams
          {"beamType":"|SUPPORT", "beamLongBound":9},
          {"beamSpring":601000,"beamDamp":90},
          {"beamDeform":13000,"beamStrength":330000},
          {"optional":true},
          ["he2r","h4"],
          ["he3r","h4r"],
          ["he5r","h4rr"],
          {"optional":false},
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"deformLimitExpansion":1.1},
    ],
    "triangles": [
            ["id1:","id2:","id3:"],
            //right headlight
            {"groundModel":"plastic"},
            {"group":"v90_headlight_R"},
            {"dragCoef":5},
            ["he3r","he1r","he4r"],
            ["he4r","he1r","he2r"],

            {"triangleType":"NONCOLLIDABLE"},
            ["he4r","he2r","he5r"],
            ["he1r","he5r","he2r"],
            ["he3r","he5r","he1r"],
            ["he4r","he5r","he3r"],
            {"triangleType":"NORMALTYPE"},
            {"group":""},
    ],
},
"v90_headlight_L": {
    "information":{
        "authors":"BeamNG",
        "name":"LED Left Headlight",
        "value":350,
    },
    "slotType" : "v90_headlight_L",
    "slots": [
        ["type", "default", "description"],
        ["v90_headlightpanel_L","v90_headlightpanel_L", "Left Headlight Access Panel"],
    ],
    "flexbodies": [
         ["mesh", "[group]:", "nonFlexMaterials"],
         ["v90_headlightframe_L", ["v90_headlight_L"]],
         {"deformGroup":"headlightglass_L_break", "deformMaterialBase":"v90_glass", "deformMaterialDamaged":"v90_glass_dmg"},
         ["v90_headlightglass_L", ["v90_headlight_L"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>extglassbreaksound4", "deformVolume":0.6}],
         {"deformGroup":""},
         {"deformGroup":"headlightglass_L_break", "deformMaterialBase":"v90_lights", "deformMaterialDamaged":"v90_lights_dmg"},
         ["v90_headlight_L", ["v90_headlight_L"]],
         {"deformGroup":""},
    ],
    "props": [
        ["func"      , "mesh"              , "idRef:", "idX:", "idY:"            , "baseRotation"        , "rotation"                 , "translation"        , "min", "max", "offset", "multiplier"],
        {
            "lightInnerAngle":70,
            "lightOuterAngle":80,
            "lightColor":{"r":235, "g":245, "b":245, "a":255},
            "lightAttenuation":{"x":0, "y":1, "z":1},
            "lightCastShadows":true,
            "flareName":"vehicleHeadLightFlare",
            "cookieName":"art/special/BNG_light_cookie_headlight.dds"
            "texSize":512,
            "shadowSoftness":0.5,
        },
        //low beams angled right slightly to avoid blinding oncoming traffic
        ["lowhighbeam"    , "SPOTLIGHT"        , "he4l", "he3l", "he2l", {"x":-48, "y":24, "z":-37} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":-0.043, "y":0.633, "z":-0.085},"lightRange":50,"lightBrightness":0.7,"flareScale":0.0,"lightOuterAngle":80,"deformGroup":"headlightglass_L_break"}],
        //high beams
        ["highbeam" ,         "SPOTLIGHT"        , "he4l", "he3l", "he2l", {"x":-40, "y":24, "z":-37} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.35, "y":0.48, "z":-0.095},"lightRange":80,"lightBrightness":0.8,"flareScale":0.0,"lightOuterAngle":80,"deformGroup":"headlightglass_L_break"}],
        //signal
        {
            "lightInnerAngle":0,
            "lightOuterAngle":120,
            "lightRange":8,
            "lightColor":{"r":255, "g":255, "b":0, "a":255},
            "lightAttenuation":{"x":0, "y":1, "z":1},
            "lightCastShadows":false,
            "flareName":"vehicleBrakeLightFlare",
        },
        ["signal_L"    , "SPOTLIGHT"        , "he3l", "he4l", "he1l", {"x":200, "y":0, "z":30} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.1, "y":0.2, "z":0.04},"flareScale":0.0,"lightBrightness":0.03,"deformGroup":"headlightglass_L_break"}],
     ],
    "nodes": [
         ["id", "posX", "posY", "posZ"],
         //--HEADLIGHT--
         //left
         {"selfCollision":true},
         {"collision":true},
         {"nodeMaterial":"|NM_PLASTIC"},
         {"frictionCoef":0.5},
         {"nodeWeight":0.6},
         {"group":"v90_headlight_L"},
         ["he1l", 0.50, -2.10, 0.76],
         ["he3l", 0.49, -2.11, 0.72],
         ["he2l", 0.78, -1.84, 0.78],
         ["he4l", 0.78, -1.88, 0.68],
         //{"selfCollision":false}
         ["he5l", 0.60, -1.76, 0.72],
         {"group":""},

    ],
    "beams": [
          ["id1:", "id2:"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          //--HEADLIGHT--
          {"beamSpring":1001000,"beamDamp":60},
          {"beamDeform":12000,"beamStrength":128000},
          //headlight main shape
          {"deformGroup":"headlightglass_L_break", "deformationTriggerRatio":0.05},
          //l
          {"deformLimitExpansion":1.1},
          ["he1l","he2l"],
          ["he3l","he4l"],
          ["he1l","he3l"],
          ["he2l","he4l"],

          ["he1l","he4l"],
          ["he2l","he3l"],

          ["he1l","he5l"],
          ["he2l","he5l"],
          ["he3l","he5l"],
          ["he4l","he5l"],
          //attach
          {"deformLimitExpansion":""},
          {"beamSpring":301000,"beamDamp":60},
          {"beamDeform":3000,"beamStrength":28000},
          //l
          {"breakGroup":"headlight_L"},
          ["he5l","f15ll"],
          ["he5l","f15l"],
          ["he2l","f15ll"],
          ["he2l","f15l"],
          ["he4l","f15ll"],

          {"beamDeform":3000,"beamStrength":28000},
          {"breakGroup":"headlight_L"},
          ["he1l","f15ll"],
          ["he1l","f15l"],
          ["he3l","f15l"],
          ["he3l","f13ll"],
          //["he1l","f13ll"],

          {"beamDeform":1500,"beamStrength":46000},
          ["he2l","f18l"],
          ["he4l","f18l"],
          ["he3l","f11ll"],
          {"breakGroup":""},
          {"deformGroup":""},

          //headlight support beams
          {"beamType":"|SUPPORT", "beamLongBound":9},
          {"beamSpring":601000,"beamDamp":90},
          {"beamDeform":13000,"beamStrength":330000},
          {"optional":true},
          ["he2l","h4"],
          ["he3l","h4l"],
          ["he5l","h4ll"],
          {"optional":false},
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"deformLimitExpansion":1.1},
    ],
    "triangles": [
            ["id1:","id2:","id3:"],
            //left headlight
            {"groundModel":"plastic"},
            {"group":"v90_headlight_L"},
            {"dragCoef":5},
            ["he1l","he3l","he4l"],
            ["he1l","he4l","he2l"],
            {"triangleType":"NONCOLLIDABLE"},
            ["he2l","he4l","he5l"],
            ["he5l","he1l","he2l"],
            ["he5l","he3l","he1l"],
            ["he5l","he4l","he3l"],
            {"triangleType":"NORMALTYPE"},
            {"group":""},
    ],
},
}
