raycastClosest method

bool raycastClosest([
  1. Vec3? from,
  2. Vec3? to,
  3. RayOptions? options,
  4. RaycastResult? result,
])

Ray cast, and return information of the closest hit. @return True if any body was hit.

Implementation

bool raycastClosest([Vec3? from, Vec3? to, RayOptions? options, RaycastResult? result]) {
  options ??= RayOptions();
  options.mode = RayMode.closest;
  options.from = from;
  options.to = to;
  options.result = result;
  return _tmpRay.intersectWorld(this, options);
}