API Vector2DMixin GetXY

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)

Parameters

 * x, y, z : - Cartesian coordinates.

Details

 * 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.

Examples
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)