Files
2026-05-29 15:11:31 +07:00

24 lines
900 B
Lua

--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
local ____exports = {}
local g = _G
local function toVectorWSImpl(_self, v)
local ctor = g.VectorWS
if type(ctor) == "function" then
return ctor(v.x, v.y, v.z)
end
return v
end
--- Поворот точки вокруг origin только по yaw (град), эквивалент RotatePosition(origin, QAngle(0, yaw, 0), point) без нативного API.
local function rotatePositionYawImpl(_self, origin, yawDegrees, point)
local rad = yawDegrees * (math.pi / 180)
local off = point - origin
local c = math.cos(rad)
local s = math.sin(rad)
local rx = off.x * c - off.y * s
local ry = off.x * s + off.y * c
return Vector(origin.x + rx, origin.y + ry, origin.z + off.z)
end
g.toVectorWS = toVectorWSImpl
g.rotatePositionYaw = rotatePositionYawImpl
return ____exports