castRay method
void
castRay(
- Vector2 origin,
- Vector2 translation,
- double callback(
- RayHit hit
- QueryFilter? filter,
Casts a ray from origin along translation, invoking callback for
every candidate hit in an arbitrary order.
The callback controls the rest of the cast with its return value: -1 to ignore the hit, 0 to stop, the hit's fraction to clip the ray to the hit, or 1 to continue looking without clipping.
Implementation
void castRay(
Vector2 origin,
Vector2 translation,
double Function(RayHit hit) callback, {
QueryFilter? filter,
}) {
physicsWorld.castRay(origin, translation, callback, filter: filter);
}