local Z=require(script:WaitForChild("\103\106\107"))local w=require(script:WaitForChild("\115\117\112\112\111\114\116\115"))local z=require(script:WaitForChild("\118\101\114\116\105\099\101\115"))local A=require(script:WaitForChild("\100\114\097\119"))local M={}local S={__index=M}
--[[
This rotated region3 module is a bit different than the one I previously wrote. This uses GJK to do the collision calculations and 
as such does not calculate the minimum translation vector. In addition it does not calculate the intersection points anymore either. 
I don't think that had much place in a rotated region3 module.

As far as new features the module now supports a vast array of shapes and point clouds meaning more accurate collision!

API:

Constructors:
	region.new(cframe, size)
		> Creates a region from a cframe which acts as the center of the region and size which extends to 
		> the corners like a block part.
	region.block(cframe, size)
		> This is the exact same as the region.new constructor, but has a different name.
	region.wedge(cframe, size)
		> Creates a region from a cframe which acts as the center of the region and size which extends to 
		> the corners like a wedge part.
	region.cornerWedge(cframe, size)
		> Creates a region from a cframe which acts as the center of the region and size which extends to 
		> the corners like a cornerWedge part.
	region.cylinder(cframe, size)
		> Creates a region from a cframe which acts as the center of the region and size which extends to 
		> the corners like a cylinder part.
	region.ellipsoid(cframe, size)
		> Creates a region from a cframe which acts as the center of the region and size which extends to 
		> the corners like a ball part.
	region.pointCloud(cloud)
		> Creates a region from a table of points. The region is treated as a convex 3D shape when doing the collision detections.
	region.fromPart(part)
		> Creates a region from a part in the game. It can be used on any base part, but the region 
		> will treat unknown shapes (meshes, unions, etc) as block shapes.

Methods:
	region:cast(ignore instance or table (descendants as well), int maxParts)
		> returns a table full of parts that are inside the region
	region:castPart(basePart)
		> returns a boolean as to whether or not a given part is within a region or not
	region:castPoint(vector3)
		> returns a boolean as to whether or not a given point is within a region or not
	
Properties:
	region.CFrame
		> cframe that represents the center of the region
	region.Size
		> vector3 that represents the size of the region
--]]

local gjk = require(script:WaitForChild("gjk"))
local support = require(script:WaitForChild("supports"))
local vertices = require(script:WaitForChild("vertices"))
local draw = require(script:WaitForChild("draw"))

local region3 = {}
local region3_mt = { __index = region3 }
