intersectsPlane method
Implementation
bool intersectsPlane(Plane plane) {
// check if the ray lies on the plane first
final distToPoint = plane.distanceToPoint(origin);
if (distToPoint == 0) {
return true;
}
final denominator = plane.normal.dot(direction);
if (denominator * distToPoint < 0) {
return true;
}
// ray origin is behind the plane (and is pointing behind it)
return false;
}