Skip to main content

RotatedRegion3

Types

ShapeType

type ShapeType = "Ball" | "Block" | "CornerWedge" | "Cylinder" | "Wedge"

The RotatedRegion3's shape.

SupportFunction

type SupportFunction = (
Set{Vector3},
DirectionVector3
) → Vector3

A support function.

Properties

CFrame

RotatedRegion3.CFrame: CFrame

A CFrame that represents the center of the region.

Size

RotatedRegion3.Size: Vector3

A Vector3 that represents the size of the region.

Shape

RotatedRegion3.Shape: ShapeType

A string that represents the shape type of the RotatedRegion3 object.

Set

RotatedRegion3.Set: {Vector3}

An array of Vector3s that are passed to the support function.

Support

RotatedRegion3.Support: SupportFunction

A function that is used for support in the GJK algorithm.

Centroid

RotatedRegion3.Centroid: Vector3

A Vector3 that represents the center of the set, again used for the GJK algorithm.

AlignedRegion3

RotatedRegion3.AlignedRegion3: Region3

A standard Region3 that represents the world bounding box of the RotatedRegion3 object.

Functions

new

RotatedRegion3.new(
CoordinateFrameCFrame,--

The center of the region.

SizeVector3--

The size of the region.

) → RotatedRegion3

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.

Block

RotatedRegion3.Block(
CoordinateFrameCFrame,--

The center of the region.

SizeVector3--

The size of the region.

) → RotatedRegion3

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.

info

This is the exact same as the RotatedRegion3.new constructor.

Wedge

RotatedRegion3.Wedge(
CoordinateFrameCFrame,--

The center of the region.

SizeVector3--

The size of the region.

) → RotatedRegion3

Creates a region from a CFrame which acts as the center of the region and size which extends to the corners like a WedgePart.

CornerWedge

RotatedRegion3.CornerWedge(
CoordinateFrameCFrame,--

The center of the region.

SizeVector3--

The size of the region.

) → RotatedRegion3

Creates a region from a CFrame which acts as the center of the region and size which extends to the corners like a CornerWedgePart.

Cylinder

RotatedRegion3.Cylinder(
CoordinateFrameCFrame,--

The center of the region.

SizeVector3--

The size of the region.

) → RotatedRegion3

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.

Ball

RotatedRegion3.Ball(
CoordinateFrameCFrame,--

The center of the region.

SizeVector3--

The size of the region.

) → RotatedRegion3

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.

FromPart

RotatedRegion3.FromPart(
BasePartBasePart--

The part to create the region from.

) → RotatedRegion3

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.

CastPoint

RotatedRegion3:CastPoint(
PointVector3--

The point to cast.

) → boolean

Returns true or false if the point is within the RotatedRegion3 object.

CastPart

RotatedRegion3:CastPart(
BasePartBasePart--

The BasePart to cast.

) → boolean

Returns true or false if the part is within the RotatedRegion3 object.

FindPartsInRegion3

RotatedRegion3:FindPartsInRegion3(
IgnoreDescendantsInstanceInstance?,--

The instance to ignore descendants of.

MaxPartsnumber?--

The maximum number of parts to return. Defaults to 20.

) → {BasePart}

Returns array of parts in the RotatedRegion3 object. Will return a maximum number of parts in the array. Parts that either are are descendants of or are the IgnoreDescendantsInstance will be ignored.

info

You should instead use RotatedRegion3.GetPartsInRegion instead. It's slower but it's using a newer API.

FindPartsInRegion3WithIgnoreList

RotatedRegion3:FindPartsInRegion3WithIgnoreList(
IgnoreList{Instance}?,--

The instances to ignore.

MaxPartsnumber?--

The maximum number of parts to return. Defaults to 20.

) → {BasePart}

Returns array of parts in the RotatedRegion3 object. Will return a maximum number of parts in the array. Parts that either are descendants of the IgnoreList or are actually in the IgnoreList will be ignored.

info

You should instead use RotatedRegion3.GetPartsInRegionWithIgnoreList instead. It's slower but it's using a newer API.

FindPartsInRegion3WithWhiteList

RotatedRegion3:FindPartsInRegion3WithWhiteList(
Whitelist{Instance}?,--

The instances to allow.

MaxPartsnumber?--

The maximum number of parts to return. Defaults to 20.

) → {BasePart}

Returns array of parts in the RotatedRegion3 object. Will return a maximum number of parts in the array. Parts that are not either descendants of the Whitelist or are actually in the Whitelist will be ignored.

info

You should instead use RotatedRegion3.GetPartsInRegionWithWhitelist instead. It's slower but it's using a newer API.

GetPartsInRegion

RotatedRegion3:GetPartsInRegion(
IgnoreDescendantsInstanceInstance?,--

The instance to ignore descendants of.

MaxPartsnumber?--

The maximum number of parts to return. Defaults to 20.

) → {BasePart}

Returns array of parts in the RotatedRegion3 object. Will return a maximum number of parts in the array. Parts that either are are descendants of or are the IgnoreDescendantsInstance will be ignored.

Uses Workspace.GetPartBoundsInBox instead of Workspace.FindPartsInRegion3.

GetPartsInRegionWithIgnoreList

RotatedRegion3:GetPartsInRegionWithIgnoreList(
IgnoreList{Instance}?,--

The instances to ignore.

MaxPartsnumber?--

The maximum number of parts to return. Defaults to 20.

) → {BasePart}

Returns array of parts in the RotatedRegion3 object. Will return a maximum number of parts in the array. Parts that either are descendants of the IgnoreList or are actually in the IgnoreList will be ignored.

Uses Workspace.GetPartBoundsInBox instead of Workspace.FindPartsInRegion3.

GetPartsInRegionWithWhiteList

RotatedRegion3:GetPartsInRegionWithWhiteList(
Whitelist{Instance}?,--

The instances to allow.

MaxPartsnumber?--

The maximum number of parts to return. Defaults to 20.

) → {BasePart}

Returns array of parts in the RotatedRegion3 object. Will return a maximum number of parts in the array. Parts that are not either descendants of the Whitelist or are actually in the Whitelist will be ignored.

Uses Workspace.GetPartBoundsInBox instead of Workspace.FindPartsInRegion3.

Cast

RotatedRegion3:Cast(
IgnoreListInstance | {Instance},--

The instance(s) to ignore.

MaxPartsnumber?--

The maximum number of parts to return. Defaults to 20.

) → {BasePart}

Same as the RotatedRegion3.FindPartsInRegion3WithIgnoreList method, but will check if the ignore argument is an array or single instance.

info

You should instead use RotatedRegion3.Cast instead. It's slower but it's using a newer API.

CastInBox

RotatedRegion3:CastInBox(
IgnoreListInstance | {Instance},--

The instance(s) to ignore.

MaxPartsnumber?--

The maximum number of parts to return. Defaults to 20.

) → {BasePart}

Same as the RotatedRegion3.GetPartsInRegionWithIgnoreList method, but will check if the ignore argument is an array or single instance.

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Creates a region from a CFrame which acts as the center of the region and size\nwhich extends to the corners like a block part.",
            "params": [
                {
                    "name": "CoordinateFrame",
                    "desc": "The center of the region.",
                    "lua_type": "CFrame"
                },
                {
                    "name": "Size",
                    "desc": "The size of the region.",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "RotatedRegion3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 175,
                "path": "src/init.lua"
            }
        },
        {
            "name": "Block",
            "desc": "Creates a region from a CFrame which acts as the center of the region and size\nwhich extends to the corners like a block part.\n\n:::info\nThis is the exact same as the [`RotatedRegion3.new`](/api/RotatedRegion3#new) constructor.\n:::",
            "params": [
                {
                    "name": "CoordinateFrame",
                    "desc": "The center of the region.",
                    "lua_type": "CFrame"
                },
                {
                    "name": "Size",
                    "desc": "The size of the region.",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "RotatedRegion3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 206,
                "path": "src/init.lua"
            }
        },
        {
            "name": "Wedge",
            "desc": "Creates a region from a CFrame which acts as the center of the region and size\nwhich extends to the corners like a [WedgePart].",
            "params": [
                {
                    "name": "CoordinateFrame",
                    "desc": "The center of the region.",
                    "lua_type": "CFrame"
                },
                {
                    "name": "Size",
                    "desc": "The size of the region.",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "RotatedRegion3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 233,
                "path": "src/init.lua"
            }
        },
        {
            "name": "CornerWedge",
            "desc": "Creates a region from a CFrame which acts as the center of the region and size\nwhich extends to the corners like a [CornerWedgePart].",
            "params": [
                {
                    "name": "CoordinateFrame",
                    "desc": "The center of the region.",
                    "lua_type": "CFrame"
                },
                {
                    "name": "Size",
                    "desc": "The size of the region.",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "RotatedRegion3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 260,
                "path": "src/init.lua"
            }
        },
        {
            "name": "Cylinder",
            "desc": "Creates a region from a CFrame which acts as the center of the region and size\nwhich extends to the corners like a cylinder part.",
            "params": [
                {
                    "name": "CoordinateFrame",
                    "desc": "The center of the region.",
                    "lua_type": "CFrame"
                },
                {
                    "name": "Size",
                    "desc": "The size of the region.",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "RotatedRegion3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 286,
                "path": "src/init.lua"
            }
        },
        {
            "name": "Ball",
            "desc": "Creates a region from a CFrame which acts as the center of the region and size\nwhich extends to the corners like a ball part.",
            "params": [
                {
                    "name": "CoordinateFrame",
                    "desc": "The center of the region.",
                    "lua_type": "CFrame"
                },
                {
                    "name": "Size",
                    "desc": "The size of the region.",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "RotatedRegion3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 313,
                "path": "src/init.lua"
            }
        },
        {
            "name": "FromPart",
            "desc": "Creates a region from a part in the game. It can be used on any base part, but the region\nwill treat unknown shapes (meshes, unions, etc) as block shapes.",
            "params": [
                {
                    "name": "BasePart",
                    "desc": "The part to create the region from.",
                    "lua_type": "BasePart"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "RotatedRegion3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 338,
                "path": "src/init.lua"
            }
        },
        {
            "name": "CastPoint",
            "desc": "Returns true or false if the point is within the RotatedRegion3 object.",
            "params": [
                {
                    "name": "Point",
                    "desc": "The point to cast.",
                    "lua_type": "Vector3"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 349,
                "path": "src/init.lua"
            }
        },
        {
            "name": "CastPart",
            "desc": "Returns true or false if the part is within the RotatedRegion3 object.",
            "params": [
                {
                    "name": "BasePart",
                    "desc": "The BasePart to cast.",
                    "lua_type": "BasePart"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 358,
                "path": "src/init.lua"
            }
        },
        {
            "name": "FindPartsInRegion3",
            "desc": "Returns array of parts in the RotatedRegion3 object. Will return\na maximum number of parts in the array. Parts that either are are\ndescendants of or are the `IgnoreDescendantsInstance` will be ignored.\n\n:::info\nYou should instead use [RotatedRegion3.GetPartsInRegion](/api/RotatedRegion3#GetPartsInRegion) instead.\nIt's slower but it's using a newer API.\n:::",
            "params": [
                {
                    "name": "IgnoreDescendantsInstance",
                    "desc": "The instance to ignore descendants of.",
                    "lua_type": "Instance?"
                },
                {
                    "name": "MaxParts",
                    "desc": "The maximum number of parts to return. Defaults to 20.",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{BasePart}"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 378,
                "path": "src/init.lua"
            }
        },
        {
            "name": "FindPartsInRegion3WithIgnoreList",
            "desc": "Returns array of parts in the RotatedRegion3 object. Will return\na maximum number of parts in the array. Parts that either are descendants\nof the IgnoreList or are actually in the IgnoreList will be ignored.\n\n:::info\nYou should instead use [RotatedRegion3.GetPartsInRegionWithIgnoreList](/api/RotatedRegion3#GetPartsInRegionWithIgnoreList) instead.\nIt's slower but it's using a newer API.\n:::",
            "params": [
                {
                    "name": "IgnoreList",
                    "desc": "The instances to ignore.",
                    "lua_type": "{Instance}?"
                },
                {
                    "name": "MaxParts",
                    "desc": "The maximum number of parts to return. Defaults to 20.",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{BasePart}"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 412,
                "path": "src/init.lua"
            }
        },
        {
            "name": "FindPartsInRegion3WithWhiteList",
            "desc": "Returns array of parts in the RotatedRegion3 object. Will return\na maximum number of parts in the array. Parts that are not either descendants\nof the Whitelist or are actually in the Whitelist will be ignored.\n\n:::info\nYou should instead use [RotatedRegion3.GetPartsInRegionWithWhitelist](/api/RotatedRegion3#GetPartsInRegionWithWhitelist) instead.\nIt's slower but it's using a newer API.\n:::",
            "params": [
                {
                    "name": "Whitelist",
                    "desc": "The instances to allow.",
                    "lua_type": "{Instance}?"
                },
                {
                    "name": "MaxParts",
                    "desc": "The maximum number of parts to return. Defaults to 20.",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{BasePart}"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 447,
                "path": "src/init.lua"
            }
        },
        {
            "name": "GetPartsInRegion",
            "desc": "Returns array of parts in the RotatedRegion3 object. Will return\na maximum number of parts in the array. Parts that either are are\ndescendants of or are the `IgnoreDescendantsInstance` will be ignored.\n\nUses [Workspace.GetPartBoundsInBox] instead of [Workspace.FindPartsInRegion3].",
            "params": [
                {
                    "name": "IgnoreDescendantsInstance",
                    "desc": "The instance to ignore descendants of.",
                    "lua_type": "Instance?"
                },
                {
                    "name": "MaxParts",
                    "desc": "The maximum number of parts to return. Defaults to 20.",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{BasePart}"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 479,
                "path": "src/init.lua"
            }
        },
        {
            "name": "GetPartsInRegionWithIgnoreList",
            "desc": "Returns array of parts in the RotatedRegion3 object. Will return\na maximum number of parts in the array. Parts that either are descendants\nof the IgnoreList or are actually in the IgnoreList will be ignored.\n\nUses [Workspace.GetPartBoundsInBox] instead of [Workspace.FindPartsInRegion3].",
            "params": [
                {
                    "name": "IgnoreList",
                    "desc": "The instances to ignore.",
                    "lua_type": "{Instance}?"
                },
                {
                    "name": "MaxParts",
                    "desc": "The maximum number of parts to return. Defaults to 20.",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{BasePart}"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 521,
                "path": "src/init.lua"
            }
        },
        {
            "name": "GetPartsInRegionWithWhiteList",
            "desc": "Returns array of parts in the RotatedRegion3 object. Will return\na maximum number of parts in the array. Parts that are not either descendants\nof the Whitelist or are actually in the Whitelist will be ignored.\n\nUses [Workspace.GetPartBoundsInBox] instead of [Workspace.FindPartsInRegion3].",
            "params": [
                {
                    "name": "Whitelist",
                    "desc": "The instances to allow.",
                    "lua_type": "{Instance}?"
                },
                {
                    "name": "MaxParts",
                    "desc": "The maximum number of parts to return. Defaults to 20.",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{BasePart}"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 558,
                "path": "src/init.lua"
            }
        },
        {
            "name": "Cast",
            "desc": "Same as the [RotatedRegion3.FindPartsInRegion3WithIgnoreList](/api/RotatedRegion3#FindPartsInRegion3WithIgnoreList)\nmethod, but will check if the ignore argument is an array or single instance.\n\n:::info\nYou should instead use [RotatedRegion3.Cast](/api/RotatedRegion3#Cast) instead.\nIt's slower but it's using a newer API.\n:::",
            "params": [
                {
                    "name": "IgnoreList",
                    "desc": "The instance(s) to ignore.",
                    "lua_type": "Instance | {Instance}"
                },
                {
                    "name": "MaxParts",
                    "desc": "The maximum number of parts to return. Defaults to 20.",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{BasePart}"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 597,
                "path": "src/init.lua"
            }
        },
        {
            "name": "CastInBox",
            "desc": "Same as the [RotatedRegion3.GetPartsInRegionWithIgnoreList](/api/RotatedRegion3#GetPartsInRegionWithIgnoreList)\nmethod, but will check if the ignore argument is an array or single instance.",
            "params": [
                {
                    "name": "IgnoreList",
                    "desc": "The instance(s) to ignore.",
                    "lua_type": "Instance | {Instance}"
                },
                {
                    "name": "MaxParts",
                    "desc": "The maximum number of parts to return. Defaults to 20.",
                    "lua_type": "number?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{BasePart}"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 610,
                "path": "src/init.lua"
            }
        }
    ],
    "properties": [
        {
            "name": "CFrame",
            "desc": "A CFrame that represents the center of the region.",
            "lua_type": "CFrame",
            "source": {
                "line": 104,
                "path": "src/init.lua"
            }
        },
        {
            "name": "Size",
            "desc": "A Vector3 that represents the size of the region.",
            "lua_type": "Vector3",
            "source": {
                "line": 110,
                "path": "src/init.lua"
            }
        },
        {
            "name": "Shape",
            "desc": "A string that represents the shape type of the RotatedRegion3 object.",
            "lua_type": "ShapeType",
            "source": {
                "line": 116,
                "path": "src/init.lua"
            }
        },
        {
            "name": "Set",
            "desc": "An array of Vector3s that are passed to the support function.",
            "lua_type": "{Vector3}",
            "source": {
                "line": 122,
                "path": "src/init.lua"
            }
        },
        {
            "name": "Support",
            "desc": "A function that is used for support in the GJK algorithm.",
            "lua_type": "SupportFunction",
            "source": {
                "line": 128,
                "path": "src/init.lua"
            }
        },
        {
            "name": "Centroid",
            "desc": "A Vector3 that represents the center of the set, again used for the GJK algorithm.",
            "lua_type": "Vector3",
            "source": {
                "line": 134,
                "path": "src/init.lua"
            }
        },
        {
            "name": "AlignedRegion3",
            "desc": "A standard Region3 that represents the world bounding box of the RotatedRegion3 object.",
            "lua_type": "Region3",
            "source": {
                "line": 140,
                "path": "src/init.lua"
            }
        }
    ],
    "types": [
        {
            "name": "ShapeType",
            "desc": "The RotatedRegion3's shape.",
            "lua_type": "\"Ball\" | \"Block\" | \"CornerWedge\" | \"Cylinder\" | \"Wedge\"",
            "source": {
                "line": 92,
                "path": "src/init.lua"
            }
        },
        {
            "name": "SupportFunction",
            "desc": "A support function.",
            "lua_type": "(Set: {Vector3}, Direction: Vector3) -> Vector3",
            "source": {
                "line": 98,
                "path": "src/init.lua"
            }
        }
    ],
    "name": "RotatedRegion3",
    "desc": "",
    "source": {
        "line": 83,
        "path": "src/init.lua"
    }
}