OptionalcollisionBit set of groups the query belongs to. Defaults to every bit.
OptionalcollisionBit set of groups the query may hit. Defaults to every bit.
Direction of the ray in world space. Need not be unit length; hit distances are reported in world units along the normalized direction, so the magnitude does not scale them.
OptionalignoredBodies to skip entirely — §30's "ignored bodies", whose canonical use is excluding the character that cast the ray. Compared by handle identity.
OptionalignoredIndividual colliders to skip, for when a body has several and only some should be invisible to the query.
OptionalincludeWhether sensors take part (§30 "sensor inclusion"). Defaults to false:
a sensor exerts no forces (§24) and is usually a trigger volume rather
than geometry, so line-of-sight and ground checks should not stop at one.
OptionalmaxHow far along the ray to search, in world units. Defaults to unbounded.
OptionalmaxUpper bound on the number of hits returned. Defaults to unbounded, and is
forced to 1 when mode is "first".
OptionalmodeStop at the first hit or collect them all (§30). Defaults to "all".
"first" means the nearest hit for the ray and shape casts, which sweep
in order; for overlap and point queries, where there is no natural order,
it means an arbitrary one.
Start of the ray in world space. A Vector2 widens to z = 0.
Optionalpredicate§30's "custom filters" — the last word on whether a candidate counts.
Called after the cheap tests above have passed, once per candidate, and must be a pure function of its argument: it runs inside the query, its call order is the solver's traversal order, and a predicate with side effects would make query results depend on that order (§33).
OptionalsortedSort hits by ascending distance before returning them (§30 "sorted hits").
Defaults to false, because sorting costs and many callers only count or
scan. Ignored for OverlapQuery, whose hits carry no distance.
A ray cast through the world (§30, §37
raycast).The ray is carried inline rather than as a separate
Rayobject — see the module header.