strafe-client/luau/tests/Vector.lua
unittensor 66eea1f106 added properties for Vector3 & Vector4:
Vector3.ZERO
Vector3.ONE
Vector3.NEG_ZERO
Vector3.NEG_ONE
Vector3.NEG_X
Vector3.NEG_Y
@Vector4:
Vector4.ZERO
Vector4.ONE
Vector4.NEG_ZERO
Vector4.NEG_ONE
Vector4.NEG_X
Vector4.NEG_Y
2024-01-22 12:22:16 -05:00

37 lines
1.5 KiB
Lua

local v2 = Vector2.new(1, 3)
local v3 = Vector3.new(-10, 30, 50)
local v4 = Vector4.new(50, 30, 10, -1000)
local function InspectVectorTable(Vector: {[string]: number})
local aye: {string} = {"{"}
for k,v in Vector do
table.insert(aye, `{tostring(k)}={tostring(v)}`)
end
table.insert(aye, "}")
return table.concat(aye, " ")
end
print("----StrafeLua----")
print(_VERSION)
print("Vector2=",InspectVectorTable(v2))
print("Vector3=",InspectVectorTable(v3))
print("Vector4=",InspectVectorTable(v4))
print("Vector2.ZERO=",InspectVectorTable(Vector2.ZERO))
print("Vector2.ONE=",InspectVectorTable(Vector2.ONE))
print("Vector2.NEG_ZERO=",InspectVectorTable(Vector2.NEG_ZERO))
print("Vector2.NEG_ONE=",InspectVectorTable(Vector2.NEG_ONE))
print("Vector2.NEG_X=",InspectVectorTable(Vector2.NEG_X))
print("Vector2.NEG_Y=",InspectVectorTable(Vector2.NEG_Y))
print("Vector3.ZERO=",InspectVectorTable(Vector3.ZERO))
print("Vector3.ONE=",InspectVectorTable(Vector3.ONE))
print("Vector3.NEG_ZERO=",InspectVectorTable(Vector3.NEG_ZERO))
print("Vector3.NEG_ONE=",InspectVectorTable(Vector3.NEG_ONE))
print("Vector3.NEG_X=",InspectVectorTable(Vector3.NEG_X))
print("Vector3.NEG_Y=",InspectVectorTable(Vector3.NEG_Y))
print("Vector4.ZERO=",InspectVectorTable(Vector4.ZERO))
print("Vector4.ONE=",InspectVectorTable(Vector4.ONE))
print("Vector4.NEG_ZERO=",InspectVectorTable(Vector4.NEG_ZERO))
print("Vector4.NEG_ONE=",InspectVectorTable(Vector4.NEG_ONE))
print("Vector4.NEG_X=",InspectVectorTable(Vector4.NEG_X))
print("Vector4.NEG_Y=",InspectVectorTable(Vector4.NEG_Y))
print("-----------------")