{
"revuelto_spoiler": {
    "information":{
        "authors":"BeamNG",
        "name":"Retractable Spoiler",
        "value":900,
    },
    "slotType" : "revuelto_spoiler",
    "flexbodies": [
         ["mesh", "[group]:", "nonFlexMaterials"],
         ["revuelto_spoiler", ["revuelto_spoiler"]],
         ["revuelto_spoilerpiston", ["revuelto_spoilerpiston"]],
    ],
    "controller": [
        ["fileName"],
        ["spoiler", {}],
    ],
    "nodes": [
         ["id", "posX", "posY", "posZ"],
         //--SPOILER--
         {"nodeMaterial":"|NM_METAL"},
         {"frictionCoef":0.5},
         {"group":"revuelto_spoiler"},
         {"collision":true},
         {"selfCollision":false},
         {"nodeWeight":1.44},
         ["sp1rr", -0.82056, 1.84672, 0.89998],
         ["sp1r", -0.33004, 2.00866, 0.88012],
         ["sp1", 0.00000, 2.01809, 0.88012],
         ["sp1l", 0.33004, 2.00866, 0.88012],
         ["sp1ll", 0.82056, 1.84672, 0.89998],

         {"selfCollision":true},
         ["sp2rr", -0.80120, 1.99442, 0.87584, {"group":["revuelto_spoiler", "revuelto_spoilerpiston"]}],
         ["sp2r", -0.35988, 2.19088, 0.87084, {"group":["revuelto_spoiler", "revuelto_spoilerpiston"]}],
         ["sp2", 0.00000, 2.20973, 0.87084],
         ["sp2l", 0.35988, 2.19088, 0.87084, {"group":["revuelto_spoiler", "revuelto_spoilerpiston"]}],
         ["sp2ll", 0.80120, 1.99442, 0.87584, {"group":["revuelto_spoiler", "revuelto_spoilerpiston"]}],
         //rigidifier
         {"group":""},
         {"collision":false},
         {"selfCollision":false},
         ["sp3r", -0.31062, 2.05417, 1.06563],
         ["sp3l", 0.31062, 2.05417, 1.06563],

    ],
    "beams": [
          ["id1:", "id2:"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          //--SPOILER--
          {"beamSpring":1183050,"beamDamp":75},
          {"beamDeform":36150,"beamStrength":"FLT_MAX"},
          //main shape
          {"deformLimitExpansion":1.1},
          ["sp1rr","sp1r"],
          ["sp1r","sp1"],
          ["sp1l","sp1"],
          ["sp1ll","sp1l"],
          ["sp2rr","sp2r"],
          ["sp2r","sp2"],
          ["sp2l","sp2"],
          ["sp2ll","sp2l"],

          ["sp1rr","sp2rr"],
          ["sp1r","sp2r"],
          ["sp1","sp2"],
          ["sp1l","sp2l"],
          ["sp1ll","sp2ll"],

          //surficial crossing
          {"deformLimitExpansion":""},
          {"beamDeform":19500,"beamStrength":"FLT_MAX"},
          ["sp1rr","sp2r"],
          ["sp2rr","sp1r"],
          ["sp1r","sp2"],
          ["sp2r","sp1"],
          ["sp1","sp2l"],
          ["sp2","sp1l"],
          ["sp1l","sp2ll"],
          ["sp2l","sp1ll"],
//fixeth
            ["sp1", "sp1ll"],
            ["sp1", "sp1rr"],
            ["sp1r", "sp1ll"],
            ["sp1l", "sp1rr"],


          //rigids
          {"beamDeform":7200,"beamStrength":"FLT_MAX"},
          ["sp1rr","sp1"],
          ["sp1r","sp1l"],
          ["sp1ll","sp1"],
          ["sp2rr","sp2"],
          ["sp2r","sp2l"],
          ["sp2ll","sp2"],

          //rigidifier
          {"beamDeform":5550,"beamStrength":"FLT_MAX"},
          {"beamSpring":1183050,"beamDamp":100},
          ["sp3r","sp3l"],

          ["sp1rr","sp3r"],
          ["sp1r","sp3r"],
          ["sp1","sp3r"],
          ["sp1l","sp3r"],
          ["sp1ll","sp3r"],
          ["sp2rr","sp3r"],
          ["sp2r","sp3r"],
          ["sp2","sp3r"],
          ["sp2l","sp3r"],
          ["sp2ll","sp3r"],

          ["sp1rr","sp3l"],
          ["sp1r","sp3l"],
          ["sp1","sp3l"],
          ["sp1l","sp3l"],
          ["sp1ll","sp3l"],
          ["sp2rr","sp3l"],
          ["sp2r","sp3l"],
          ["sp2","sp3l"],
          ["sp2l","sp3l"],
          ["sp2ll","sp3l"],
          //hinge
          {"beamSpring":901000,"beamDamp":75},
          {"beamDeform":5500,"beamStrength":10000},
          {"breakGroup":"spoiler_hinge_R"},
          //r
          ["sp1rr","spt3r"],
          ["sp2rr","spt3r"],
          ["sp1r","spt3r"],
          ["sp2r","spt3r"],
          ["sp1","spt3r"],
          ["sp2","spt3r"],
          ["sp3r","spt3r"],

          {"breakGroup":"spoiler_hinge_L"},
          //l
          ["sp1ll","spt3l"],
          ["sp2ll","spt3l"],
          ["sp1l","spt3l"],
          ["sp2l","spt3l"],
          ["sp1","spt3l"],
          ["sp2","spt3l"],
          ["sp3l","spt3l"],
          {"breakGroup":""},

          //spoiler support beams
          {"beamType":"|SUPPORT", "beamLongBound":6},
          {"beamSpring":901000,"beamDamp":75},
          {"beamDeform":34500,"beamStrength":1250000},

          ["sp1rr","spt4rr"],
          ["sp2rr","spt4rr"],
          ["sp1ll","spt4ll"],
          ["sp2ll","spt4ll"],
          {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1.0, "beamShortBound":1.0},
          {"deformLimitExpansion":1.1},
    ],
    "triangles": [
            ["id1:","id2:","id3:"],
            //trunk
            {"groundModel":"plastic"},
            {"group":"revuelto_spoiler"},
            {"dragCoef":340},
            ["sp1ll","sp2ll","sp2l", {"liftCoef":100, "stallAngle":0.66}],
            ["sp1ll","sp2l","sp1l",  {"liftCoef":100, "stallAngle":0.66}],
            ["sp1l","sp2l","sp2",    {"liftCoef":100, "stallAngle":0.66}],
            ["sp1l","sp2","sp1",     {"liftCoef":100, "stallAngle":0.66}],
            ["sp1r","sp1","sp2",     {"liftCoef":100, "stallAngle":0.66}],
            ["sp1r","sp2","sp2r",    {"liftCoef":100, "stallAngle":0.66}],
            ["sp1rr","sp1r","sp2r",  {"liftCoef":100, "stallAngle":0.66}],
            ["sp1rr","sp2r","sp2rr", {"liftCoef":100, "stallAngle":0.66}],
            {"group":""},
    ],
    "hydros": [
            ["id1:","id2:"],
            {"beamDeform":55500,"beamStrength":12320193},
            {"beamSpring":1183050,"beamDamp":150},
            {"breakGroupType":1},
            {"breakGroup":["spoiler_hinge_R","spoiler_hinge_L"]},
            {"deformGroup":"tailgateglass_break"},
            ["sp3r","spt4r", {"inputSource":"spoiler","inLimit":0,"outLimit":1.2,"inRate":1,"outRate":1,"inputFactor":1}],
            ["sp3l","spt4l", {"inputSource":"spoiler","inLimit":0,"outLimit":1.2,"inRate":1,"outRate":1,"inputFactor":1}],
            {"breakGroupType":0},
            {"breakGroup":""},
    ],
},
}