function RotatedRegion3.CastPoint(z,G)local o=GJK.new(z.Set,{G},z.Centroid,G,z.Support,Supports.PointCloud)return o:IsColliding()end function RotatedRegion3.CastPart(z,G)local o=RotatedRegion3.FromPart(G)local a=GJK.new(z.Set,o.Set,z.Centroid,o.Centroid,z.Support,o.Support)return a:IsColliding()end function RotatedRegion3.FindPartsInRegion3(o,G,z)local a={}local C=game.Workspace:FindPartsInRegion3(o.AlignedRegion3,G,z)for G=1,#C,1 do if o:CastPart(C[G])then table.insert(a,C[G])end end return a end function RotatedRegion3.FindPartsInRegion3WithIgnoreList(o,G,z)G=G or{}local a={}local C=game.Workspace:FindPartsInRegion3WithIgnoreList(o.AlignedRegion3,G,z)for G=1,#C,1 do if o:CastPart(C[G])then table.insert(a,C[G])end end return a end function RotatedRegion3.FindPartsInRegion3WithWhiteList(o,G,z)G=G or{}local a={}local C=game.Workspace:FindPartsInRegion3WithWhiteList(o.AlignedRegion3,G,z)for G=1,#C,1 do if o:CastPart(C[G])then table.insert(a,C[G])end end return a end function RotatedRegion3.Cast(o,G,z)G=type(G)=="\116\097\098\108\101"and G or{G}return o:FindPartsInRegion3WithIgnoreList(G,z)end


function RotatedRegion3:CastPoint(point)
	local gjk = GJK.new(self.Set, {point}, self.Centroid, point, self.Support, Supports.PointCloud)
	return gjk:IsColliding()
end

function RotatedRegion3:CastPart(part)
	local r3 = RotatedRegion3.FromPart(part)
	local gjk = GJK.new(self.Set, r3.Set, self.Centroid, r3.Centroid, self.Support, r3.Support)
	return gjk:IsColliding()
end

function RotatedRegion3:FindPartsInRegion3(ignore, maxParts)
	local found = {}
	local parts = game.Workspace:FindPartsInRegion3(self.AlignedRegion3, ignore, maxParts)
	for i = 1, #parts do
		if (self:CastPart(parts[i])) then
			table.insert(found, parts[i])
		end
	end
	return found
end

function RotatedRegion3:FindPartsInRegion3WithIgnoreList(ignore, maxParts)
	ignore = ignore or {}
	local found = {}
	local parts = game.Workspace:FindPartsInRegion3WithIgnoreList(self.AlignedRegion3, ignore, maxParts)
	for i = 1, #parts do
		if (self:CastPart(parts[i])) then
			table.insert(found, parts[i])
		end
	end
	return found
end

function RotatedRegion3:FindPartsInRegion3WithWhiteList(whiteList, maxParts)
	whiteList = whiteList or {}
	local found = {}
	local parts = game.Workspace:FindPartsInRegion3WithWhiteList(self.AlignedRegion3, whiteList, maxParts)
	for i = 1, #parts do
		if (self:CastPart(parts[i])) then
			table.insert(found, parts[i])
		end
	end
	return found
end

function RotatedRegion3:Cast(ignore, maxParts)
	ignore = type(ignore) == "table" and ignore or {ignore}
	return self:FindPartsInRegion3WithIgnoreList(ignore, maxParts)
end
