summaryrefslogtreecommitdiff
path: root/meta/3rd/love2d/library/love.physics.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-07-20 19:36:35 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-07-20 19:36:35 +0800
commit7801b00a804bcd68aacda265afdf4d774486b4e9 (patch)
treedc73791db11a7c49f2eb25f9141d1497b6e1e7e3 /meta/3rd/love2d/library/love.physics.lua
parentda6942640931afd8f39db0fc84e8e0394f95d9b1 (diff)
downloadlua-language-server-7801b00a804bcd68aacda265afdf4d774486b4e9.zip
update
Diffstat (limited to 'meta/3rd/love2d/library/love.physics.lua')
-rw-r--r--meta/3rd/love2d/library/love.physics.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/3rd/love2d/library/love.physics.lua b/meta/3rd/love2d/library/love.physics.lua
index 21055ea0..5c382108 100644
--- a/meta/3rd/love2d/library/love.physics.lua
+++ b/meta/3rd/love2d/library/love.physics.lua
@@ -49,6 +49,7 @@ function love.physics.newBody(world, type) end
---
---Creates a new ChainShape.
---
+---@overload fun(loop: boolean, points: table):love.ChainShape
---@param loop boolean # If the chain should loop back to the first point.
---@param x1 number # The x position of the first point.
---@param y1 number # The y position of the first point.
@@ -60,6 +61,7 @@ function love.physics.newChainShape(loop, x1, y1, x2, y2) end
---
---Creates a new CircleShape.
---
+---@overload fun(x: number, y: number, radius: number):love.CircleShape
---@param radius number # The radius of the circle.
---@return love.CircleShape shape # The new shape.
function love.physics.newCircleShape(radius) end
@@ -103,6 +105,7 @@ function love.physics.newFixture(body, shape, density) end
---
---Create a friction joint between two bodies. A FrictionJoint applies friction to a body.
---
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected: boolean):love.FrictionJoint
---@param body1 love.Body # The first body to attach to the joint.
---@param body2 love.Body # The second body to attach to the joint.
---@param collideConnected boolean # Specifies whether the two bodies should collide with each other.
@@ -128,6 +131,7 @@ function love.physics.newGearJoint(joint1, joint2, ratio, collideConnected) end
---
---Position and rotation offsets can be specified once the MotorJoint has been created, as well as the maximum motor force and torque that will be be applied to reach the target offsets.
---
+---@overload fun(body1: love.Body, body2: love.Body, correctionFactor: number, collideConnected: boolean):love.MotorJoint
---@param body1 love.Body # The first body to attach to the joint.
---@param body2 love.Body # The second body to attach to the joint.
---@param correctionFactor number # The joint's initial position correction factor, in the range of 1.
@@ -150,6 +154,7 @@ function love.physics.newMouseJoint(body) end
---
---This shape can have 8 vertices at most, and must form a convex shape.
---
+---@overload fun(vertices: table):love.PolygonShape
---@param x1 number # The x position of the first point.
---@param y1 number # The y position of the first point.
---@param x2 number # The x position of the second point.
@@ -164,6 +169,8 @@ function love.physics.newPolygonShape(x1, y1, x2, y2, x3, y3) end
---
---A prismatic joint constrains two bodies to move relatively to each other on a specified axis. It does not allow for relative rotation. Its definition and operation are similar to a revolute joint, but with translation and force substituted for angle and torque.
---
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, ax: number, ay: number, collideConnected: boolean):love.PrismaticJoint
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, ax: number, ay: number, collideConnected: boolean, referenceAngle: number):love.PrismaticJoint
---@param body1 love.Body # The first body to connect with a prismatic joint.
---@param body2 love.Body # The second body to connect with a prismatic joint.
---@param ax number # The x coordinate of the axis vector.
@@ -199,6 +206,7 @@ function love.physics.newPulleyJoint(body1, body2, gx1, gy1, gx2, gy2, x1, y1, x
---
---By default, the local origin is located at the '''center''' of the rectangle as opposed to the top left for graphics.
---
+---@overload fun(x: number, y: number, width: number, height: number, angle: number):love.PolygonShape
---@param width number # The width of the rectangle.
---@param height number # The height of the rectangle.
---@return love.PolygonShape shape # A new PolygonShape.
@@ -209,6 +217,7 @@ function love.physics.newRectangleShape(width, height) end
---
---This joint connects two bodies to a point around which they can pivot.
---
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected: boolean, referenceAngle: number):love.RevoluteJoint
---@param body1 love.Body # The first body.
---@param body2 love.Body # The second body.
---@param collideConnected boolean # Specifies whether the two bodies should collide with each other.
@@ -232,6 +241,8 @@ function love.physics.newRopeJoint(body1, body2, x1, y1, x2, y2, maxLength, coll
---
---Creates a constraint joint between two bodies. A WeldJoint essentially glues two bodies together. The constraint is a bit soft, however, due to Box2D's iterative solver.
---
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected: boolean):love.WeldJoint
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, collideConnected: boolean, referenceAngle: number):love.WeldJoint
---@param body1 love.Body # The first body to attach to the joint.
---@param body2 love.Body # The second body to attach to the joint.
---@param collideConnected boolean # Specifies whether the two bodies should collide with each other.
@@ -241,6 +252,7 @@ function love.physics.newWeldJoint(body1, body2, collideConnected) end
---
---Creates a wheel joint.
---
+---@overload fun(body1: love.Body, body2: love.Body, x1: number, y1: number, x2: number, y2: number, ax: number, ay: number, collideConnected: boolean):love.WheelJoint
---@param body1 love.Body # The first body.
---@param body2 love.Body # The second body.
---@param ax number # The x position of the axis unit vector.
@@ -291,6 +303,7 @@ function Body:applyAngularImpulse(impulse) end
---
---Note that the force components and position must be given in world coordinates.
---
+---@overload fun(fx: number, fy: number, x: number, y: number)
---@param fx number # The x component of force to apply to the center of mass.
---@param fy number # The y component of force to apply to the center of mass.
function Body:applyForce(fx, fy) end
@@ -306,6 +319,7 @@ function Body:applyForce(fx, fy) end
---
---Note that the impulse components and position must be given in world coordinates.
---
+---@overload fun(ix: number, iy: number, x: number, y: number)
---@param ix number # The x component of the impulse applied to the center of mass.
---@param iy number # The y component of the impulse applied to the center of mass.
function Body:applyLinearImpulse(ix, iy) end