{
"pilot25_spadie_hood": {
    "information":{
        "authors":"BeamNG",
        "name":"Hood",
        "value":190,
    },
    "slotType" : "pilot25_spadie_hood",
    "flexbodies": [
         ["mesh", "[group]:", "nonFlexMaterials"],
         ["pilot25_spadie_hood_a", ["pilot25_spadie_hood"]],
         ["pilot25_spadie_logo_hood", ["pilot25_spadie_hood"]],
    ],
    "controller": [
        ["fileName"],
        ["advancedCouplerControl", {"name":"hoodLatchCoupler"}],
        ["advancedCouplerControl", {"name":"hoodCatchCoupler"}],
    ]
    "hoodLatchCoupler":{
        "groupType": "autoCoupling",
        "couplerNodes":[
            ["cid1",    "cid2",     "autoCouplingStrength",    "autoCouplingRadius",   "autoCouplingLockRadius",   "autoCouplingSpeed", "couplingStartRadius",  "breakGroup"]
            ["f15",     "h7",        30000,                     0.01,                   0.005,                      0.2,                 0.1,                   "hood_latch"]
        ]
        "attachSoundVolume":1,
        "detachSoundVolume":1,
        "soundNode:":["f15"]
        "attachSoundEvent": "event:>Vehicle>Latches>Hood>modern_01_close",
        "detachSoundEvent": "event:>Vehicle>Latches>Hood>modern_01_open_lever",
        "breakSoundEvent":""
        "openForceMagnitude": 0,
        "openForceDuration": 0.0,
        "closeForceMagnitude": 0,
        "closeForceDuration": 0.0
    }
    "hoodCatchCoupler":{
        "groupType": "autoCoupling",
        "couplerNodes":[
            ["cid1",    "cid2",     "autoCouplingStrength",    "autoCouplingRadius",   "autoCouplingLockRadius",   "autoCouplingSpeed", "couplingStartRadius",  "breakGroup"]
            ["h8",      "h4",        30000,                     0.05,                   0.005,                      0.2,                 0.1,                   "hood_latch"]
        ]
        "attachSoundVolume":0,
        "detachSoundVolume":1,
        "soundNode:":["h7"]
        "attachSoundEvent": "event:>Vehicle>Latches>Hood>modern_01_close",
        "detachSoundEvent": "event:>Vehicle>Latches>Hood>modern_01_open_hood",
        "breakSoundEvent":""
        "openForceMagnitude": 50,
        "openForceDuration": 0.5,
        "closeForceMagnitude": 100,
        "closeForceDuration": 1.5
    }
    "triggers":[
        ["id", "label", "idRef:", "idX:", "idY:", "type", "size", "baseRotation", "rotation", "translation", "baseTranslation"],
        ["hood", "", "h4","h4r","h3", "box", {"x":0.08, "y":0.08, "z":0.08}, {"x":0, "y":-6.5, "z":5}, {"x":0, "y":0, "z":0}, {"x":0, "y":0, "z":0}, {"x":-0.04, "y":-0.03, "z":-0.05}],
        ["hood_int", "", "f5ll","f5l","f6ll", "box", {"x":0.08, "y":0.08, "z":0.08}, {"x":45, "y":-20, "z":0}, {"x":0, "y":0, "z":0}, {"x":0, "y":0, "z":0}, {"x":0.1, "y":0.15, "z":-0.18}],
        ],
    "triggerEventLinks":[
        ["triggerId:triggers", "action", "targetEventId:events"],
        ["hood", "action0", "hoodCatch"],
        ["hood_int", "action0", "hoodRelease"],
    ],
    "events":[
        ["id", "title", "desc"],
        ["hoodCatch", "ui.inputActions.pilot25_spadie.hoodCatch.title", "ui.inputActions.pilot25_spadie.hoodCatch.description", {"onDown":"controller.getControllerSafe('hoodCatchCoupler').toggleGroupConditional({{'hoodLatchCoupler','attached','vehicle.advancedCouplerControl.releaseHoodFirstInterior'}})"}],
        ["hoodRelease", "ui.inputActions.pilot25_spadie.hoodLatch.title", "ui.inputActions.pilot25_spadie.hoodLatch.description", {"onDown":"controller.getControllerSafe('hoodLatchCoupler').toggleGroup()"}],
    ],
    "nodes": [
         ["id", "posX", "posY", "posZ"],
         {"nodeMaterial":"|NM_METAL"},
         {"frictionCoef":0.5},
         //--HOOD--
         {"collision":true},
         {"selfCollision":true},
         {"group":"pilot25_spadie_hood"},
         {"nodeWeight":0.95},
         ["h1rr", -0.78130, -1.08320, 1.07226],
         ["h1r", -0.32702, -1.32049, 1.08339],
         ["h1l", 0.32702, -1.32049, 1.08339],
         ["h1ll", 0.78130, -1.08320, 1.07226],

         ["h2rr", -0.77831, -1.42179, 1.05415],
         ["h2r", -0.35972, -1.56288, 1.06289],
         ["h2l", 0.35972, -1.56288, 1.06289],
         ["h2ll", 0.77831, -1.42179, 1.05415],

         ["h3rr", -0.77831, -1.76185, 1.03092],
         ["h3r", -0.45238, -1.86547, 1.02558],
         ["h3", 0.00000, -1.91371, 1.04211],
         ["h3l", 0.45238, -1.86547, 1.02558],
         ["h3ll", 0.77831, -1.76185, 1.03092],

         ["h4rr", -0.77831, -1.95918, 0.97352],
         ["h4r", -0.50034, -2.16621, 0.95675],
         ["h4", 0.00000, -2.22337, 0.98960],
         ["h4l", 0.50034, -2.16621, 0.95675],
         ["h4ll", 0.77831, -1.95918, 0.97352],

         //rigidifier
         {"selfCollision":false},
         {"collision":false},
         {"group":""},
         {"nodeWeight":2.0},
         ["h6", 0.00000, -1.60249, 0.72819],
         {"group":""},
         //latch node
         {"nodeWeight":0.9},
         ["h7", 0.00000, -2.09988, 0.89896],
         //catch node
         ["h8", 0.00000, -2.22337, 0.98960],
    ],
    "beams": [
          ["id1:", "id2:"],
          //--HOOD--
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"beamSpring":1000600,"beamDamp":60},
          {"beamDeform":16535,"beamStrength":"FLT_MAX"},
          //hood main shape
          {"deformLimitExpansion":1.2},
          ["h1rr","h2rr"],
          ["h1r","h2r"],
          ["h1l","h2l"],
          ["h1ll","h2ll"],
          ["h2rr","h3rr"],
          ["h2r","h3r"],
          ["h2l","h3l"],
          ["h2ll","h3ll"],
          ["h3rr","h4rr"],
          ["h3r","h4r"],
          ["h3","h4"],
          ["h3l","h4l"],
          ["h3ll","h4ll"],
          //widthwise
          ["h1rr","h1r"],
          ["h1r","h1l"],
          ["h1l","h1ll"],
          ["h2rr","h2r"],
          ["h2r","h2l"],
          ["h2l","h2ll"],
          ["h3rr","h3r"],
          ["h3r","h3"],
          ["h3","h3l"],
          ["h3l","h3ll"],
          ["h4rr","h4r"],
          ["h4r","h4"],
          ["h4","h4l"],
          ["h4l","h4ll"],

          //surficial crossing
          {"deformLimitExpansion":""},
          {"beamDeform":7000,"beamStrength":"FLT_MAX"},
          ["h1rr","h2r"],
          ["h1r","h2rr"],
          ["h1r","h2l"],
          ["h1l","h2r"],
          ["h1l","h2ll"],
          ["h1ll","h2l"],
          ["h2rr","h3r"],
          ["h2r","h3rr"],
          ["h2r","h3"],
          ["h2l","h3"],
          ["h2l","h3r"],
          ["h2r","h3l"],
          ["h2l","h3ll"],
          ["h2ll","h3l"],
          ["h3rr","h4r"],
          ["h3r","h4rr"],
          ["h3r","h4"],
          ["h3","h4r"],
          ["h3","h4l"],
          ["h3l","h4"],
          ["h3l","h4ll"],
          ["h3ll","h4l"],

          //rigids
          {"beamSpring":1900600,"beamDamp":60},
          {"beamDeform":2000,"beamStrength":"FLT_MAX"},
          //["h2rr","h4rr"],
          //["h2r","h4r"],
          //["h2r","h4"],
          //["h2l","h4"],
          //["h2l","h4l"],
          //["h2ll","h4ll"],
          {"beamDeform":7000,"beamStrength":"FLT_MAX"},
          ["h1rr","h3rr"],
          ["h1r","h3r"],
          ["h1r","h3"],
          ["h1l","h3"],
          ["h1l","h3l"],
          ["h1ll","h3ll"],

          //rigidifier
          {"beamSpring":1900600,"beamDamp":60},
          {"beamDeform":5000,"beamStrength":"FLT_MAX"},
          ["h6","h1l"],
          ["h6","h1ll", {"beamDeform":9000,"beamStrength":"FLT_MAX"}],
          ["h6","h1r"],
          ["h6","h1rr", {"beamDeform":9000,"beamStrength":"FLT_MAX"}],
          ["h6","h2l", {"beamDeform":9000,"beamStrength":"FLT_MAX"}],
          ["h6","h2ll"],
          ["h6","h2r", {"beamDeform":9000,"beamStrength":"FLT_MAX"}],
          ["h6","h2rr"],
          ["h6","h3"],
          ["h6","h3l"],
          ["h6","h3ll"],
          ["h6","h3r"],
          ["h6","h3rr"],
          {"beamDeform":2000,"beamStrength":"FLT_MAX"},
          ["h6","h4"],
          ["h6","h4l"],
          ["h6","h4ll"],
          ["h6","h4r"],
          ["h6","h4rr"],

          //hood hinge
          {"disableTriangleBreaking":true},
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"beamSpring":1101000,"beamDamp":60},
          {"beamDeform":15000,"beamStrength":125000},
          {"breakGroupType":0},
          {"breakGroup":"hoodhinge_R"},
          //r
          ["h1rr","f6rr"],
          ["h1ll","f6l"],
          ["h1ll","f5ll"],
          ["h1rr","f5r"],
          {"breakGroup":"hoodhinge_L"},
          //l
          ["h1ll","f6ll"],
          ["h1rr","f6r"],
          ["h1rr","f5rr"],
          ["h1ll","f5l"],
          {"breakGroup":""},

          {"beamDeform":2500,"beamStrength":"FLT_MAX"},
          {"beamSpring":601000,"beamDamp":50},
          //latch node
          ["h7","h4l"],
          ["h7","h4"],
          ["h7","h4r"],
          ["h7","h3l"],
          ["h7","h3"],
          ["h7","h3r"],

          //pop open
          {"breakGroupType":1},
          {"beamType":"|SUPPORT", "beamLongBound":4},
          {"beamSpring":8000,"beamDamp":10},
          {"beamDeform":4000,"beamStrength":10000},
          {"beamPrecompression":1},
          ["h7", "f13rr", {"breakGroup":"hoodhinge_R"}],
          ["h7", "f13ll", {"breakGroup":"hoodhinge_L"}],

          //limiter
          {"beamPrecompression":1, "beamType":"|BOUNDED", "beamLongBound":0.25, "beamShortBound":1},
          {"beamSpring":0,"beamDamp":100},
          {"beamLimitSpring":601000,"beamLimitDamp":50},
          {"beamDeform":2000,"beamStrength":70000},
          ["h2rr", "f5rr", {"breakGroup":"hoodhinge_R"}],
          ["h2ll", "f5ll", {"breakGroup":"hoodhinge_L"}],

          //catch
          {"beamPrecompression":1, "beamType":"|BOUNDED", "beamLongBound":1, "beamShortBound":1},
          {"beamSpring":0,"beamDamp":100},
          {"beamLimitSpring":301000,"beamLimitDamp":20},
          {"beamDeform":7000,"beamStrength":90000},
          {"longBoundRange":0.02, "shortBoundRange":0.0},
          {"beamPrecompression":1.005},
          ["h8", "f15"],
          ["h8", "f13rr"],
          ["h8", "f13ll"],
          {"beamPrecompression":1.0},
          {"longBoundRange":0.0, "shortBoundRange":0.0},
          ["h8", "f15r"],
          ["h8", "f15l"],
          {"beamLimitSpring":101000,"beamLimitDamp":20},
          ["h8", "f12rr"],
          ["h8", "f12ll"],
          {"longBoundRange":"", "shortBoundRange":""},

          //gas struts
          {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0}
          {"beamSpring":600,"beamDamp":200},
          {"beamDeform":4000,"beamStrength":10000},
          {"beamPrecompression":2.4},
          ["h3rr", "f14rr", {"breakGroup":"hoodhinge_R"}],
          ["h3ll", "f14ll", {"breakGroup":"hoodhinge_L"}],
          {"beamPrecompression":1},
          {"breakGroupType":0},
          {"breakGroup":""},

          //hood support beams
          {"beamType":"|SUPPORT", "beamLongBound":8},
          {"beamSpring":630600,"beamDamp":60},
          {"beamDeform":9000,"beamStrength":1125000},
          ["h4r", "f11rr"],
          ["h4l", "f11ll"],
          ["h4", "f11ll"],
          ["h4", "f11rr"],
          ["h4ll", "f11ll"],
          ["h4rr", "f11rr"],
          ["h2ll", "f14l"],
          ["h2rr", "f14r"],
          ["h1ll", "f5ll"],
          ["h1rr", "f5rr"],
          ["h1ll", "f6lll"],
          ["h1rr", "f6rrr"],
          //width
          ["h1r","f6rr"],
          ["h4r","f15rr"],
          ["h1l","f6ll"],
          ["h4l","f15ll"],

          //to fenders
          {"optional":true},
          ["h2rr", "fe4r"],
          ["h1rr", "fe3r"],
          ["h2ll", "fe4l"],
          ["h1ll", "fe3l"],
          //to hood
          ["h4r", "fb2r"],
          ["h4", "fb2"],
          ["h4l", "fb2l"],
          {"optional":false},
          {"deformLimitExpansion":1.2},
          {"disableMeshBreaking":false,"disableTriangleBreaking":false},
    ],
    "triangles": [
            ["id1:","id2:","id3:"],
            //hood
            {"groundModel":"metal"},
            {"dragCoef":9},
            {"group":"pilot25_spadie_hood"},
            ["h1rr","h2rr","h2r"],
            ["h2r","h1r","h1rr"],
            ["h1l","h1r","h2r"],
            ["h1l","h2r","h2l"],
            ["h1ll","h1l","h2l"],
            ["h1ll","h2l","h2ll"],
            ["h2r","h2rr","h3rr"],
            ["h2r","h3rr","h3r"],
            ["h2r","h3r","h3"],
            ["h2l","h2r","h3"],
            ["h2l","h3","h3l"],

            ["h2ll","h2l","h3ll"],
            ["h2l","h3l","h3ll"],

            ["h3r","h3rr","h4rr"],
            ["h3r","h4rr","h4r"],
            ["h3","h3r","h4r"],
            ["h3","h4r","h4"],

            ["h3l","h4ll","h3ll"],
            ["h4l","h4ll","h3l"],
            ["h3","h4l","h3l"],
            ["h4","h4l","h3"],
            {"group":""},
    ],
},
}