{
"kzn_ws6_trunk": {
    "information":{
        "authors":"ItzKaizen",
        "name":"Trunk",
        "value":410,
    },
    "slotType" : "kzn_ws6_trunk",
    "flexbodies": [
         ["mesh", "[group]:", "nonFlexMaterials"],
         ["kzn_ws6_trunk", ["kzn_ws6_tailgate"]],
         //{"deformGroup":"chmsl_break", "deformMaterialBase":"kzn_ws6_lights", "deformMaterialDamaged":"kzn_ws6_lights_dmg"},
         //["kzn_ws6_chmsl", ["kzn_ws6_trunk"]],
         //{"deformGroup":""},
    ],
    "slots": [
        ["type", "default", "description"],
        ["kzn_ws6_spoiler","kzn_ws6_spoiler", "Spoiler"],
		["kzn_ws6_backlight","kzn_ws6_backlight", "Backlight"],
        //["kzn_ws6_trunkpanel","kzn_ws6_trunkpanel", "Taillight Panel"],
        //["kzn_ws6_lettering_trunk","kzn_ws6_lettering_base", "Lettering"],
        //["kzn_ws6_trunk_accessory","","Trunk Accessory"],
    ],
	"props": [
        ["func"      , "mesh"              , "idRef:", "idX:", "idY:"            , "baseRotation"        , "rotation"                 , "translation"        , "min", "max", "offset", "multiplier"],
        //{
            //"lightInnerAngle":10,
            //"lightOuterAngle":120,
            //"lightRange":8,
            //"lightColor":{"r":255, "g":0, "b":0, "a":255},
            //"lightAttenuation":{"x":0, "y":1, "z":1},
            //"lightCastShadows":false,
            //"flareName":"vehicleBrakeLightFlare",
            //"cookieName":""
        //},
        //chmsl
        //["brake" ,         "SPOTLIGHT"        , "t4r", "t4", "t3r", {"x":0, "y":0, "z":0} , {"x":0, "y":0, "z":30}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":1.25, "y":0.9, "z":0.00},"flareScale":0.03,"lightBrightness":0.05,"deformGroup":"chmsl_break"}],
    ],
    "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.1,                   "tailgate_latch"]
        ]
        "attachSoundVolume":1,
        "detachSoundVolume":1,
        "soundNode:":["r5"]
        "attachSoundEvent": "event:>Vehicle>Latches>Trunk>modern_02_close",
        "detachSoundEvent": "event:>Vehicle>Latches>Trunk>90s_04_open",
        "breakSoundEvent":""
        "openForceMagnitude": 110,
        "openForceDuration": 0.5,
        "closeForceMagnitude": 80,
        "closeForceDuration": 1.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":-2.5, "z":0}, {"x":0, "y":0, "z":0}, {"x":0, "y":0, "z":0}, {"x":-0.05, "y":0.0, "z":-0.00}],
    ],
    "triggerEventLinks":[
        ["triggerId:triggers", "action", "targetEventId:events"],
        ["tailgate", "action0", "tailgateLatch"],
    ],
    "events":[
        ["id", "title", "desc"],
        ["tailgateLatch", "ui.inputActions.common.tailgateLatch.title", "ui.inputActions.common.tailgateLatch.description", {"onUp":"controller.getControllerSafe('tailgateCoupler').toggleGroup()"}],
    ],
    "nodes": [
        ["id", "posX", "posY", "posZ"],
         //--TAILGATE--
         {"collision":true},
         {"selfCollision":true},
         {"nodeMaterial":"|NM_METAL"},
         {"frictionCoef":0.5},
         {"group":"kzn_ws6_tailgate"},
         {"nodeWeight":1.3},
         ["t1r", -0.535, 1.00, 1.25],
         ["t1", 0, 1.02, 1.30],
         ["t1l", 0.535, 1.00, 1.25],

         ["t2rr", -0.82, 1.30, 0.97],
         ["t2ll", 0.82, 1.30,, 0.97],

         ["t3rr", -0.74, 1.90, 0.92],
         ["t3r", -0.45, 1.85, 0.98],
         ["t3", 0.0, 1.92, 1.00],
         ["t3l", 0.45, 1.85, 0.98],
         ["t3ll", 0.74, 1.90, 0.92],

         {"nodeWeight":1.5},
         ["t4rr", -0.67, 2.29, 0.87],
         ["t4r", -0.34, 2.35, 0.89],
         ["t4", 0.0, 2.37, 0.90],
         ["t4l", 0.34, 2.35, 0.89],
         ["t4ll", 0.67, 2.29, 0.87],

         {"collision":false},
         {"selfCollision":false},
         {"nodeWeight":2},
         ["t5", 0, 1.80, 0.85],
         {"group":""},

         //latch node
         {"nodeWeight":1.6},
         ["t7", 0.0, 2.30, 0.85],
    ],
    "beams": [
          ["id1:", "id2:"],
          //--TAILGATE--
          {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"beamSpring":1001000,"beamDamp":100},
          {"beamDeform":32550,"beamStrength":"FLT_MAX"},
          //tailgate 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":""},
          ["t1r","t1"],
          ["t1","t1l"],
          ["t1r","t2rr"],
          ["t1l","t2ll"],
          ["t3r","t3"],
          ["t3l","t3"],
          ["t2rr","t3rr"],
          ["t2ll","t3ll"],
          ["t4r","t4"],
          ["t4l","t4"],
          ["t3","t4"],

          //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":""},
          ["t2rr","t3r"],
          ["t2ll","t3l"],
          ["t4r","t3"],
          ["t4","t3r"],
          ["t4l","t3"],
          ["t4","t3l"],

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

          //rigidifier
          {"beamSpring":1751000,"beamDamp":150},
          {"beamDeform":5000,"beamStrength":"FLT_MAX"},
          {"deformationTriggerRatio":0.05},
          ["t1r","t5"],
          ["t1","t5", {"beamDeform":10000}],
          ["t1l","t5"],
          ["t2rr","t5"],
          ["t2ll","t5"],
          {"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":""},
          ["t3","t5"],
          ["t4","t5"],

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

          //tailgate hinge
          {"beamSpring":2001000,"beamDamp":120},
          {"beamDeform":18000,"beamStrength":44000},
          {"breakGroup":"tailgatehinge_R"},
          {"deformGroup":"tailgatelight_R_break"},
          ["t1r","rf4r"],
          ["t1r","rf4r"],
          ["t1","rf4l"],
          ["t1","rf4l"],
          ["t2ll","rf4l"],
          ["t2rr","rf4r"],
          ["t5","rf4r"],

          {"breakGroup":"tailgatehinge_L"},
          {"deformGroup":"tailgatelight_L_break"},
          ["t1l","rf4l"],
          ["t1l","rf4l"],
          ["t1","rf4r"],
          ["t1","rf4r"],
          ["t2rr","rf4r"],
          ["t2ll","rf4l"],
          ["t5","rf4l"],
          {"deformGroup":""},
          {"breakGroup":""},

          //tailgate latch
          {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"beamSpring":2001000,"beamDamp":120},
          {"beamDeform":9000,"beamStrength":22000},
          {"breakGroup":"tailgatelatch"},
          //["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":4},
          {"beamSpring":7000,"beamDamp":200},
          {"beamDeform":4000,"beamStrength":10000},
          {"beamPrecompression":1.05},
          ["t4l", "r6", {"breakGroup":"tailgatehinge_R"}],
          ["t4r", "r6", {"breakGroup":"tailgatehinge_L"}],

          //gas struts
          {"breakGroupType":1},
          {"beamSpring":400,"beamDamp":100},
          {"beamDeform":4000,"beamStrength":10000},
          {"beamPrecompression":2.5},
          ["q5r","t4rr", {"breakGroup":"tailgatehinge_R"}],
          ["q5l","t4ll", {"breakGroup":"tailgatehinge_L"}],
          {"beamPrecompression":1},
          {"breakGroupType":0},
          {"breakGroup":""},

          //damping
          {"beamDeform":27600,"beamStrength":225000},
          {"beamSpring":0,"beamDamp":20},
          ["t3rr","r3rr", {"breakGroup":"tailgatehinge_R"}],
          ["t3ll","r3ll", {"breakGroup":"tailgatehinge_L"}],
          {"breakGroup":""},

          //tailgate support beams
          {"beamType":"|SUPPORT", "beamLongBound":8},
          {"beamSpring":1001000,"beamDamp":50},
          {"beamDeform":7500,"beamStrength":230000},
          ["t3rr","q4r", {"beamLongBound":10}],
          ["t3ll","q4l", {"beamLongBound":10}],

          ["t2rr","p11r"],
          ["t2ll","p11l"],
          //["t2rr","p5r"],
          //["t2ll","p5l"],

          ["t2rr","rf6r"],
          ["t2ll","rf6l"],

          ["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"],

          {"beamPrecompression":0.7},
          ["t1r","rf5r"],
          ["t1l","rf5l"],
          ["t1","rf5"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"deformLimitExpansion":1.1},
    ],
    "triangles": [
            ["id1:","id2:","id3:"],
            //tailgate
            {"groundModel":"metal"},
            {"group":"kzn_ws6_tailgate"},
            {"dragCoef":2},
            //["t1","t1l","t2ll"],
            //["t1","t2ll","t2rr"],
            //["t1","t2rr","t1r"],
            ["t2ll","t3ll","t3l"],
            //["t2ll","t3l","t3"],
            //["t2ll","t3","t2rr"],
            //["t2rr","t3","t3r"],
            ["t2rr","t3r","t3rr"],

            {"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"],
    ],
},
"kzn_ws6_trunkpanel": {
    "information":{
        "authors":"ItzKaizen",
        "name":"Taillight Panel",
        "value":90,
    },
    "slotType" : "kzn_ws6_trunkpanel",
    "flexbodies": [
         ["mesh", "[group]:", "nonFlexMaterials"],
         ["kzn_ws6_rearpanel", ["kzn_ws6_trunk"]],
         ["kzn_ws6_trunklightframe_L", ["kzn_ws6_trunk"]],
         ["kzn_ws6_trunklightframe_R", ["kzn_ws6_trunk"]],
         {"deformGroup":"trunklight_R_break", "deformMaterialBase":"kzn_ws6_lights", "deformMaterialDamaged":"kzn_ws6_lights_dmg"},
         ["kzn_ws6_trunklight_R", ["kzn_ws6_trunk"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>glassbreaksound4", "deformVolume":0.4}],
         ["kzn_ws6_reverselight_R", ["kzn_ws6_trunk"]],
         {"deformGroup":"trunklight_L_break", "deformMaterialBase":"kzn_ws6_lights", "deformMaterialDamaged":"kzn_ws6_lights_dmg"},
         ["kzn_ws6_trunklight_L", ["kzn_ws6_trunk"],[]{"deformSound":"event:>Destruction>Vehicle>Glass>glassbreaksound3", "deformVolume":0.4}],
         ["kzn_ws6_reverselight_L", ["kzn_ws6_trunk"]],
         {"deformGroup":""},
    ],
    "props": [
        ["func"      , "mesh"              , "idRef:", "idX:", "idY:"            , "baseRotation"        , "rotation"                 , "translation"        , "min", "max", "offset", "multiplier"],
        {
            "lightInnerAngle":0,
            "lightOuterAngle":120,
            "lightRange":8,
            "lightColor":{"r":255, "g":50, "b":0, "a":255},
            "lightAttenuation":{"x":0, "y":0, "z":0},
            "lightCastShadows":false,
            "flareName":"vehicleBrakeLightFlare",
            "cookieName":""
        },
        //taillights
        ["brake" ,         "SPOTLIGHT"        , "t4rr", "t4r", "t3rr", {"x":0, "y":90, "z":30} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.45, "y":0.3, "z":0.00},"flareScale":0.05,"lightBrightness":0.05,"deformGroup":"trunklight_R_break"}],
        ["brake" ,         "SPOTLIGHT"        , "t4ll", "t4l", "t3ll", {"x":180, "y":-90, "z":30} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.45, "y":0.3, "z":-0.00},"flareScale":0.05,"lightBrightness":0.05,"deformGroup":"trunklight_L_break"}],
        ["lowhighbeam" ,         "SPOTLIGHT"        , "t4rr", "t4r", "t3rr", {"x":0, "y":90, "z":30} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.45, "y":0.3, "z":0.00},"flareScale":0.02,"lightBrightness":0.03,"lightRange":8,"deformGroup":"trunklight_R_break"}],
        ["lowhighbeam" ,         "SPOTLIGHT"        , "t4ll", "t4l", "t3ll", {"x":180, "y":-90, "z":30} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.45 "y":0.3, "z":-0.00},"flareScale":0.02,"lightBrightness":0.03,"lightRange":8,"deformGroup":"trunklight_L_break"}],
        {
            "lightInnerAngle":0,
            "lightOuterAngle":120,
            "lightRange":20,
            "lightColor":{"r":255, "g":255, "b":160, "a":255},
            "lightAttenuation":{"x":0, "y":1, "z":1},
            "lightCastShadows":false,
            "flareName":"vehicleReverseLightFlare",
            "cookieName":"",
            "texSize":512,
            "shadowSoftness":0.5

        },
        //reverse lights
        ["reverse" ,         "SPOTLIGHT"        , "t4r", "t4", "t3r", {"x":0, "y":90, "z":30} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.1, "y":0.09, "z":0.00},"flareScale":0.05,"lightBrightness":0.05,"deformGroup":"trunklight_R_break"}],
        ["reverse" ,         "SPOTLIGHT"        , "t4l", "t4", "t3l", {"x":180, "y":-90, "z":30} , {"x":0, "y":0, "z":0}    , {"x":0, "y":0, "z":0}, 0, 0, 0, 1, {"baseTranslation":{"x":0.1, "y":0.09, "z":-0.00},"flareScale":0.05,"lightBrightness":0.05,"deformGroup":"trunklight_L_break"}],
    ],
},
}
