{
"rs11_trunk": {
    "information":{
        "authors":"Kenemation Mods",
        "name":"Trunk",
        "value":410,
    },
    "slotType" : "rs11_trunk",
    "slots": [
        ["type", "default", "description"],
        ["rs11_rs_trunk","","Trunk Lettering"],
		["rs11_frame_R","", "Rear License Frame"],
        ["rs11_licenseplate_R","rs11_licenseplate_R", "Rear License Plate"],
    ],
    "flexbodies": [
        ["mesh", "[group]:", "nonFlexMaterials"],
        ["rs11_trunk_sedan", ["rs11_trunk"]],
        {"deformGroup":"tailgatelight_L_break", "deformMaterialBase":"rs11_lights", "deformMaterialDamaged":""},
        ["rs11_tailgatelight_L", ["rs11_trunk"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>glassbreaksound3", "deformVolume":0.3}],
        {"deformGroup":"tailgatelight_R_break", "deformMaterialBase":"rs11_lights", "deformMaterialDamaged":""},
        ["rs11_tailgatelight_R", ["rs11_trunk"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>glassbreaksound4", "deformVolume":0.3}],

        {"deformGroup":"tailgatelight_L_break", "deformMaterialBase":"rs11_glass", "deformMaterialDamaged":"etk800_glass_dmg"},
        ["rs11_tailgatelightglass_L", ["rs11_trunk"]],
        {"deformGroup":"tailgatelight_R_break", "deformMaterialBase":"rs11_glass", "deformMaterialDamaged":"etk800_glass_dmg"},
        ["rs11_tailgatelightglass_R", ["rs11_trunk"]],
        {"deformGroup":""},
    ],
    "controller": [
        ["fileName"],
        ["advancedCouplerControl", {"name":"tailgateCoupler"}],
    ]
    "tailgateCoupler":{
        "groupType": "autoCoupling",
        "couplerNodes":[
            ["cid1",    "cid2",     "autoCouplingStrength",    "autoCouplingRadius",   "autoCouplingLockRadius",   "autoCouplingSpeed", "couplingStartRadius",  "breakGroup"]
            ["r7",      "t7",        40000,                     0.01,                   0.005,                      0.2,                 0.2,                   "tailgate_latch", {"forceCid1":"t7", "forceCid2":"t4"}]
        ]
        "attachSoundVolume":1,
        "detachSoundVolume":1,
        "soundNode:":["r5"]
        "attachSoundEvent": "event:>Vehicle>Latches>Trunk>modern_02_close",
        "detachSoundEvent": "event:>Vehicle>Latches>Trunk>90s_04_open",
        "breakSoundEvent":""
        "openForceMagnitude": 20,
        "openForceDuration": 0.5,
        "closeForceMagnitude": 60,
        "closeForceDuration": 3.5,
    }
    "triggers":[
        ["id", "label", "idRef:", "idX:", "idY:", "type", "size", "baseRotation", "rotation", "translation", "baseTranslation"],
        ["tailgate", "", "t4","t4r","t3", "box", {"x":0.1, "y":0.08, "z":0.08}, {"x":0, "y":0, "z":-3}, {"x":0, "y":0, "z":0}, {"x":0, "y":0, "z":0}, {"x":-0.05, "y":0.19, "z":0.02}],
        ["tailgate_int", "", "t4","t4r","t3", "box", {"x":0.12, "y":0.06, "z":0.06}, {"x":0, "y":0, "z":-3}, {"x":0, "y":0, "z":0}, {"x":0, "y":0, "z":0}, {"x":-0.06, "y":0.0, "z":0.06}],
    ],
    "triggerEventLinks":[
        ["triggerId:triggers", "action", "targetEventId:events"],
        ["tailgate", "action0", "tailgateLatch"],
        ["tailgate_int", "action0", "tailgateLatch"],
    ],
    "events":[
        ["id", "title", "desc"],
        ["tailgateLatch", "ui.inputActions.common.tailgateLatch.title", "ui.inputActions.common.tailgateLatch.description", {"onUp":"controller.getControllerSafe('tailgateCoupler').toggleGroup()"}],
    ],
    "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"        , "t4r", "t4rr", "t3r", {"x":200, "y":0, "z":0} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.80, "y":0.55, "z":0.02},"flareScale":0.0,"lightBrightness":0.08,"deformGroup":"tailgatelight_R_break"}],
        ["brakelights" ,         "SPOTLIGHT"        , "t4l", "t4ll", "t3l", {"x":-20, "y":0, "z":0} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.80, "y":0.55, "z":-0.02},"flareScale":0.0,"lightBrightness":0.08,"deformGroup":"tailgatelight_L_break"}],
        ["lowhighbeam" ,         "SPOTLIGHT"        , "t4r", "t4rr", "t3r", {"x":200, "y":0, "z":0} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.70, "y":0.55, "z":0.055},"flareScale":0.0,"lightBrightness":0.08,"deformGroup":"tailgatelight_R_break"}],
        ["lowhighbeam" ,         "SPOTLIGHT"        , "t4l", "t4ll", "t3l", {"x":-20, "y":0, "z":0} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.70, "y":0.55, "z":-0.055},"flareScale":0.0,"lightBrightness":0.08,"deformGroup":"tailgatelight_L_break"}],
        ["fog" ,                 "SPOTLIGHT"        , "t4l", "t4ll", "t3l", {"x":-20, "y":0, "z":0} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":1.0, "y":0.37, "z":-0.02},"flareScale":0.0,"lightBrightness":0.2,"deformGroup":"tailgatelight_L_break"}],

        {
            "lightInnerAngle":0,
            "lightOuterAngle":120,
            "lightRange":8,
            "lightColor":{"r":255, "g":255, "b":200, "a":255},
            "lightAttenuation":{"x":0, "y":1, "z":1},
            "lightCastShadows":false,
            "flareName":"vehicleReverseLightFlare",
            "cookieName":"art/special/BNG_light_cookie_headlight.dds"
            "texSize":512,
            "shadowSoftness":0.5,
        },
        ["reverse" ,         "SPOTLIGHT"        , "t4r", "t4rr", "t3r", {"x":200, "y":0, "z":0} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.9, "y":0.37, "z":0.02},"flareScale":0.0,"lightBrightness":0.06,"deformGroup":"tailgatelight_R_break"}],
        ["reverse" ,         "SPOTLIGHT"        , "t4l", "t4ll", "t3l", {"x":-20, "y":0, "z":0} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.9, "y":0.37, "z":-0.02},"flareScale":0.0,"lightBrightness":0.06,"deformGroup":"tailgatelight_L_break"}],
 {
            "lightInnerAngle":60,
            "lightOuterAngle":170,
            "lightRange":0.1,
            "lightColor":{"r":220, "g":220, "b":255, "a":255},
            "lightAttenuation":{"x":0, "y":1, "z":1},
            "lightCastShadows":true,
            "cookieName":"art/special/BNG_light_cookie_headlight.dds"
        },
        //right numberplate light
       ["lowhighbeam" ,         "SPOTLIGHT"        , "t3r", "t5", "t3l", {"x":40.999, "y":157.499, "z":56.015} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0.0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.171, "y":0.755, "z":0.189},"lightRange":1,"flareScale":0,"lightBrightness":1.5,"deformGroup":"fog_light_break_R"}],   
       ["lowhighbeam" ,         "SPOTLIGHT"        , "t3r", "t5", "t3l", {"x":-56.467, "y":97.913, "z":35.682} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0.0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.165, "y":0.077, "z":0.173},"lightRange":1,"flareScale":0,"lightBrightness":1.5,"deformGroup":"fog_light_break_R"}],   
 
    ],
    "nodes": [
        ["id", "posX", "posY", "posZ"],
         //--trunk--
         {"collision":true},
         {"selfCollision":true},
         {"nodeMaterial":"|NM_METAL"},
         {"frictionCoef":0.5},
         {"group":"rs11_trunk"},
         {"nodeWeight":1.6},
         ["t1r", -0.5743, 1.7534, 1.1199],
         ["t1", -0.0000, 1.8818, 1.1343],
         ["t1l", 0.5743, 1.7534, 1.1199],

         ["t3rr", -0.5438, 2.1809, 1.0500],
         ["t3r", -0.2876, 2.2323, 1.0794],
         ["t3", -0.0000, 2.2473, 1.0903],
         ["t3l", 0.2877, 2.2323, 1.0794],
         ["t3ll", 0.5438, 2.1809, 1.0500],

         ["t4rr", -0.4776, 2.2632, 0.7057],
         ["t4r", -0.2449, 2.3032, 0.7057],
         ["t4", -0.0000, 2.3132, 0.7057],
         ["t4l", 0.2449, 2.3032, 0.7057],
         ["t4ll", 0.4776, 2.2632, 0.7057],
         //trunk hinge
         {"collision":true},
         {"selfCollision":false},
         {"group":""},
         {"nodeWeight":1.0},
         ["th1r", -0.5735, 1.6132, 1.108],
         ["th1l",  0.5743, 1.6132, 1.108],
         //springs attache
         {"nodeWeight":0.8},
         ["th2r", -0.5735, 1.5582, 1.0421],
         ["th2l",  0.5743, 1.5582, 1.0421],

         //rigidifier
         {"collision":false},
         {"selfCollision":false},
         {"nodeWeight":2},
         ["t5", -0.0000, 1.9282, 0.8883],
         {"group":""},

         //latch node
         {"nodeWeight":1.6},
         ["t7", -0.0000, 2.2682, 0.6137],
    ],
    "beams": [
          ["id1:", "id2:"],
          //--trunk--
          {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"beamSpring":1201000,"beamDamp":100},
          {"beamDeform":32550,"beamStrength":"FLT_MAX"},
          //trunk main shape
          {"deformLimitExpansion":1.1},
          {"deformationTriggerRatio":0.05},
          {"deformGroup":"tailgatelight_R_break"},
          ["t3rr","t3r"],
          ["t4rr","t4r"],
          ["t3rr","t4rr"],
          ["t3r","t4r"],
          {"deformGroup":"tailgatelight_L_break"},
          ["t3l","t3ll"],
          ["t4l","t4ll"],
          ["t3l","t4l"],
          ["t3ll","t4ll"],
          {"deformGroup":""},
          ["t3r","t3"],
          ["t3l","t3"],
          ["t4r","t4"],
          ["t4l","t4"],
          ["t3","t4"],
          ["t3ll", "t1l"],
          ["t3", "t1"],
          ["t3rr", "t1r"],
          ["t1r", "t1"],
          ["t1", "t1l"],

          //surficial crossing
          {"deformLimitExpansion":""},
          {"beamDeform":14550,"beamStrength":"FLT_MAX"},
          {"deformGroup":"tailgatelight_R_break"},
          ["t4rr","t3r"],
          ["t4r","t3rr"],
          {"deformGroup":"tailgatelight_L_break"},
          ["t4l","t3ll"],
          ["t4ll","t3l"],
          {"deformGroup":""},
          ["t4r","t3"],
          ["t4","t3r"],
          ["t4l","t3"],
          ["t4","t3l"],
          ["t3", "t1l"],
          ["t3ll", "t1"],
          ["t3l", "t1l"],
          ["t3l", "t1"],
          ["t3r", "t1"],
          ["t3r", "t1r"],
          ["t3", "t1r"],
          ["t3rr", "t1"],

          //rigids
          {"beamSpring":801000,"beamDamp":120},
          {"beamDeform":5550,"beamStrength":"FLT_MAX"},
          {"deformGroup":"tailgatelight_R_break"},
          ["t4rr","t4"],
          ["t3rr","t3"],
          {"deformGroup":"tailgatelight_L_break"},
          ["t4","t4ll"],
          ["t3","t3ll"],
          {"deformGroup":""},
          ["t3r","t3l"],
          ["t4r","t4l"],
          {"beamDeform":3550,"beamStrength":"FLT_MAX"},
          ["t1", "t4"],
          ["t1", "t4r"],
          ["t1", "t4l"],
          ["t1r", "t4rr"],
          ["t1r", "t4r"],
          ["t1l", "t4ll"],
          ["t1l", "t4l"],

          //rigidifier
          {"beamSpring":1751000,"beamDamp":150},
          {"beamDeform":5000,"beamStrength":"FLT_MAX"},
          {"deformationTriggerRatio":0.05},
          {"deformGroup":"tailgatelight_R_break"},
          ["t3rr","t5"],
          ["t3r","t5"],
          ["t4rr","t5"],
          ["t4r","t5"],
          {"deformGroup":"tailgatelight_L_break"},
          ["t3l","t5"],
          ["t3ll","t5"],
          ["t4l","t5"],
          ["t4ll","t5"],
          {"deformGroup":""},
          ["t5", "t1"],
          ["t5", "t1r"],
          ["t5", "t1l"],
          ["t3","t5"],
          ["t4","t5"],

          //latch node
          ["t7", "t3"],
          ["t7", "t3r"],
          ["t7", "t3l"],
          ["t7", "t4"],
          ["t7", "t4r"],
          ["t7", "t4l"],
          ["t7", "t5"],

          //hinge spring nodes to trunk
          {"beamSpring":751000,"beamDamp":50},
          {"beamDeform":5000,"beamStrength":"FLT_MAX"},
          ["th2r","t1l"],
          ["th2r","t1"],
          ["th2r","t3l"],
          ["th2r","t3ll"],
          ["th2r","t4ll"],
          ["th2r","t5"],

          ["th2l","t1l"],
          ["th2l","t1"],
          ["th2l","t3l"],
          ["th2l","t3ll"],
          ["th2l","t4ll"],
          ["th2l","t5"],

          //trunk hinge node to body
          {"beamSpring":2501000,"beamDamp":150},
          {"beamDeform":14000,"beamStrength":"FLT_MAX"},
          ["th1l", "tb1l"],
          ["th1l", "p10l"],
          ["th1l", "tb1"],
          ["th1l", "q7l"],
          ["th1l", "r5ll"],

          ["th1r", "tb1r"],
          ["th1r", "p10r"],
          ["th1r", "tb1"],
          ["th1r", "q7r"],
          ["th1r", "r5rr"],

          //trunk hinge break
          {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"beamSpring":301000,"beamDamp":100},
          {"beamDeform":15000,"beamStrength":65000},
          //r
          {"breakGroup":"trunkhinge_R"},
          {"deformGroup":"trunklight_R_break"},
          ["t1r", "th1r"],
          ["t1", "th1r"],
          ["t3r", "th1r"],
          ["t3rr", "th1r"],
          ["t5", "th1r"],
          ["th2r", "th1r"],

          //l
          {"breakGroup":"trunkhinge_L"},
          {"deformGroup":"trunklight_L_break"},
          ["t1l", "th1l"],
          ["t1", "th1l"],
          ["t3l", "th1l"],
          ["t3ll", "th1l"],
          ["t5", "th1l"],
          ["th2l", "th1l"],
          {"breakGroup":""},

          {"breakGroup":""},
          {"deformGroup":""},

          //trunk latch
          {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"beamSpring":2001000,"beamDamp":120},
          {"beamDeform":9000,"beamStrength":22000},
          {"breakGroup":"trunklatch"},
          //["t4","r7"],
          //["t4r","r7"],
          //["t4l","r7"],
          //["t4r","r7rr"],
          //["t4","r7rr"],
          //["t4","r7ll"],
          //["t4l","r7ll"],
          //["t5","r7rr"],
          //["t5","r7"],
          //["t5","r7ll"],
          {"breakGroup":""},

          //pop open
          {"breakGroupType":1},
          {"beamType":"|SUPPORT", "beamLongBound":2},
          {"beamSpring":7000,"beamDamp":200},
          {"beamDeform":4000,"beamStrength":10000},
          {"beamPrecompression":1.06},
          ["t4l", "r6", {"breakGroup":"trunkhinge_R"}],
          ["t4r", "r6", {"breakGroup":"trunkhinge_L"}],

          //gas struts
          {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"breakGroupType":1},
          {"beamSpring":4900,"beamDamp":200},
          {"beamDeform":4000,"beamStrength":10000},
          {"beamPrecompression":0.58},
          ["th2r", "q4r", {"breakGroup":"trunkhinge_R"}],
          ["th2l", "q4l", {"breakGroup":"trunkhinge_L"}],
          {"beamPrecompression":1},
          {"breakGroupType":0},
          {"breakGroup":""},

          //damping
          {"beamDeform":27600,"beamStrength":225000},
          {"beamSpring":0,"beamDamp":350},
          ["th2r", "q4r", {"breakGroup":"trunkhinge_R", "dampCutoffHz":500}],
          ["th2l", "q4l", {"breakGroup":"trunkhinge_L", "dampCutoffHz":500}],
          {"breakGroup":""},

          //limiter
          {"beamType":"|SUPPORT", "beamLongBound":11.0, "beamShortBound":1.0},
          {"beamDeform":27600,"beamStrength":225000},
          {"beamSpring":155000,"beamDamp":300},
          {"beamPrecompression":0.84},
          {"boundZone":0.1},
          ["th2r", "q4r", {"breakGroup":"trunkhinge_R"}],
          ["th2l", "q4l", {"breakGroup":"trunkhinge_L"}],
          {"boundZone":0.05},
          {"beamPrecompression":0.65},
          {"beamSpring":100,"beamDamp":3400},
          ["th2r", "tb1r", {"breakGroup":"trunkhinge_R", "dampCutoffHz":1500}],
          ["th2l", "tb1l", {"breakGroup":"trunkhinge_L", "dampCutoffHz":1500}],
          //dampening end of stroke
          {"beamDeform":27600,"beamStrength":225000},
          {"beamSpring":3000,"beamDamp":2400},
          {"beamPrecompression":0.97},
          {"boundZone":0.1},
          ["th2r", "r4rr", {"breakGroup":"trunkhinge_R", "dampCutoffHz":500}],
          ["th2l", "r4ll", {"breakGroup":"trunkhinge_L", "dampCutoffHz":500}],
          {"breakGroup":""},
          {"boundZone":""},

          //trunk support beams
          {"beamType":"|SUPPORT", "beamLongBound":15},
          {"beamSpring":1001000,"beamDamp":50},
          {"beamDeform":7500,"beamStrength":230000},
          ["t3rr","q4r"],
          ["t3ll","q4l"],
          {"beamLongBound":6},
          ["t3rr","q9r"],
          ["t3ll","q9l"],

          ["t4r","q9r"],
          ["t4l","q9l"],

          ["t4rr","r4rr"],
          ["t4ll","r4ll"],

          ["t4rr","r3rr"],
          ["t4ll","r3ll"],

          ["t3","r7"],
          ["t3r","r7"],
          ["t3l","r7"],
          ["t3r","r7rr"],
          ["t3l","r7ll"],

         // ["t1r", "tb1r"],
         // ["t1r", "q9r"],
         // ["t1r", "q2r"],
         // ["t1r", "p10r"],
         // ["t1r", "q1r"],
        //
        // ["t1l", "tb1l"],
        // ["t1l", "q9l"],
        // ["t1l", "q2l"],
        // ["t1l", "p10l"],
        // ["t1l", "q1l"],
          {"optional":false},
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"deformLimitExpansion":1.1},
    ],
    "triangles": [
            ["id1:","id2:","id3:"],
            //trunk
            {"groundModel":"metal"},
            {"group":"rs11_trunk"},
            {"dragCoef":4},
            ["t3ll", "t3l", "t1l"],
            ["t3r", "t3rr", "t1r"],
            ["t1", "t3", "t3r"],
            ["t1", "t3l", "t3"],
            ["t1l", "t3l", "t1"],
            ["t1", "t3r", "t1r"],

            {"dragCoef":6},
            ["t3ll","t4ll","t4l"],
            ["t3ll","t4l","t3l"],
            ["t3l","t4","t3"],
            ["t3l","t4l","t4"],
            ["t4r","t3r","t4"],
            ["t3r","t3","t4"],
            ["t3r","t4r","t3rr"],
            ["t4rr","t3rr","t4r"],
    ],
},
"rs11_ramka_R": {
    "information":{
        "authors":"Kenemation Mods",
        "name":"Black Rear License Frame",
        "value":45,
    },
    "slotType" : "rs11_frame_R",
    "flexbodies": [
        ["mesh", "[group]:", "nonFlexMaterials"],
        ["rs11_ramka_R", ["rs11_trunk"]],
    ],
},
}
