sx, sy, sz			= GetInt("size", 15, 17, 7)
thickness			= GetInt("frameThickness", 1)
cx, cy, cz			= GetFloat("frameColor", 0.22, 0.22, 0.22)
frameType			= GetString("frameMaterial", "metal")
verticalDiv			= GetInt("verticalDividers", 0)
dividerThickness	= GetInt("dividerThickness", 1)
glass				= GetString("glass", "MOD/vox/building/window/glass.vox", "brush vox")
hole				= GetString("hole", "MOD/vox/building/window/hole.vox", "brush vox")
height				= {}

function init()
	frameMat	= CreateMaterial(frameType, cx, cy, cz)
	glassMat	= CreateBrush(glass)
	holeMat		= CreateBrush(hole)
	t 			= thickness
	
	Vox(0,0,0)

	Material(frameMat)
	Box(0, 0, 0, sx, sy, sz)
	
	Material(holeMat)
	Box(t, t, 0, sx-t, sy-t, sz)

	depthStart = 1 --if the window is only 2 voxels deep, move the glass and dividers to the edge of the windowframe
	depthEnd = 2
	if sz == 2
	then
		depthStart = 0
		depthend = 2
	elseif sz == 1
	then
		depthStart = 0
		depthEnd = 1
	end
	Material(glassMat)
	Box(t, t, depthStart, sx-t, sy-t, depthStart+1)
	
	
	if verticalDiv > 0
	then
		glassCount = verticalDiv+1
		if verticalDiv % 2 == 0
		then
			divStart = math.floor(sx/glassCount+1)
		else
			divStart = math.floor(sx/glassCount)
		end
		
		Material(frameMat)
		for i=1, verticalDiv, 1
		do
			Box(divStart*i-(dividerThickness/2), 0, depthStart, divStart*i+(dividerThickness/2), sy, depthStart+depthEnd)
		end
	end
end

