Region3: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Anaminus
visual
>Anaminus
visual
(No difference)

Revision as of 01:55, 17 April 2011

A Region3 is used to represent a size and a location in 3D space.

A representation of a Region3 with its lower and upper points. The colored arrows represent the orientation of the world space at (0, 0, 0).

A Region3 can be created with the Region3.new constructor, which receives two Vector3 values:

Region3.new( Vector3.new(1, 1, 1), Vector3.new(9, 9, 9) )
-- a Region3 with a size of (8, 8, 8) and a position at (5, 5, 5)

This constructor can only create a bounding box. That is, you can't create a rotated Region3, because you can only define two corners of the bounding box. The first argument is the lower corner of the bounding box, while the second argument is the upper corner. The above example returns a Region3 with a size of (8, 8, 8) and a position of (5, 5, 5).

When printed, the Region3's CFrame and Size are displayed:

5, 5, 5, 1, 0, 0, 0, 1, 0, 0, 0, 1; 8, 8, 8

Constructors

Constructor Description
Region3.new(Vector3, Vector3) Creates a new Region3 out of two Vector3 values.

Properties

All the of a properties Region3 userdata are read-only and cannot be set or edited directly. You must create a new Region3 using Region3.new() to make the properties change.

Property Type Description
Region3.CFrame CFrame The center location and rotation of the the Region3
Region3.Size Vector3 The 3D size of the Region3

See Also