diff options
Diffstat (limited to 'meta/3rd/love2d')
-rw-r--r-- | meta/3rd/love2d/library/love/physics.lua | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/meta/3rd/love2d/library/love/physics.lua b/meta/3rd/love2d/library/love/physics.lua index 616e4791..82ea008a 100644 --- a/meta/3rd/love2d/library/love/physics.lua +++ b/meta/3rd/love2d/library/love/physics.lua @@ -3122,14 +3122,12 @@ function World:queryBoundingBox(topLeftX, topLeftY, bottomRightX, bottomRightY, --- ---[Open in Browser](https://love2d.org/wiki/World:rayCast) --- ----@param fixture love.Fixture # The fixture intersecting the ray. ----@param x number # The x position of the intersection point. ----@param y number # The y position of the intersection point. ----@param xn number # The x value of the surface normal vector of the shape edge. ----@param yn number # The y value of the surface normal vector of the shape edge. ----@param fraction number # The position of the intersection on the ray as a number from 0 to 1 (or even higher if the ray length was changed with the return value). ----@return number control # The ray can be controlled with the return value. A positive value sets a new ray length where 1 is the default value. A value of 0 terminates the ray. If the callback function returns -1, the intersection gets ignored as if it didn't happen. -function World:rayCast(fixture, x, y, xn, yn, fraction) end +---@param x1 number # The x position of the starting point of the ray. +---@param y1 number # The x position of the starting point of the ray. +---@param x2 number # The x position of the end point of the ray. +---@param y2 number # The x value of the surface normal vector of the shape edge. +---@param callback function # A function called for each fixture intersected by the ray. The function gets six arguments and should return a number as a control value. The intersection points fed into the function will be in an arbitrary order. If you wish to find the closest point of intersection, you'll need to do that yourself within the function. The easiest way to do that is by using the fraction value. +function World:rayCast(x1, y1, x2, y2, callback) end --- ---Sets functions for the collision callbacks during the world update. |