/** Build a box with the shape of the specified {@link BoundingBox}. * @param box */ public static void build (MeshPartBuilder builder, BoundingBox box) { builder.box(box.getCorner000(obtainV3()), box.getCorner010(obtainV3()), box.getCorner100(obtainV3()), box.getCorner110(obtainV3()), box.getCorner001(obtainV3()), box.getCorner011(obtainV3()), box.getCorner101(obtainV3()), box.getCorner111(obtainV3())); freeAll(); }
/** Build a box with the shape of the specified {@link BoundingBox}. * @param box */ public static void build (MeshPartBuilder builder, BoundingBox box) { builder.box(box.getCorner000(obtainV3()), box.getCorner010(obtainV3()), box.getCorner100(obtainV3()), box.getCorner110(obtainV3()), box.getCorner001(obtainV3()), box.getCorner011(obtainV3()), box.getCorner101(obtainV3()), box.getCorner111(obtainV3())); freeAll(); }
/** Returns whether the given {@link BoundingBox} is in the frustum. * * @param bounds The bounding box * @return Whether the bounding box is in the frustum */ public boolean boundsInFrustum (BoundingBox bounds) { for (int i = 0, len2 = planes.length; i < len2; i++) { if (planes[i].testPoint(bounds.getCorner000(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner001(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner010(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner011(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner100(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner101(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner110(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner111(tmpV)) != PlaneSide.Back) continue; return false; } return true; }
/** Returns whether the given {@link BoundingBox} is in the frustum. * * @param bounds The bounding box * @return Whether the bounding box is in the frustum */ public boolean boundsInFrustum (BoundingBox bounds) { for (int i = 0, len2 = planes.length; i < len2; i++) { if (planes[i].testPoint(bounds.getCorner000(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner001(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner010(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner011(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner100(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner101(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner110(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner111(tmpV)) != PlaneSide.Back) continue; return false; } return true; }
private Vector3[] getCorners(BoundingBox bb) { return new Vector3[]{bb.getCorner000(new Vector3()), bb.getCorner001(new Vector3()), bb.getCorner010(new Vector3()), bb.getCorner011(new Vector3()), bb.getCorner100(new Vector3()), bb.getCorner101(new Vector3()), bb.getCorner110(new Vector3()), bb.getCorner111(new Vector3())}; }
/** Build a box with the shape of the specified {@link BoundingBox}. * @param box */ public static void build (MeshPartBuilder builder, BoundingBox box) { builder.box(box.getCorner000(obtainV3()), box.getCorner010(obtainV3()), box.getCorner100(obtainV3()), box.getCorner110(obtainV3()), box.getCorner001(obtainV3()), box.getCorner011(obtainV3()), box.getCorner101(obtainV3()), box.getCorner111(obtainV3())); freeAll(); }
/** Returns whether the given {@link BoundingBox} is in the frustum. * * @param bounds The bounding box * @return Whether the bounding box is in the frustum */ public boolean boundsInFrustum (BoundingBox bounds) { for (int i = 0, len2 = planes.length; i < len2; i++) { if (planes[i].testPoint(bounds.getCorner000(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner001(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner010(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner011(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner100(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner101(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner110(tmpV)) != PlaneSide.Back) continue; if (planes[i].testPoint(bounds.getCorner111(tmpV)) != PlaneSide.Back) continue; return false; } return true; }