Lore archive · Warcraft Wiki, 2023 dump
API Vector2DMixin GetXY
Last wiki revision 2020-06-28
Defines and returns a vector's Cartesian coordinates. x, y = vector:GetXY x, y, z = vector:GetXYZ vector:SetXY(x, y) vector:SetXYZ(x, y, z)
- x, y, z : - Cartesian coordinates.
- Vector2DMixin uses GetXY and SetXY.
- Vector3DMixin uses GetXYZ and SetXYZ.
- Despite similarities, these two mixins are not compatible with each other. They must be manually converted or projected by copying coordinate values from one type to another.
Manually converting a 2D vector to 3D: local x, y = vector2d:GetXY local vector3d = CreateFromMixins(Vector3DMixin) vector3d:SetXYZ(x, y, 0)
Manually projecting a 3D vector to 2D: local x, y, z = vector3d:GetXYZ local vector2d = CreateFromMixins(Vector2DMixin) vector3d:SetXY(x, y)
- - Creates a new vector and applies SetXY.
- - Creates a new vector and applies SetXYZ.
Source
https://warcraft.wiki.gg/wiki/API_Vector2DMixin_GetXY · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.