Skip to content

Commit

Permalink
add cclua annotation api
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongfq committed Aug 24, 2024
1 parent c6f314b commit b967dc7
Show file tree
Hide file tree
Showing 1,022 changed files with 51,407 additions and 230 deletions.
1 change: 1 addition & 0 deletions .luarc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
],
"workspace.ignoreSubmodules": false,
"diagnostics.globals": [
"DEBUG",
"main",
"api_dir",
"autoconf",
Expand Down
6 changes: 6 additions & 0 deletions addons/cclua/box2d/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/LuaLS/LLS-Addons/main/schemas/addon_config.schema.json",
"words": ["%s+-box2d"],
"files": ["box2d"],
"settings": {}
}
50 changes: 50 additions & 0 deletions addons/cclua/box2d/library/b2/AABB.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---@meta b2.AABB

---An axis aligned bounding box.
---@class b2.AABB
---@field center b2.Vec2 Get the center of the AABB.
---@field extents b2.Vec2 Get the extents of the AABB (half-widths).
---@field perimeter number Get the perimeter length
---@field valid boolean Verify that the bounds are sorted.
---@field lowerBound b2.Vec2
---@field upperBound b2.Vec2
local AABB = {}

---@return any
function AABB:__gc() end

---@return any
function AABB:__olua_move() end

---Combine an AABB into this one.
---@param aabb b2.AABB
---@overload fun(self: b2.AABB, aabb1: b2.AABB, aabb2: b2.AABB)
function AABB:combine(aabb) end

---Does this aabb contain the provided AABB.
---@param aabb b2.AABB
---@return boolean
function AABB:contains(aabb) end

---Get the center of the AABB.
---@return b2.Vec2
function AABB:getCenter() end

---Get the extents of the AABB (half-widths).
---@return b2.Vec2
function AABB:getExtents() end

---Get the perimeter length
---@return number
function AABB:getPerimeter() end

---Verify that the bounds are sorted.
---@return boolean
function AABB:isValid() end

---@param output b2.RayCastOutput
---@param input b2.RayCastInput
---@return boolean
function AABB:rayCast(output, input) end

return AABB
Loading

0 comments on commit b967dc7

Please sign in to comment.