cCuboid


Index:
Articles
Classes
Hooks

Quick navigation:
cArrowEntity
cBeaconEntity
cBlockArea
cBlockEntity
cBlockEntityWithItems
cBlockInfo
cBoundingBox
cBrewingstandEntity
cChatColor
cChestEntity
cChunkDesc
cClientHandle
cCommandBlockEntity
cCompositeChat
cCraftingGrid
cCraftingRecipe
cCryptoHash
cCuboid
cDispenserEntity
cDropperEntity
cDropSpenserEntity
cEnchantments
cEntity
cEntityEffect
cExpBottleEntity
cFile
cFireChargeEntity
cFireworkEntity
cFloater
cFlowerPotEntity
cFurnaceEntity
cGhastFireballEntity
cHangingEntity
cHopperEntity
cIniFile
cInventory
cItem
cItemFrame
cItemGrid
cItems
cJson
cJukeboxEntity
cLineBlockTracer
cLuaWindow
cMap
cMapManager
cMobHeadEntity
cMobSpawnerEntity
cMojangAPI
cMonster
cNetwork
cNoteEntity
cObjective
cPainting
cPawn
cPickup
cPlayer
cPlugin
cPluginLua
cPluginManager
cProjectileEntity
cRankManager
cRoot
cScoreboard
cServer
cServerHandle
cSignEntity
cSplashPotionEntity
cStatManager
cStringCompression
cTCPLink
cTeam
cThrownEggEntity
cThrownEnderPearlEntity
cThrownSnowballEntity
cTNTEntity
cTracer
cUDPEndpoint
cUrlClient
cUrlParser
cWebAdmin
cWindow
cWitherSkullEntity
cWorld
HTTPFormData
HTTPRequest
HTTPTemplateRequest
ItemCategory
lxp
sqlite3
TakeDamageInfo
tolua
Vector3d
Vector3f
Vector3i
Globals

Contents


cCuboid class

cCuboid offers some native support for integral-boundary cuboids. A cuboid internally consists of two Vector3i-s. By default the cuboid doesn't make any assumptions about the defining points, but for most of the operations in the cCuboid class, the p1 member variable is expected to be the minima and the p2 variable the maxima. The Sort() function guarantees this condition.

The Cuboid considers both its edges inclusive.


Member variables

NameTypeNotes
p1 Vector3i The first corner. Usually the lesser of the two coords in each set
p2 Vector3i The second corner. Usually the larger of the two coords in each set

Functions

NameParametersReturn valueNotes
() (constructor)
Point1Vector3i
Point2Vector3i
cCuboid
Creates a new Cuboid object with the specified points as its corners.
() (constructor)
X1number
Y1number
Z1number
X2number
Y2number
Z2number
cCuboid
Creates a new Cuboid object with the specified points as its corners.
() (constructor)
Xnumber
Ynumber
Znumber
cCuboid
Creates a new Cuboid object with the specified point as both its corners (the cuboid has a size of 1 in each direction).
() (constructor)
cCuboid
Creates a new Cuboid object with all-zero coords
() (constructor)
OtherCuboidcCuboid
cCuboid
Creates a new Cuboid object as a copy of OtherCuboid
Assign
SrcCuboidcCuboid
Copies all the coords from the src cuboid to this cuboid. Sort-state is ignored.
Assign
X1number
Y1number
Z1number
X2number
Y2number
Z2number
Assigns all the coords to the specified values. Sort-state is ignored.
ClampX
MinXnumber
MaxXnumber
Clamps both X coords into the range provided. Sortedness-agnostic.
ClampY
MinYnumber
MaxYnumber
Clamps both Y coords into the range provided. Sortedness-agnostic.
ClampZ
MinZnumber
MaxZnumber
Clamps both Z coords into the range provided. Sortedness-agnostic.
DifX
number
Returns the difference between the two X coords (X-size minus 1). Assumes sorted.
DifY
number
Returns the difference between the two Y coords (Y-size minus 1). Assumes sorted.
DifZ
number
Returns the difference between the two Z coords (Z-size minus 1). Assumes sorted.
DoesIntersect
OtherCuboidcCuboid
boolean
Returns true if this cuboid has at least one voxel in common with OtherCuboid. Note that edges are considered inclusive. Assumes both sorted.
Engulf
PointVector3i
If needed, expands the cuboid to include the specified point. Doesn't shrink. Assumes sorted.
Expand
SubMinXnumber
AddMaxXnumber
SubMinYnumber
AddMaxYnumber
SubMinZnumber
AddMaxZnumber
Expands the cuboid by the specified amount in each direction. Works on unsorted cuboids as well. NOTE: this function doesn't check for underflows.
GetVolume
number
Returns the volume of the cuboid, in blocks. Note that the volume considers both coords inclusive. Works on unsorted cuboids, too.
IsCompletelyInside
OuterCuboidcCuboid
boolean
Returns true if this cuboid is completely inside (in all directions) in OuterCuboid. Assumes both sorted.
IsInside
PointVector3d
boolean
Returns true if the specified point (floating-point coords) is inside this cuboid. Assumes sorted.
IsInside
PointVector3i
boolean
Returns true if the specified point (integral coords) is inside this cuboid. Assumes sorted.
IsInside
Xnumber
Ynumber
Znumber
boolean
Returns true if the specified point (integral coords) is inside this cuboid. Assumes sorted.
IsSorted
boolean
Returns true if this cuboid is sorted
Move
OffsetXnumber
OffsetYnumber
OffsetZnumber
Adds the specified offsets to each respective coord, effectively moving the Cuboid. Sort-state is ignored and preserved.
Sort Sorts the internal representation so that p1 contains the lesser coords and p2 contains the greater coords.
Generated on 2017-03-29 13:00:06, Build ID Unknown, Commit approx: 5dc0189a160a9ab4d6c9c2865fc8ff5d7ca32d69