Vector3f


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


Vector3f class

A Vector3f object uses floating point values to describe a point in space.

See also Vector3d for double-precision floating point 3D coords and Vector3i for integer 3D coords.


Constants

NameValueNotes
EPS The max difference between two coords for which the coords are assumed equal (in LineCoeffToXYPlane() et al).
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) Vector3f Creates a new Vector3f object with zero coords
() (constructor) Vector3f Vector3f Creates a new Vector3f object as a copy of the specified vector
() (constructor) x, y, z Vector3f Creates a new Vector3f object with the specified coords
() (constructor) Vector3d Vector3f Creates a new Vector3f object as a copy of the specified Vector3d
() (constructor) Vector3i Vector3f Creates a new Vector3f object as a copy of the specified Vector3i
operator * number Vector3f Returns a new Vector3f object that has each of its coords multiplied by the specified number
operator * Vector3f Vector3f Returns a new Vector3f object that has each of its coords multiplied by the respective coord of the specified vector.
operator + Vector3f Vector3f Returns a new Vector3f object that holds the vector sum of this vector and the specified vector.
operator - Vector3f Returns a new Vector3f that is a negative of this vector (all coords multiplied by -1).
operator - Vector3f Vector3f Returns a new Vector3f object that holds the vector differrence between this vector and the specified vector.
operator / number Vector3f Returns a new Vector3f object with each coord divided by the specified number.
operator / Vector3f Vector3f Returns a new Vector3f object with each coord divided by the corresponding coord from the given vector.
Abs Updates each coord to its absolute value.
Clamp min, max Clamps each coord into the specified range.
Cross Vector3f Vector3f Returns a new Vector3f object that holds the cross product of this vector and the specified vector.
Dot Vector3f number Returns the dot product of this vector and the specified vector.
Equals Vector3f bool Returns true if the specified vector is exactly equal to this vector. Note that this is subject to (possibly imprecise) floating point math.
EqualsEps Rhs, Eps boolean Returns true if the differences between each corresponding coords of this vector and the one specified, are less than the specified Eps.
Floor Vector3i Returns a new Vector3i object with coords set to math.floor of this vector's coords.
HasNonZeroLength boolean Returns true if the vector has at least one coord non-zero. Note that this is subject to (possibly imprecise) floating point math.
Length number Returns the (euclidean) length of this vector
LineCoeffToXYPlane Vector3f, Z 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 Vector3f, Y 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 Vector3f, X 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 X, Y, Z Adds the specified offsets to each coord, effectively moving the vector by the specified coord offsets.
Move Diff 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). FIXME: Fails for zero vectors.
NormalizeCopy Vector3f Returns a copy of this vector that is normalized (1 unit long while keeping the same direction). FIXME: Fails for zero vectors.
Set x, y, z 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.
abs OBSOLETE, use Abs() instead.
clamp min, max OBSOLETE, use Clamp() instead.
Generated on 2016-08-22 23:53:06, Build ID Unknown, Commit approx: 2ed4af74edd14ae17e1c6c64d44caa7b7fc30d5a