-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or requestin-latest-dockerIncluded with latest docker images, might not yet be available elsewhereIncluded with latest docker images, might not yet be available elsewhere
Description
A helper class for voxel areas.
It can be created via VoxelArea:new{MinEdge = pmin, MaxEdge = pmax}
.
The coordinates are inclusive, like most other things in Minetest.
Methods
getExtent()
: returns a 3D vector containing the size of the area formed by
MinEdge
andMaxEdge
.getVolume()
: returns the volume of the area formed byMinEdge
and
MaxEdge
.index(x, y, z)
: returns the index of an absolute position in a flat array
starting at1
.x
,y
andz
must be integers to avoid an incorrect index result.- The position (x, y, z) is not checked for being inside the area volume,
being outside can cause an incorrect index result. - Useful for things like
VoxelManip
, raw Schematic specifiers,
PerlinNoiseMap:get2d
/3dMap
, and so on.
indexp(p)
: same functionality asindex(x, y, z)
but takes a vector.- As with
index(x, y, z)
, the components ofp
must be integers, andp
is not checked for being inside the area volume.
- As with
position(i)
: returns the absolute position vector corresponding to index
i
.contains(x, y, z)
: check if (x
,y
,z
) is inside area formed by
MinEdge
andMaxEdge
.containsp(p)
: same as above, except takes a vectorcontainsi(i)
: same as above, except takes an indexi
iter(minx, miny, minz, maxx, maxy, maxz)
: returns an iterator that returns
indices.- from (
minx
,miny
,minz
) to (maxx
,maxy
,maxz
) in the order of
[z [y [x]]]
.
- from (
iterp(minp, maxp)
: same as above, except takes a vector
BuckarooBanzay
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestin-latest-dockerIncluded with latest docker images, might not yet be available elsewhereIncluded with latest docker images, might not yet be available elsewhere
Projects
Status
In review