-- to be used for the greebling.
Pipe = class(Object, function(o, p1, p2)
	local min = Vec2(math.min(p1.pos.x, p2.pos.x), math.min(p1.pos.y, p2.pos.y))
	local max = Vec2(math.max(p1.pos.x+p1.w, p2.pos.x+p2.w), math.max(p1.pos.y+p1.h, p2.pos.y+p2.w))
	local offset = min:copy():sub(max)
	Object.init(o, min.x, min.y, max.x-min.x, max.y-min.y)
	-- build an svg'ish thing
	o.svg = ObjectGroup()
	o.drawType = 'svg'
	local width = 4*r_scale
	-- build a line of the correct length
	local c = {0,0-width/2, offset:length(), 0+width/2}
    local tl = {c[1], c[2]}
    local tr = {c[1]+c[3], c[2]}
    local bl = {c[1], c[2]+c[4]}
    local br = {c[1]+c[3], c[2]+c[4]}
	o.svg:setSheet(sheets['tiles'])
	o.svg:addCorners(sprites['tiles']['white.png'], tl[1],tl[2], tr[1],tr[2], br[1],br[2], bl[1],bl[2], bludColor(0,0,0,255))
	-- rotate all the points to the correct orientation
	o.svg:rotate(offset:angle())
	o.svg:storeTransform()
end)
