Places a shape in the World, returning any shapes it intersects.
A tag filter can be given to filter out shapes by their collider's tag:
Use nil to skip filtering.
Pass a tag name to only return shapes whose collider has that tag.
Pass a tag name with a ~ in front of it to exclude colliders with that tag.
Pass multiple tags separated by spaces to include multiple tags (works with ~ too).
Provide an optional callback to call for each shape detected. If the callbacks nil, this function returns the first shape detected. In either case this function returns the shape, the hit position, and a penetration vector. The penetration vector represents the direction and distance the shape would need to move so that it is no longer colliding with the input shape.
The angle the shape is rotated around its rotation axis, in radians.
ax
number
The x component of the axis of rotation.
ay
number
The y component of the axis of rotation.
az
number
The z component of the axis of rotation.
maxDistance
number
0
The maximum distance at which a shape can be detected, in meters. Zero will detect shapes touching the input shape, 1.0 will detect shapes within 1 meter of the input shape, etc.
filter
string
nil
Tags to filter by, or nil for no filter.
callback
function
nil
The callback to call for each intersection detected.
The maximum distance at which a shape can be detected, in meters. Zero will detect shapes touching the input shape, 1.0 will detect shapes within 1 meter of the input shape, etc.
filter
string
nil
Tags to filter by, or nil for no filter.
callback
function
nil
The callback to call for each intersection detected.
The angle the shape is rotated around its rotation axis, in radians.
ax
number
The x component of the axis of rotation.
ay
number
The y component of the axis of rotation.
az
number
The z component of the axis of rotation.
maxDistance
number
0
The maximum distance at which a shape can be detected, in meters. Zero will detect shapes touching the input shape, 1.0 will detect shapes within 1 meter of the input shape, etc.
The maximum distance at which a shape can be detected, in meters. Zero will detect shapes touching the input shape, 1.0 will detect shapes within 1 meter of the input shape, etc.