private boolean isInViewVolume( Arc arc ) { float[][] scaledBBox = arc.getBBox(); scaledBBox[0][2] *= zScale; scaledBBox[1][2] *= zScale; return viewRegion.intersects( scaledBBox ); }
/** * Determines if this arc interferes with the given {@link Geometry}. * * @param roi * geometry that is tested for interference * @param zScale * scaling factor applied to z values of the mesh geometry (and bounding boxes) * @return true, if the arc interferes with the geometry, false otherwise */ public boolean interferes( ViewFrustum roi, float zScale ) { float[][] nodeBBox = getBBox(); nodeBBox[0][2] *= zScale; nodeBBox[1][2] *= zScale; return roi.intersects( nodeBBox ); }
/** * Checks whether the screen-space error (after perspective projection) introduced by the fragments of the * {@link Arc} is acceptable. * * @param arc * @return true, if all fragments are fine */ private boolean isScreenSpaceErrorAcceptable( Arc arc ) { float[][] scaledBBox = arc.getBBox(); scaledBBox[0][2] *= zScale; scaledBBox[1][2] *= zScale; float[] eyePos = new float[3]; eyePos[0] = (float) viewRegion.getEyePos().x; eyePos[1] = (float) viewRegion.getEyePos().y; eyePos[2] = (float) viewRegion.getEyePos().z; float dist = VectorUtils.getDistance( scaledBBox, eyePos ); double projectionFactor = viewParams.estimatePixelSizeForSpaceUnit( dist ); double screenError = projectionFactor * arc.geometricError; // System.out.println ("error: " + arc.geometryError); // System.out.println ("screen error: " + screenError); return screenError <= maxPixelError; }