raycast method
RaycastResult<ShapeHitbox> ?
raycast(
- Vector2 direction, {
- Vector2? origin,
- double? maxDistance,
- Iterable<
ShapeHitbox> ? ignoreHitboxes,
Implementation
RaycastResult<ShapeHitbox>? raycast(
Vector2 direction, {
Vector2? origin,
double? maxDistance,
Iterable<ShapeHitbox>? ignoreHitboxes,
}) {
try {
return gameRef.raycast(
Ray2(
origin: origin ?? rectCollision.center.toVector2(),
direction: direction,
),
maxDistance: maxDistance,
ignoreHitboxes: [
...children.query<ShapeHitbox>(),
..._getSensorsHitbox(),
...ignoreHitboxes ?? [],
],
);
} catch (e) {
return null;
}
}