/** @return a copy of this ray. */ public Ray cpy () { return new Ray(this.origin, this.direction); }
/** @return a copy of this ray. */ public Ray cpy () { return new Ray(this.origin, this.direction); }
/** @return a copy of this ray. */ public Ray cpy () { return new Ray(this.origin, this.direction); }
public static boolean intersectRayWithTriangle(Vector3 r1, Vector3 r2, Vector3 t1, Vector3 t2, Vector3 t3) { Ray ray = new Ray(r1, r2); return Intersector.intersectRayTriangle(ray, t1, t2, t3, null); }
public Ray getCameraRay(int mx, int my) { return getCameraRay(mx, my, new Ray()); }
/** * Checks if the planet p is hit by the screen position x and y. * * @param p * The planet * @return Whether an intersection has occurred */ public static boolean intersectScreenSphere(Planet p, ICamera camera, int sx, int sy, Vector3 v0, Vector3 v1, Vector3 vec, Vector3 intersection) { p.translation.put(vec); v0.set(sx, sy, 0f); v1.set(sx, sy, 0.5f); camera.getCamera().unproject(v0); camera.getCamera().unproject(v1); Ray ray = new Ray(v0, v1.sub(v0).nor()); return Intersector.intersectRaySphere(ray, vec, (float) p.getRadius(), intersection); }
Ray ray = new Ray(tmp1.set(V3_UP).scl(1000).add(start), tmp2.set(V3_DOWN)); if (!Intersector.intersectRayTriangle(ray, startTri.a, startTri.b, startTri.c, null)) { float minDst = Float.POSITIVE_INFINITY;