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) cCuboid Creates a new Cuboid object with all-zero coords
() (constructor) OtherCuboid cCuboid Creates a new Cuboid object as a copy of OtherCuboid
() (constructor) X, Y, Z 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) X1, Y1, Z1, X2, Y2, Z2 cCuboid Creates a new Cuboid object with the specified points as its corners.
() (constructor) Point1, Point2 cCuboid Creates a new Cuboid object with the specified points as its corners.
Assign SrcCuboid Copies all the coords from the src cuboid to this cuboid. Sort-state is ignored.
Assign X1, Y1, Z1, X2, Y2, Z2 Assigns all the coords to the specified values. Sort-state is ignored.
ClampX MinX, MaxX Clamps both X coords into the range provided. Sortedness-agnostic.
ClampY MinY, MaxY Clamps both Y coords into the range provided. Sortedness-agnostic.
ClampZ MinZ, MaxZ 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 OtherCuboid bool Returns true if this cuboid has at least one voxel in common with OtherCuboid. Note that edges are considered inclusive. Assumes both sorted.
Engulf Point If needed, expands the cuboid to include the specified point. Doesn't shrink. Assumes sorted.
Expand SubMinX, AddMaxX, SubMinY, AddMaxY, SubMinZ, AddMaxZ 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 OuterCuboid bool Returns true if this cuboid is completely inside (in all directions) in OuterCuboid. Assumes both sorted.
IsInside X, Y, Z bool Returns true if the specified point (integral coords) is inside this cuboid. Assumes sorted.
IsInside Point bool Returns true if the specified point (floating-point coords) is inside this cuboid. Assumes sorted.
IsInside Point bool Returns true if the specified point (integral coords) is inside this cuboid. Assumes sorted.
IsSorted bool Returns true if this cuboid is sorted
Move OffsetX, OffsetY, OffsetZ 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 2016-08-22 23:53:06, Build ID Unknown, Commit approx: 2ed4af74edd14ae17e1c6c64d44caa7b7fc30d5a