Usages of

.Ray(?, ?)
@Override public double isVisible(Point3d point, List<Body> bodies) { Ray ray = new Ray(Vectors.scale(direction, -1), toLocal(point)); for (Body body : bodies) { //Si no la intercepta ningun objeto, es visible if (body.trace(ray).getHit()) return 0; } return 1; }
@Override public double isVisible(Point3d globalPoint, List<Body> bodies) { Point3d localPoint = toLocal(globalPoint); Vector3d direction = Vectors.normalize(Vectors.sub(position, localPoint)); Ray ray = new Ray(direction, localPoint); double maxT = position.distance(localPoint); Ray globalRay = new Ray(toGlobal(ray.getDirection()), toGlobal(ray.getOrigin())); IntersectionContext ic = globalRay.trace(bodies); if (ic.getHit() && maxT - ic.getT() > Shape.EPS) return 0; return 1; }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes