Vector3i


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


Vector3i class

A Vector3i object uses integer values to describe a point in space.

See also Vector3d for double-precision floating point 3D coords and Vector3f for single-precision floating point 3D coords.


Constants

NameValueNotes
EPS The max difference between two coords for which the coords are assumed equal (in LineCoeffToXYPlane() et al). Quite useless with integer-only vector.
NO_INTERSECTION Special return value for the LineCoeffToXYPlane() et al meaning that there's no intersection with the plane.

Member variables

NameTypeNotes
x number The X coord of the vector.
y number The Y coord of the vector.
z number The Z coord of the vector.

Functions

NameParametersReturn valueNotes
() (constructor)
Vector3i
Creates a new Vector3i object with zero coords.
() (constructor)
xnumber
ynumber
znumber
Vector3i
Creates a new Vector3i object with the specified coords.
() (constructor)
Vector3dVector3d
Vector3i
Creates a new Vector3i object with coords copied and floor()-ed from the specified Vector3d.
operator *
PerCoordMultipliersVector3i
Vector3i
Returns a new Vector3i object that has each of its coords multiplied by the respective coord of the specified vector.
operator *
Multipliernumber
Vector3i
Returns a new Vector3i object that has each of its coords multiplied by the specified number
operator +
AddendVector3i
Vector3i
Returns a new Vector3f object that holds the vector sum of this vector and the specified vector.
operator -
Vector3i
Returns a new Vector3i that is a negative of this vector (all coords multiplied by -1).
operator -
SubtrahendVector3i
Vector3i
Returns a new Vector3i object that holds the vector differrence between this vector and the specified vector.
operator /
Divisornumber
Vector3i
Returns a new Vector3i object that has each of its coords divided by the specified number
operator /
PerCoordDivisorsVector3i
Vector3i
Returns a new Vector3i object that has each of its coords divided by the respective coord of the specified vector.
Abs Updates each coord to its absolute value.
Ceil
Vector3i
Returns a new Vector3i object with coords set to math.ceil of this vector's coords. Normally not too useful with integer-only vectors, but still included for API completeness.
Clamp
minnumber
maxnumber
Clamps each coord into the specified range.
Cross
OtherVector3i
Vector3i
Returns a new Vector3i that is a cross product of this vector and the specified vector.
Dot
OtherVector3i
number
Returns the dot product of this vector and the specified vector.
Equals
OtherVector3i
boolean
Returns true if this vector is exactly the same as the specified vector.
EqualsEps
OtherVector3i
Epsnumber
boolean
Returns true if the differences between each corresponding coords of this vector and the one specified, are less than the specified Eps. Normally not too useful for integer-only vectors, but still included for API completeness.
Floor
Vector3i
Returns a new Vector3i object with coords set to math.floor of this vector's coords. Normally not too useful with integer-only vectors, but still included for API completeness.
HasNonZeroLength
boolean
Returns true if the vector has at least one coord non-zero.
Length
number
Returns the (euclidean) length of this vector.
LineCoeffToXYPlane
Vector3iVector3i
Znumber
number
Returns the coefficient for the line from the specified vector through this vector to reach the specified Z coord. The result satisfies the following equation: (this + Result * (Param - this)).z = Z. Returns the NO_INTERSECTION constant if there's no intersection.
LineCoeffToXZPlane
Vector3iVector3i
Ynumber
number
Returns the coefficient for the line from the specified vector through this vector to reach the specified Y coord. The result satisfies the following equation: (this + Result * (Param - this)).y = Y. Returns the NO_INTERSECTION constant if there's no intersection.
LineCoeffToYZPlane
Vector3iVector3i
Xnumber
number
Returns the coefficient for the line from the specified vector through this vector to reach the specified X coord. The result satisfies the following equation: (this + Result * (Param - this)).x = X. Returns the NO_INTERSECTION constant if there's no intersection.
Move
xnumber
ynumber
znumber
Moves the vector by the specified amount in each axis direction.
Move
DiffVector3i
Adds the specified vector to this vector. Is slightly better performant than adding with a "+" because this doesn't create a new object for the result.
Normalize Normalizes this vector (makes it 1 unit long while keeping the direction). Quite useless for integer-only vectors, since the normalized vector will almost always truncate to zero vector. FIXME: Fails for zero vectors.
NormalizeCopy
Vector3f
Returns a copy of this vector that is normalized (1 unit long while keeping the same direction). Quite useless for integer-only vectors, since the normalized vector will almost always truncate to zero vector. FIXME: Fails for zero vectors.
Set
xnumber
ynumber
znumber
Sets all the coords of the vector at once
SqrLength
number
Returns the (euclidean) length of this vector, squared. This operation is slightly less computationally expensive than Length(), while it conserves some properties of Length(), such as comparison.
TurnCCW Rotates the vector 90 degrees counterclockwise around the vertical axis. Note that this is specific to minecraft's axis ordering, which is X+ left, Z+ down.
TurnCW Rotates the vector 90 degrees clockwise around the vertical axis. Note that this is specific to minecraft's axis ordering, which is X+ left, Z+ down.
addedX
ofsnumber
Vector3i
Returns a copy of the vector, moved by the specified offset on the X axis
addedXZ
ofsXnumber
ofsZnumber
Vector3i
Returns a copy of the vector, moved by the specified offsets on the X and Z axes
addedY
ofsnumber
Vector3i
Returns a copy of the vector, moved by the specified offset on the Y axis
addedZ
ofsnumber
Vector3i
Returns a copy of the vector, moved by the specified offset on the Z axis
Generated by APIDump on 2022-10-28 17:00:47, Build ID Unknown, Commit approx: 21ec3ebe26bff24b5fc6d96f86a441c9c9628247