intersectObjectWithRay method

dynamic intersectObjectWithRay(
  1. dynamic object,
  2. dynamic raycaster,
  3. dynamic includeInvisible
)

Implementation

intersectObjectWithRay(object, raycaster, includeInvisible) {
  var allIntersections = raycaster.intersectObject(object, true, null);

  for (var i = 0; i < allIntersections.length; i++) {
    if (allIntersections[i].object.visible || includeInvisible) {
      return allIntersections[i];
    }
  }

  return false;
}