/** Bounded plane clipped by extent box, * works like a cheap but limited polygon * @author: Phil Gage */ class BoundedPlane extends AbstractPlane { Extent extent; // for Polygon BoundedPlane (Color color) { super(color); } BoundedPlane (Point point, Vector3 normal, Extent extent, Color color) { super(point,normal,color); this.extent = extent; } /** Returns positive if ray intersects plane within extent */ double intersect (Ray ray, Intersection intersection) { double t = super.intersect (ray,intersection); if (t > 0.0) { if (extent.inside(intersection.point)) { intersection.obj = this; return t; } } intersection.obj = null; return 0.0; } Extent getExtent () { return extent; } }