mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
fix(zones): correct zone data types (#729)
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
local glm = require 'glm'
|
local glm = require 'glm'
|
||||||
|
|
||||||
---@class ZoneProperties
|
---@class ZoneProperties
|
||||||
---@field coords vector3
|
|
||||||
---@field debug? boolean
|
---@field debug? boolean
|
||||||
---@field debugColour? vector4
|
---@field debugColour? vector4
|
||||||
---@field onEnter fun(self: CZone)?
|
---@field onEnter fun(self: CZone)?
|
||||||
@@ -343,6 +342,7 @@ lib.zones = {}
|
|||||||
|
|
||||||
---@class PolyZone : ZoneProperties
|
---@class PolyZone : ZoneProperties
|
||||||
---@field points vector3[]
|
---@field points vector3[]
|
||||||
|
---@field thickness? number
|
||||||
|
|
||||||
---@param data PolyZone
|
---@param data PolyZone
|
||||||
---@return CZone
|
---@return CZone
|
||||||
@@ -422,9 +422,9 @@ function lib.zones.poly(data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---@class BoxZone : ZoneProperties
|
---@class BoxZone : ZoneProperties
|
||||||
---@field size number | vector3
|
---@field coords vector3
|
||||||
---@field thickness? number
|
---@field size? vector3
|
||||||
---@field rotation? vector4
|
---@field rotation? number | vector3 | vector4 | matrix
|
||||||
|
|
||||||
---@param data BoxZone
|
---@param data BoxZone
|
||||||
---@return CZone
|
---@return CZone
|
||||||
@@ -432,7 +432,7 @@ function lib.zones.box(data)
|
|||||||
data.id = #Zones + 1
|
data.id = #Zones + 1
|
||||||
data.coords = convertToVector(data.coords)
|
data.coords = convertToVector(data.coords)
|
||||||
data.size = data.size and convertToVector(data.size) / 2 or vec3(2)
|
data.size = data.size and convertToVector(data.size) / 2 or vec3(2)
|
||||||
data.thickness = data.size.z * 2 or 4
|
data.thickness = data.size.z * 2
|
||||||
data.rotation = quat(data.rotation or 0, vec3(0, 0, 1))
|
data.rotation = quat(data.rotation or 0, vec3(0, 0, 1))
|
||||||
data.__type = 'box'
|
data.__type = 'box'
|
||||||
data.width = data.size.x * 2
|
data.width = data.size.x * 2
|
||||||
@@ -448,6 +448,7 @@ function lib.zones.box(data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
---@class SphereZone : ZoneProperties
|
---@class SphereZone : ZoneProperties
|
||||||
|
---@field coords vector3
|
||||||
---@field radius? number
|
---@field radius? number
|
||||||
|
|
||||||
---@param data SphereZone
|
---@param data SphereZone
|
||||||
|
|||||||
Reference in New Issue
Block a user