/** * @param pointA * @param pointB * @param pointC * @param locationStore * if not null, and this ray intersects, the point of intersection is calculated and stored in this * Vector3 * @return true if this ray intersects a triangle formed by the given three points. * @throws NullPointerException * if any of the points are null. */ @Override public boolean intersectsTriangle(final ReadOnlyVector3 pointA, final ReadOnlyVector3 pointB, final ReadOnlyVector3 pointC, final Vector3 locationStore) { return intersects(pointA, pointB, pointC, locationStore, false); }
assertFalse(pickRay2.intersects(new Vector3[] { v0, v1 }, null));
/** * @param pointA * @param pointB * @param pointC * @param locationStore * if not null, and this ray intersects, the point of intersection is calculated and stored in this * Vector3 * @return true if this ray intersects a triangle formed by the given three points. * @throws NullPointerException * if any of the points are null. */ @Override public boolean intersectsTriangle(final ReadOnlyVector3 pointA, final ReadOnlyVector3 pointB, final ReadOnlyVector3 pointC, final Vector3 locationStore) { return intersects(pointA, pointB, pointC, locationStore, false); }
/** * @param pointA * @param pointB * @param pointC * @param locationStore * if not null, and this ray intersects, the point of intersection is calculated and stored in this * Vector3 as (t, u, v) where t is the distance from the _origin to the point of intersection and (u, v) * is the intersection point on the triangle plane. * @return true if this ray intersects a triangle formed by the given three points. * @throws NullPointerException * if any of the points are null. */ @Override public boolean intersectsTrianglePlanar(final ReadOnlyVector3 pointA, final ReadOnlyVector3 pointB, final ReadOnlyVector3 pointC, final Vector3 locationStore) { return intersects(pointA, pointB, pointC, locationStore, true); }
/** * @param pointA * @param pointB * @param pointC * @param locationStore * if not null, and this ray intersects, the point of intersection is calculated and stored in this * Vector3 as (t, u, v) where t is the distance from the _origin to the point of intersection and (u, v) * is the intersection point on the triangle plane. * @return true if this ray intersects a triangle formed by the given three points. * @throws NullPointerException * if any of the points are null. */ @Override public boolean intersectsTrianglePlanar(final ReadOnlyVector3 pointA, final ReadOnlyVector3 pointB, final ReadOnlyVector3 pointC, final Vector3 locationStore) { return intersects(pointA, pointB, pointC, locationStore, true); }
/** * @param pointA * @param pointB * @param pointC * @param pointD * @param locationStore * if not null, and this ray intersects, the point of intersection is calculated and stored in this * Vector3 * @return true if this ray intersects a triangle formed by the given three points. The points are assumed to be * coplanar. * @throws NullPointerException * if any of the points are null. */ @Override public boolean intersectsQuad(final ReadOnlyVector3 pointA, final ReadOnlyVector3 pointB, final ReadOnlyVector3 pointC, final ReadOnlyVector3 pointD, final Vector3 locationStore) { return intersects(pointA, pointB, pointC, locationStore, false) || intersects(pointA, pointC, pointD, locationStore, false); }
/** * @param pointA * @param pointB * @param pointC * @param pointD * @param locationStore * if not null, and this ray intersects, the point of intersection is calculated and stored in this * Vector3 * @return true if this ray intersects a triangle formed by the given three points. The points are assumed to be * coplanar. * @throws NullPointerException * if any of the points are null. */ @Override public boolean intersectsQuad(final ReadOnlyVector3 pointA, final ReadOnlyVector3 pointB, final ReadOnlyVector3 pointC, final ReadOnlyVector3 pointD, final Vector3 locationStore) { return intersects(pointA, pointB, pointC, locationStore, false) || intersects(pointA, pointC, pointD, locationStore, false); }
/** * @param pointA * @param pointB * @param pointC * @param pointD * @param locationStore * if not null, and this ray intersects, the point of intersection is calculated and stored in this * Vector3 as (t, u, v) where t is the distance from the _origin to the point of intersection and (u, v) * is the intersection point on the triangle plane. * @return true if this ray intersects a quad formed by the given four points. The points are assumed to be * coplanar. * @throws NullPointerException * if any of the points are null. */ @Override public boolean intersectsQuadPlanar(final ReadOnlyVector3 pointA, final ReadOnlyVector3 pointB, final ReadOnlyVector3 pointC, final ReadOnlyVector3 pointD, final Vector3 locationStore) { return intersects(pointA, pointB, pointC, locationStore, true) || intersects(pointA, pointC, pointD, locationStore, true); }
/** * @param pointA * @param pointB * @param pointC * @param pointD * @param locationStore * if not null, and this ray intersects, the point of intersection is calculated and stored in this * Vector3 as (t, u, v) where t is the distance from the _origin to the point of intersection and (u, v) * is the intersection point on the triangle plane. * @return true if this ray intersects a quad formed by the given four points. The points are assumed to be * coplanar. * @throws NullPointerException * if any of the points are null. */ @Override public boolean intersectsQuadPlanar(final ReadOnlyVector3 pointA, final ReadOnlyVector3 pointB, final ReadOnlyVector3 pointC, final ReadOnlyVector3 pointD, final Vector3 locationStore) { return intersects(pointA, pointB, pointC, locationStore, true) || intersects(pointA, pointC, pointD, locationStore, true); }
/** * @param worldVertices * an array of vectors describing a polygon * @return the distance from our origin to the primitive or POSITIVE_INFINITY if we do not intersect. */ @Override public double getDistanceToPrimitive(final Vector3[] worldVertices) { // Intersection test final Vector3 intersect = Vector3.fetchTempInstance(); try { if (intersects(worldVertices, intersect)) { return getOrigin().distance(intersect); } } finally { Vector3.releaseTempInstance(intersect); } return Double.POSITIVE_INFINITY; }
/** * @param worldVertices * an array of vectors describing a polygon * @return the distance from our origin to the primitive or POSITIVE_INFINITY if we do not intersect. */ @Override public double getDistanceToPrimitive(final Vector3[] worldVertices) { // Intersection test final Vector3 intersect = Vector3.fetchTempInstance(); try { if (intersects(worldVertices, intersect)) { return getOrigin().distance(intersect); } } finally { Vector3.releaseTempInstance(intersect); } return Double.POSITIVE_INFINITY; }
transform.applyForward(points[t]); if (ray.intersects(points, null)) { result.add(new PrimitiveKey(_primitiveIndices[i], _section));
transform.applyForward(points[t]); if (ray.intersects(points, null)) { result.add(new PrimitiveKey(_primitiveIndices[i], _section));