castNearest method
Returns the nearest hit, or null.
Implementation
RaycastHit? castNearest(Ray ray, Node root, {double maxDistance = 1000}) {
final hits = cast(ray, root, maxDistance: maxDistance);
return hits.isNotEmpty ? hits.first : null;
}
Returns the nearest hit, or null.
RaycastHit? castNearest(Ray ray, Node root, {double maxDistance = 1000}) {
final hits = cast(ray, root, maxDistance: maxDistance);
return hits.isNotEmpty ? hits.first : null;
}