cCuboid


Index:
Articles
Classes
Hooks

Quick navigation:
BannerPattern
BossBarColor
BossBarDivisionType
cArrowEntity
cBeaconEntity
cBedEntity
cBlockArea
cBlockEntity
cBlockEntityWithItems
cBlockInfo
cBoat
cBoundingBox
cBrewingstandEntity
cChatColor
cChestEntity
cChunkDesc
cClientHandle
cColor
cCommandBlockEntity
cCompositeChat
cCraftingGrid
cCraftingRecipe
cCryptoHash
cCuboid
cDispenserEntity
cDropperEntity
cDropSpenserEntity
cEnchantments
cEnderCrystal
cEntity
cEntityEffect
cExpBottleEntity
cExpOrb
cFallingBlock
cFile
cFireChargeEntity
cFireworkEntity
cFloater
cFlowerPotEntity
cFurnaceEntity
cGhastFireballEntity
cHangingEntity
cHopperEntity
cIniFile
cInventory
cItem
cItemFrame
cItemGrid
cItems
cJson
cJukeboxEntity
cLeashKnot
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
cStringCompression
cTCPLink
cTeam
cThrownEggEntity
cThrownEnderPearlEntity
cThrownSnowballEntity
cTNTEntity
cUDPEndpoint
cUrlClient
cUrlParser
CustomStatistic
cUUID
cWebAdmin
cWindow
cWitherSkullEntity
cWorld
EffectID
HTTPFormData
HTTPRequest
HTTPTemplateRequest
ItemCategory
lxp
SmokeDirection
sqlite3
StatisticsManager
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)
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
Point1Vector3i
Point2Vector3i
Assigns all the coords to the specified values. Sort-state is ignored.
Clamp
LimitscCuboid
Clamps this cuboid, so that it doesn't reach outside of Limits in any direction. Assumes both cuboids are sorted.
ClampSize
MaxSizeVector3i
Clamps this cuboid's p2 so that the cuboid's size doesn't exceed the specified max size. Assumes the cuboid is sorted.
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.
IsSorted
boolean
Returns true if this cuboid is sorted
Move
OffsetVector3i
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 by APIDump on 2024-10-25 05:01:00, Build ID Unknown, Commit approx: 0325de7dacaf1e2feaea5eaab4791bc23d78f9e7