local e={}local c do local e=(CFrame.new()).pointToObjectSpace function c(c,D,U)local W=e(c,U)local K,z,p=D.x/2,D.y/2,D.z/2 local H,Q,E=W.x,W.y,W.z return H*H<K*K and(Q*Q<z*z and E*E<p*p)end end local D do local e=(CFrame.new()).pointToObjectSpace function D(c,D,U,W)local K=e(c,U)local z,p,H=D.x/2,D.y/2,D.z/2 local Q,E,P=K.x,K.y,K.z local h=Q>z and Q-z or Q<-z and Q+z or 0 local r=E>p and E-p or E<-p and E+p or 0 local l=P>H and P-H or P<-H and P+H or 0 return(h*h+r*r)+l*l<W*W end end


local Region={}



local BoxPointCollision do
	local VecDiv=CFrame.new().pointToObjectSpace--Right Division, yo.
	function BoxPointCollision(CFrame,Size,Point)
		local Relative	=VecDiv(CFrame, Point)
		local sx,sy,sz	=Size.x/2,Size.y/2,Size.z/2
		local rx,ry,rz	=Relative.x,Relative.y,Relative.z
		return			rx*rx<sx*sx and ry*ry<sy*sy and rz*rz<sz*sz
	end
end



local BoxSphereCollision do
	local VecDiv=CFrame.new().pointToObjectSpace--Right Division, yo.
	function BoxSphereCollision(CFrame,Size,Center,Radius)
		local Relative	=VecDiv(CFrame,Center)
		local sx,sy,sz	=Size.x/2,Size.y/2,Size.z/2
		local rx,ry,rz	=Relative.x,Relative.y,Relative.z
		local dx		=rx>sx and rx-sx--Faster than if statement
						or rx<-sx and rx+sx
						or 0
		local dy		=ry>sy and ry-sy
						or ry<-sy and ry+sy
						or 0
		local dz		=rz>sz and rz-sz
						or rz<-sz and rz+sz
						or 0
		return dx*dx+dy*dy+dz*dz<Radius*Radius
	end
end


