{
"s4b8_sunroof_glass": {
    "information":{
        "authors":"BeamNG",
        "name":"Sunroof",
        "value":200
    },
    "slotType":"s4b8_sunroof",
	"flexbodies": [
        ["mesh", "[group]:", "nonFlexMaterials"],
        //body
        ["s4b8_sunroof", ["s4b8_sunroof"]],
    ],
	"triggers":[
        ["id", "label", "idRef:", "idX:", "idY:", "type", "size", "baseRotation", "rotation", "translation", "baseTranslation"],
        ["sunroofOpen", "Open Sunroof", "rf1","rf1l","rf2", "box", {"x":0.0255, "y":0.0255, "z":0.0255}, {"x":0, "y":0, "z":0}, {"x":0, "y":0, "z":0}, {"x":-0.14, "y":-0.335, "z":0.012}, {"x":0.083, "y":0.1730, "z":0.027}]
    ],
    "triggerEventLinks":[
        ["triggerId:triggers", "action", "targetEventId:events"],
        ["sunroofOpen", "action0", "toggle_sunroofOpen"]
    ],
    "events":[
        ["id", "title", "desc"],
        ["toggle_sunroofOpen", "Toggle Sunroof", "Opens sunroof", {"onDown": "electrics.values.sunroofOpen = 1-(electrics.values.sunroofOpen or 0)", "order": 1}]
    ],
    "hydros": [
            ["id1:","id2:"],
            {"beamSpring":1001000,"beamDamp":120},
        	{"beamDeform":20535,"beamStrength":11250},
            {"beamPrecompression":1.0},
            {"breakGroupType":1},
            {"breakGroup":"sunroof"},
            {"disableTriangleBreaking":true},
            ["n1","rf2", {"inputSource":"sunroofOpen","inLimit":0,"outLimit":1.55,"inRate":0.15,"outRate":0.15,"inputFactor":0.08, "optional":true}],
            ["n1","rf1", {"inputSource":"sunroofOpen","inLimit":0,"outLimit":1.55,"inRate":0.15,"outRate":0.15,"inputFactor":-0.05, "optional":true}],
            {"disableTriangleBreaking":false},
            {"beamPrecompression":1.0},
            {"breakGroupType":0},
            {"breakGroup":""}
    ],
	"nodes": [
		["id", "posX", "posY", "posZ"],
		{"frictionCoef":0.5},
        {"nodeMaterial":"|NM_PLASTIC"},
        //floor
        {"selfCollision":false},
        {"collision":true},
        {"nodeWeight":1.0},
        {"group":"s4b8_sunroof"},
		["nl0", 0.39030, 0.0289, 1.364],
		["n1", 0.0000, 0.0181, 1.4754, {"collision":false}],
		["nr2", -0.39030, 0.0289, 1.364],
		["nl3", 0.39030, 0.4265, 1.3945],
		["nr4", -0.39030, 0.4265, 1.3945],
		["n5", 0.0000, 0.2427, 1.1443, {"collision":false}],
		{"group":""}
	],
		//--Beams--
	"beams":[
		["id1:", "id2:"],
		{"deformLimitExpansion":1.1},
        {"beamSpring":1501000,"beamDamp":120},
        {"beamDeform":60000,"beamStrength":"FLT_MAX"},
        {"deformationTriggerRatio":0.1},


		["nl3","nl0"],
		["nr2","nr4"],
		["nl0","nr2"],
		["nr4","nl3"],
		["nr2","n1"],
		["nl0","n1"],
		["nl3","n1"],
		["nr2","nl3"],
		["nr4","nl0"],
		["nr4","n1"],

		["n5","n1"],
		["n5","nr2"],
		["n5","nl3"],
		["n5","nr4"],
		["n5","nl0"],

		//attach
		{"beamSpring":301000,"beamDamp":120},
        {"beamDeform":5535,"beamStrength":11250},
        {"disableTriangleBreaking":true},
        {"breakGroup":"sunroof"},
		["nl0","rf1l"],
		["nl0","rf2l"],
		["nl0","rf1"],
		["nl0","rf2"],
		["nl0","p1l"],
		["nl0","p2l"],
		//sort of necessary to have these going down to the floor because otherwise there is nothing directly below the pivot
		["nl0","f2ll", {"breakGroupType":1}], //--breakGroupType 1 to avoid any random breakages

		["nr2","rf1r"],
		["nr2","rf2r"],
		["nr2","rf1"],
		["nr2","rf2"],
		["nr2","p1r"],
		["nr2","p2r"],
		//ditto
		["nr2","f2rr", {"breakGroupType":1}],

		//damper
		{"beamSpring":0,"beamDamp":500},
		["nl3","p3l"],
		["nr4","p3r"],

		//trailing end support to not flip inside out
		//hood support (anticlip)
        {"beamSpring":10000800,"beamDamp":80,"beamDeform":505000,"beamStrength":"FLT_MAX"},
        {"beamPrecompression":1, "beamType":"|SUPPORT", "beamLongBound":10},
        ["nl3","f3ll"],
        ["nr4","f3rr"],

        {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1, "beamShortBound":1},
        {"breakGroup":""}

	],
		//--Collision Triangles--
	"triangles":[
		["id1:", "id2:", "id3:"],
		{"group":"s4b8_sunroof"},
        {"dragCoef":3},
        {"groundModel":"plastic"},
	{"triangleType":"NONCOLLIDABLE"},
        ["nl0","nl3","nr4"],
        ["nl0","nr4","nr2"],
	{"triangleType":""}
    ],
},
"s4b8_sunroof_glass_50": {
    "information":{
        "authors":"BeamNG",
        "name":"Tinted Sunroof (50%)",
        "value":200
    },
    "slotType":"s4b8_sunroof",
	"flexbodies": [
        ["mesh", "[group]:", "nonFlexMaterials"],
        //body
        ["s4b8_sunroof.002", ["s4b8_sunroof"]],
    ],
	"triggers":[
        ["id", "label", "idRef:", "idX:", "idY:", "type", "size", "baseRotation", "rotation", "translation", "baseTranslation"],
        ["sunroofOpen", "Open Sunroof", "rf1","rf1l","rf2", "box", {"x":0.0255, "y":0.0255, "z":0.0255}, {"x":0, "y":0, "z":0}, {"x":0, "y":0, "z":0}, {"x":-0.14, "y":-0.335, "z":0.012}, {"x":0.083, "y":0.1730, "z":0.027}]
    ],
    "triggerEventLinks":[
        ["triggerId:triggers", "action", "targetEventId:events"],
        ["sunroofOpen", "action0", "toggle_sunroofOpen"]
    ],
    "events":[
        ["id", "title", "desc"],
        ["toggle_sunroofOpen", "Toggle Sunroof", "Opens sunroof", {"onDown": "electrics.values.sunroofOpen = 1-(electrics.values.sunroofOpen or 0)", "order": 1}]
    ],
    "hydros": [
            ["id1:","id2:"],
            {"beamSpring":1001000,"beamDamp":120},
        	{"beamDeform":20535,"beamStrength":11250},
            {"beamPrecompression":1.0},
            {"breakGroupType":1},
            {"breakGroup":"sunroof"},
            {"disableTriangleBreaking":true},
            ["n1","rf2", {"inputSource":"sunroofOpen","inLimit":0,"outLimit":1.55,"inRate":0.15,"outRate":0.15,"inputFactor":0.08, "optional":true}],
            ["n1","rf1", {"inputSource":"sunroofOpen","inLimit":0,"outLimit":1.55,"inRate":0.15,"outRate":0.15,"inputFactor":-0.05, "optional":true}],
            {"disableTriangleBreaking":false},
            {"beamPrecompression":1.0},
            {"breakGroupType":0},
            {"breakGroup":""}
    ],
	"nodes": [
		["id", "posX", "posY", "posZ"],
		{"frictionCoef":0.5},
        {"nodeMaterial":"|NM_PLASTIC"},
        //floor
        {"selfCollision":false},
        {"collision":true},
        {"nodeWeight":1.0},
        {"group":"s4b8_sunroof"},
		["nl0", 0.39030, 0.0289, 1.364],
		["n1", 0.0000, 0.0181, 1.4754, {"collision":false}],
		["nr2", -0.39030, 0.0289, 1.364],
		["nl3", 0.39030, 0.4265, 1.3945],
		["nr4", -0.39030, 0.4265, 1.3945],
		["n5", 0.0000, 0.2427, 1.1443, {"collision":false}],
		{"group":""}
	],
		//--Beams--
	"beams":[
		["id1:", "id2:"],
		{"deformLimitExpansion":1.1},
        {"beamSpring":1501000,"beamDamp":120},
        {"beamDeform":60000,"beamStrength":"FLT_MAX"},
        {"deformationTriggerRatio":0.1},


		["nl3","nl0"],
		["nr2","nr4"],
		["nl0","nr2"],
		["nr4","nl3"],
		["nr2","n1"],
		["nl0","n1"],
		["nl3","n1"],
		["nr2","nl3"],
		["nr4","nl0"],
		["nr4","n1"],

		["n5","n1"],
		["n5","nr2"],
		["n5","nl3"],
		["n5","nr4"],
		["n5","nl0"],

		//attach
		{"beamSpring":301000,"beamDamp":120},
        {"beamDeform":5535,"beamStrength":11250},
        {"disableTriangleBreaking":true},
        {"breakGroup":"sunroof"},
		["nl0","rf1l"],
		["nl0","rf2l"],
		["nl0","rf1"],
		["nl0","rf2"],
		["nl0","p1l"],
		["nl0","p2l"],
		//sort of necessary to have these going down to the floor because otherwise there is nothing directly below the pivot
		["nl0","f2ll", {"breakGroupType":1}], //--breakGroupType 1 to avoid any random breakages

		["nr2","rf1r"],
		["nr2","rf2r"],
		["nr2","rf1"],
		["nr2","rf2"],
		["nr2","p1r"],
		["nr2","p2r"],
		//ditto
		["nr2","f2rr", {"breakGroupType":1}],

		//damper
		{"beamSpring":0,"beamDamp":500},
		["nl3","p3l"],
		["nr4","p3r"],

		//trailing end support to not flip inside out
		//hood support (anticlip)
        {"beamSpring":10000800,"beamDamp":80,"beamDeform":505000,"beamStrength":"FLT_MAX"},
        {"beamPrecompression":1, "beamType":"|SUPPORT", "beamLongBound":10},
        ["nl3","f3ll"],
        ["nr4","f3rr"],

        {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1, "beamShortBound":1},
        {"breakGroup":""}

	],
		//--Collision Triangles--
	"triangles":[
		["id1:", "id2:", "id3:"],
		{"group":"s4b8_sunroof"},
        {"dragCoef":3},
        {"groundModel":"plastic"},
	{"triangleType":"NONCOLLIDABLE"},
        ["nl0","nl3","nr4"],
        ["nl0","nr4","nr2"],
	{"triangleType":""}
    ],
},
"s4b8_sunroof_glass_100": {
    "information":{
        "authors":"BeamNG",
        "name":"Tinted Sunroof (100%)",
        "value":200
    },
    "slotType":"s4b8_sunroof",
	"flexbodies": [
        ["mesh", "[group]:", "nonFlexMaterials"],
        //body
        ["s4b8_sunroof.001", ["s4b8_sunroof"]],
    ],
	"triggers":[
        ["id", "label", "idRef:", "idX:", "idY:", "type", "size", "baseRotation", "rotation", "translation", "baseTranslation"],
        ["sunroofOpen", "Open Sunroof", "rf1","rf1l","rf2", "box", {"x":0.0255, "y":0.0255, "z":0.0255}, {"x":0, "y":0, "z":0}, {"x":0, "y":0, "z":0}, {"x":-0.14, "y":-0.335, "z":0.012}, {"x":0.083, "y":0.1730, "z":0.027}]
    ],
    "triggerEventLinks":[
        ["triggerId:triggers", "action", "targetEventId:events"],
        ["sunroofOpen", "action0", "toggle_sunroofOpen"]
    ],
    "events":[
        ["id", "title", "desc"],
        ["toggle_sunroofOpen", "Toggle Sunroof", "Opens sunroof", {"onDown": "electrics.values.sunroofOpen = 1-(electrics.values.sunroofOpen or 0)", "order": 1}]
    ],
    "hydros": [
            ["id1:","id2:"],
            {"beamSpring":1001000,"beamDamp":120},
        	{"beamDeform":20535,"beamStrength":11250},
            {"beamPrecompression":1.0},
            {"breakGroupType":1},
            {"breakGroup":"sunroof"},
            {"disableTriangleBreaking":true},
            ["n1","rf2", {"inputSource":"sunroofOpen","inLimit":0,"outLimit":1.55,"inRate":0.15,"outRate":0.15,"inputFactor":0.08, "optional":true}],
            ["n1","rf1", {"inputSource":"sunroofOpen","inLimit":0,"outLimit":1.55,"inRate":0.15,"outRate":0.15,"inputFactor":-0.05, "optional":true}],
            {"disableTriangleBreaking":false},
            {"beamPrecompression":1.0},
            {"breakGroupType":0},
            {"breakGroup":""}
    ],
	"nodes": [
		["id", "posX", "posY", "posZ"],
		{"frictionCoef":0.5},
        {"nodeMaterial":"|NM_PLASTIC"},
        //floor
        {"selfCollision":false},
        {"collision":true},
        {"nodeWeight":1.0},
        {"group":"s4b8_sunroof"},
		["nl0", 0.39030, 0.0289, 1.364],
		["n1", 0.0000, 0.0181, 1.4754, {"collision":false}],
		["nr2", -0.39030, 0.0289, 1.364],
		["nl3", 0.39030, 0.4265, 1.3945],
		["nr4", -0.39030, 0.4265, 1.3945],
		["n5", 0.0000, 0.2427, 1.1443, {"collision":false}],
		{"group":""}
	],
		//--Beams--
	"beams":[
		["id1:", "id2:"],
		{"deformLimitExpansion":1.1},
        {"beamSpring":1501000,"beamDamp":120},
        {"beamDeform":60000,"beamStrength":"FLT_MAX"},
        {"deformationTriggerRatio":0.1},


		["nl3","nl0"],
		["nr2","nr4"],
		["nl0","nr2"],
		["nr4","nl3"],
		["nr2","n1"],
		["nl0","n1"],
		["nl3","n1"],
		["nr2","nl3"],
		["nr4","nl0"],
		["nr4","n1"],

		["n5","n1"],
		["n5","nr2"],
		["n5","nl3"],
		["n5","nr4"],
		["n5","nl0"],

		//attach
		{"beamSpring":301000,"beamDamp":120},
        {"beamDeform":5535,"beamStrength":11250},
        {"disableTriangleBreaking":true},
        {"breakGroup":"sunroof"},
		["nl0","rf1l"],
		["nl0","rf2l"],
		["nl0","rf1"],
		["nl0","rf2"],
		["nl0","p1l"],
		["nl0","p2l"],
		//sort of necessary to have these going down to the floor because otherwise there is nothing directly below the pivot
		["nl0","f2ll", {"breakGroupType":1}], //--breakGroupType 1 to avoid any random breakages

		["nr2","rf1r"],
		["nr2","rf2r"],
		["nr2","rf1"],
		["nr2","rf2"],
		["nr2","p1r"],
		["nr2","p2r"],
		//ditto
		["nr2","f2rr", {"breakGroupType":1}],

		//damper
		{"beamSpring":0,"beamDamp":500},
		["nl3","p3l"],
		["nr4","p3r"],

		//trailing end support to not flip inside out
		//hood support (anticlip)
        {"beamSpring":10000800,"beamDamp":80,"beamDeform":505000,"beamStrength":"FLT_MAX"},
        {"beamPrecompression":1, "beamType":"|SUPPORT", "beamLongBound":10},
        ["nl3","f3ll"],
        ["nr4","f3rr"],

        {"beamPrecompression":1, "beamType":"|NORMAL", "beamLongBound":1, "beamShortBound":1},
        {"breakGroup":""}

	],
		//--Collision Triangles--
	"triangles":[
		["id1:", "id2:", "id3:"],
		{"group":"s4b8_sunroof"},
        {"dragCoef":3},
        {"groundModel":"plastic"},
	{"triangleType":"NONCOLLIDABLE"},
        ["nl0","nl3","nr4"],
        ["nl0","nr4","nr2"],
	{"triangleType":""}
    ],
},
}