function RotatedRegion3.CastPoint(m,Q)local V=GJK.new(m.Set,{Q},m.Centroid,Q,m.Support,Supports.PointCloud)return V:IsColliding()end function RotatedRegion3.CastPart(m,Q)local V=RotatedRegion3.FromPart(Q)local e=GJK.new(m.Set,V.Set,m.Centroid,V.Centroid,m.Support,V.Support)return e:IsColliding()end function RotatedRegion3.FindPartsInRegion3(V,Q,m)local e={}local B=game.Workspace:FindPartsInRegion3(V.AlignedRegion3,Q,m)for Q=1,#B,1 do if V:CastPart(B[Q])then table.insert(e,B[Q])end end return e end function RotatedRegion3.FindPartsInRegion3WithIgnoreList(V,Q,m)Q=Q or{}local e={}local B=game.Workspace:FindPartsInRegion3WithIgnoreList(V.AlignedRegion3,Q,m)for Q=1,#B,1 do if V:CastPart(B[Q])then table.insert(e,B[Q])end end return e end function RotatedRegion3.FindPartsInRegion3WithWhiteList(V,Q,m)Q=Q or{}local e={}local B=game.Workspace:FindPartsInRegion3WithWhiteList(V.AlignedRegion3,Q,m)for Q=1,#B,1 do if V:CastPart(B[Q])then table.insert(e,B[Q])end end return e end function RotatedRegion3.Cast(V,Q,m)Q=type(Q)=="\116\097\098\108\101"and Q or{Q}return V:FindPartsInRegion3WithIgnoreList(Q,m)end
-- Public Constructors

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
