Source: FrameXML/Vector3D.lua
API[]
- CreateVector3D(x, y, z) : vector - Creates a new vector.
- AreVector3DEqual(left, right) : boolean - Compares if vectors are equal.
Methods[]
- Vector3DMixin:IsEqualTo(vector) : boolean
- Vector3DMixin:GetXYZ() : x, y, z
- Vector3DMixin:SetXYZ(x, y, z)
- Vector3DMixin:ScaleBy(scalar)
- Vector3DMixin:DivideBy(scalar)
- Vector3DMixin:Add(vector)
- Vector3DMixin:Subtract(vector)
- Vector3DMixin:Cross(vector)
- Vector3DMixin:Dot(vector) : dot
- Vector3DMixin:GetLengthSquared() : lengthSquared
- Vector3DMixin:GetLength() : length
- Vector3DMixin:Normalize()
- Vector3DMixin:Clone() : vector
Example[]
local a = CreateVector3D(14, 3, 5)
local b = CreateVector3D(2, 4, 1)
a:Add(b)
print(a:GetXYZ()) -- 16, 7, 6
Used by[]
Function arguments |
Function returns |
Structures
|
Patch changes[]
Patch 7.2.0 (2017-03-28): Added.[1]