{
"ARaz1_hood": {
    "information":{
        "authors":"BeamNG",
        "name":"Hood",
        "value":275,
    },

    "slotType" : "ARaz1_hood",

    "slots": [
        ["type", "default", "description"],
        ["ARaz1_logo_F","", "Logo"],
    ],

    "controller": [
        ["fileName"],
        ["advancedCouplerControl", {"name":"hoodLatchCoupler"}],
        ["advancedCouplerControl", {"name":"hoodCatchCoupler"}],
    ]
    "hoodLatchCoupler":{
        "groupType": "autoCoupling",
        "couplerNodes":[
            ["cid1",    "cid2",     "autoCouplingStrength",    "autoCouplingRadius",   "autoCouplingLockRadius",   "autoCouplingSpeed"]
            ["f15",     "h6",       30000,                  0.01,                   0.005,                      0.2]
        ]
        "attachSoundVolume":1,
        "detachSoundVolume":1,
        "soundNode:":["f15"]
        "attachSoundEvent": "event:>Vehicle>Latches>Hood>90s_03_close",
        "detachSoundEvent": "event:>Vehicle>Latches>Hood>90s_03_open_lever",
        "breakSoundEvent":""
        "openForceMagnitude": 0,
        "openForceDuration": 0.0,
        "closeForceMagnitude": 0,
        "closeForceDuration": 0.0
    }
    "hoodCatchCoupler":{
        "groupType": "autoCoupling",
        "couplerNodes":[
            ["cid1",    "cid2",     "autoCouplingStrength",    "autoCouplingRadius",   "autoCouplingLockRadius",   "autoCouplingSpeed"]
            ["h7",      "h4",       30000,                  0.01,                   0.005,                      0.2, {"forceCid1":"h5", "forceCid2":"h3"}]
        ]
        "attachSoundVolume":1,
        "detachSoundVolume":1,
        "soundNode:":["h7"]
        "attachSoundEvent": "event:>Vehicle>Latches>Hood>90s_03_close",
        "detachSoundEvent": "event:>Vehicle>Latches>Hood>90s_03_open_hood",
        "breakSoundEvent":""
        "openForceMagnitude": 20,
        "openForceDuration": 1.5,
        "closeForceMagnitude": 800,
        "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":-4, "z":0}, {"x":0, "y":0, "z":0}, {"x":0, "y":0, "z":0}, {"x":-0.04, "y":-0.04, "z":-0.04}],
        ],
    "triggerEventLinks":[
        ["triggerId:triggers", "action", "targetEventId:events"],
        ["hood", "action0", "hoodCatch"],
        ["hood_int", "action0", "hoodRelease"],
    ],
    "events":[
        ["id", "title", "desc"],
        ["hoodCatch", "ui.inputActions.ARaz1.hoodCatch.title", "ui.inputActions.ARaz1.hoodCatch.description", {"onDown":"controller.getControllerSafe('hoodCatchCoupler').toggleGroupConditional({{'hoodLatchCoupler','attached','vehicle.advancedCouplerControl.releaseHoodFirstInterior'}})"}],
        ["hoodRelease", "ui.inputActions.ARaz1.hoodLatch.title", "ui.inputActions.ARaz1.hoodLatch.description", {"onDown":"controller.getControllerSafe('hoodLatchCoupler').toggleGroup()"}],
    ],
    "flexbodies": [
        ["mesh", "[group]:", "nonFlexMaterials"],
        ["ARaz1_hood", ["ARaz1_hood"]],
    ],
    "nodes": [
        ["id", "posX", "posY", "posZ"],
        //--HOOD--
        {"nodeMaterial":"|NM_METAL"},
        {"frictionCoef":0.5},
        {"group":"ARaz1_hood"},
        {"nodeWeight":0.90},
        {"collision":true},

        {"selfCollision":true},

        ["h1rr", -0.53865, -1.08907, 0.74050],
        ["h1r", -0.20947, -1.20907, 0.75050],
        ["h1l", 0.20947, -1.20907, 0.75050],
        ["h1ll", 0.53865, -1.08907, 0.74050],

        ["h2rr", -0.53117, -1.36730, 0.67053],
        ["h2r", -0.20947, -1.40730, 0.68524],
        ["h2l", 0.20947, -1.40730, 0.68524],
        ["h2ll", 0.53117, -1.36730, 0.67053],
        ["h3rr", -0.53101, -1.55242, 0.59570],
        ["h3r", -0.28826, -1.59242, 0.59570],
        ["h3", 0.00000, -1.62242, 0.59070],
        ["h3l", 0.28826, -1.59242, 0.59570],
        ["h3ll", 0.53101, -1.55242, 0.59570],
        {"selfCollision":false},
        ["h4rr", -0.52513, -1.75683, 0.42210],
        ["h4r", -0.29000, -1.80187, 0.42210],
        ["h4", 0.00000, -1.82387, 0.42137, {"tag":"hoodCatch"}],
        ["h4l", 0.29000, -1.80187, 0.42210],
        ["h4ll", 0.52513, -1.75683, 0.42210],
        {"selfCollision":false},
        {"collision":false},
        //rigidifier
        {"group":""},
        {"nodeWeight":0.70},
        ["h5", 0.00000, -1.68907, 0.38550],
        //latch node
        {"nodeWeight":1.6},
        ["h6", 0.00000, -1.75952, 0.42712, {"couplerTag":"hoodLatch","couplerLock":true,"couplerStrength":30000,"couplerRadius":1.35,"couplerStartRadius":0.1,"couplerLockRadius":0.001,"couplerLatchSpeed":0.8,"breakGroupType":1,"breakGroup":["hoodhinge_L","hoodhinge_R"]}],
        //catch node
        ["h7", 0.00000, -1.82387, 0.42137, {"couplerTag":"hoodCatch","couplerLock":true,"couplerStrength":30000,"couplerRadius":1.35,"couplerStartRadius":0.1,"couplerLockRadius":0.001,"couplerLatchSpeed":0.8,"breakGroupType":1,"breakGroup":["hoodhinge_L","hoodhinge_R"]}],
    ],
    "beams": [
          ["id1:", "id2:"],
          {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          //--HOOD--
          {"beamSpring":601000,"beamDamp":75},
          {"beamDeform":12000,"beamStrength":"FLT_MAX"},
          //hood main shape
          {"deformLimitExpansion":1.1},
          ["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":10000,"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"],
          //extra
          //rigids
          {"beamSpring":401000,"beamDamp":75},
          {"beamDeform":1200,"beamStrength":"FLT_MAX"},
          ["h2rr","h4rr"],
          ["h2r","h4r"],
          ["h2r","h4"],
          ["h2l","h4"],
          ["h2l","h4l"],
          ["h2ll","h4ll"],

          ["h1rr","h3rr"],
          ["h1r","h3r"],
          ["h1r","h3"],
          ["h1l","h3"],
          ["h1l","h3l"],
          ["h1ll","h3ll"],
          //rigidifier
          {"beamSpring":601000,"beamDamp":75},
          {"beamDeform":1500,"beamStrength":"FLT_MAX"},
          ["h5","h1rr"],
          ["h5","h2rr"],
          ["h5","h3rr"],
          ["h5","h4rr"],
          ["h5","h1r"],
          ["h5","h2r"],
          ["h5","h3r"],
          ["h5","h4r"],
          ["h5","h3"],
          ["h5","h4"],
          ["h5","h1l"],
          ["h5","h2l"],
          ["h5","h3l"],
          ["h5","h4l"],
          ["h5","h1ll"],
          ["h5","h2ll"],
          ["h5","h3ll"],
          ["h5","h4ll"],

          //latch node
          ["h5","h6"],
          ["h6","h4l"],
          ["h6","h4"],
          ["h6","h4r"],
          ["h6","h3l"],
          ["h6","h3"],
          ["h6","h3r"],

          //hood hinge
          {"beamSpring":1001000,"beamDamp":50},
          {"beamDeform":13000,"beamStrength":25000},
          {"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":""},

          //hood latch
          {"beamDeform":12000,"beamStrength":21000},
          {"breakGroup":"hoodlatch"},
          //["h4r","f15"],
          //["h4","f15"],
          //["h4l","f15"],
          {"breakGroup":""},

          //damping
          {"beamDeform":5000,"beamStrength":10000},
          {"beamSpring":0,"beamDamp":40},
          {"breakGroup":"hoodhinge_R"},
          ["h4rr","f19r"],
          {"breakGroup":"hoodhinge_L"},
          ["h4ll","f19l"],
          {"breakGroup":""},

          //pop open
          {"breakGroupType":1},
          {"beamType":"|SUPPORT", "beamLongBound":4},
          {"beamSpring":600,"beamDamp":10},
          {"beamDeform":4000,"beamStrength":10000},
          {"beamPrecompression":2.15},
          ["h3", "f11rr", {"breakGroup":"hoodhinge_R"}],
          ["h3", "f11ll", {"breakGroup":"hoodhinge_L"}],

          //limiter
          {"beamPrecompression":1, "beamType":"|BOUNDED", "beamLongBound":1.95, "beamShortBound":1},
          {"beamSpring":0,"beamDamp":100},
          {"beamLimitSpring":601000,"beamLimitDamp":50},
          {"beamDeform":2000,"beamStrength":70000},
          ["h3", "f11rr", {"breakGroup":"hoodhinge_R"}],
          ["h3", "f11ll", {"breakGroup":"hoodhinge_L"}],

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

          //gas struts
          {"beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0}
          {"beamSpring":280,"beamDamp":100},
          {"beamDeform":4000,"beamStrength":10000},
          {"beamPrecompression":2.7},
          ["h2rr", "f14rr", {"breakGroup":"hoodhinge_R"}],
          ["h2ll", "f14ll", {"breakGroup":"hoodhinge_L"}],
          {"beamPrecompression":1},
          {"breakGroupType":0},
          {"breakGroup":""},

          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1, "beamShortBound":1},
          //hood support beams
          {"beamType":"|SUPPORT", "beamLongBound":4},
          {"beamSpring":601000,"beamDamp":75},
          {"beamDeform":15000,"beamStrength":200000},
          ["h1rr","f5rr"],
          ["h1r","f5r"],
          ["h1l","f5l"],
          ["h1ll","f5ll"],
          ["h2r","f12rr"],
          ["h2l","f12ll"],
          ["h3r","f13rr"],
          ["h3","f13rr"],
          ["h3","f13ll"],
          ["h3l","f13ll"],
         // ["h4rr","f11rr"],
         // ["h4r","f11rr"],
        //  ["h4","f11"],
         /// ["h4l","f11ll"],
        //  ["h4ll","f11ll"],
          {"beamType":"|SUPPORT", "beamLongBound":12},
          ["h2ll","f14ll"],
        //  ["h3rr","f15rr"],
        //  ["h3ll","f15ll"],
          ["h2rr","f14rr"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"deformLimitExpansion":1.1},
    ],
    "triangles": [
            ["id1:","id2:","id3:"],
            //hood
            {"groundModel":"metal"},
            {"group":"ARaz1_hood"},
            {"dragCoef":12},
            ["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":""},
    ],
},
}
