From 3859c190d162c4746bc344b0a7e71f41aa16ccb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Sun, 23 Feb 2025 16:12:18 +0300 Subject: [PATCH] vector3 typing improvements --- data/scripts/types/vector3.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/data/scripts/types/vector3.lua b/data/scripts/types/vector3.lua index 04304d2..289285a 100644 --- a/data/scripts/types/vector3.lua +++ b/data/scripts/types/vector3.lua @@ -220,7 +220,6 @@ function Vector3:rotated(axis, angle) return vaxis end ----@diagnostic disable-next-line: undefined-field vaxis = vaxis:normalized() local cosa = math.cos(angle) local sina = math.sin(angle) @@ -293,12 +292,18 @@ function Vector3:horizontal() end ---- CONSTANTS +---@type Vector3 Vector3.UP = Vector3(0, 1, 0) -Vector3.DOWN = -Vector3.UP +---@type Vector3 +Vector3.DOWN = Vector3(0, -1, 0) +---@type Vector3 Vector3.FORWARD = Vector3(0, 0, -1) -Vector3.BACK = -Vector3.FORWARD +---@type Vector3 +Vector3.BACK = Vector3(0, 0, 1) +---@type Vector3 Vector3.RIGHT = Vector3(1, 0, 0) -Vector3.LEFT = -Vector3.RIGHT +---@type Vector3 +Vector3.LEFT = Vector3(-1, 0, 0) ------------------- return Vector3