mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-19 07:56:02 +01:00
fix(client/zoneCreator): no more wild rhombus
This commit is contained in:
@@ -130,16 +130,16 @@ local function startCreator(arg)
|
|||||||
|
|
||||||
drawLines()
|
drawLines()
|
||||||
elseif zoneType == 'box' then
|
elseif zoneType == 'box' then
|
||||||
local offset = math.rad(heading + 45)
|
local rad = math.rad(heading)
|
||||||
local sinT = math.sin(offset)
|
local sinH = math.sin(rad)
|
||||||
local cosT = math.cos(offset)
|
local cosH = math.cos(rad)
|
||||||
local center = vec(xCoord, yCoord)
|
local center = vec(xCoord, yCoord)
|
||||||
---@type vector2[]
|
---@type vector2[]
|
||||||
points = {
|
points = {
|
||||||
center + vec(width * sinT, length * cosT),
|
center + vec((width * cosH + length * sinH), (length * cosH - width * sinH)),
|
||||||
center + vec(-width * cosT, length * sinT),
|
center + vec(-(width * cosH - length * sinH), (length * cosH + width * sinH)),
|
||||||
center + vec(-width * sinT, -length * cosT),
|
center + vec(-(width * cosH + length * sinH), -(length * cosH - width * sinH)),
|
||||||
center + vec(width * cosT, -length * sinT),
|
center + vec((width * cosH - length * sinH), -(length * cosH + width * sinH)),
|
||||||
}
|
}
|
||||||
|
|
||||||
drawLines()
|
drawLines()
|
||||||
|
|||||||
Reference in New Issue
Block a user