private BoundingBox createBox(int l, int r) { TempVars vars = TempVars.get(); Vector3f min = vars.vect1.set(new Vector3f(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY)); Vector3f max = vars.vect2.set(new Vector3f(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY)); Vector3f v1 = vars.vect3, v2 = vars.vect4, v3 = vars.vect5; for (int i = l; i <= r; i++) { getTriangle(i, v1, v2, v3); BoundingBox.checkMinMax(min, max, v1); BoundingBox.checkMinMax(min, max, v2); BoundingBox.checkMinMax(min, max, v3); } BoundingBox bbox = new BoundingBox(min, max); vars.release(); return bbox; }
public void computeFromTris(int[] indices, Mesh mesh, int start, int end) { if (end - start <= 0) { return; } TempVars vars = TempVars.get(); Vector3f vect1 = vars.vect1; Vector3f vect2 = vars.vect2; Triangle triangle = vars.triangle; Vector3f min = vect1.set(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY); Vector3f max = vect2.set(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY); Vector3f point; for (int i = start; i < end; i++) { mesh.getTriangle(indices[i], triangle); point = triangle.get(0); checkMinMax(min, max, point); point = triangle.get(1); checkMinMax(min, max, point); point = triangle.get(2); checkMinMax(min, max, point); } center.set(min.addLocal(max)); center.multLocal(0.5f); xExtent = max.x - center.x; yExtent = max.y - center.y; zExtent = max.z - center.z; vars.release(); }
for (int i = start; i < end; i++) { point = tris[i].get(0); checkMinMax(min, max, point); point = tris[i].get(1); checkMinMax(min, max, point); point = tris[i].get(2); checkMinMax(min, max, point);
private void expandBoxToContainTri(BoundingBox bbox, OCTTriangle t){ Vector3f min = bbox.getMin(null); Vector3f max = bbox.getMax(null); BoundingBox.checkMinMax(min, max, t.get1()); BoundingBox.checkMinMax(min, max, t.get2()); BoundingBox.checkMinMax(min, max, t.get3()); bbox.setMinMax(min, max); }
private BoundingBox createBox(int l, int r) { TempVars vars = TempVars.get(); Vector3f min = vars.vect1.set(new Vector3f(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY)); Vector3f max = vars.vect2.set(new Vector3f(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY)); Vector3f v1 = vars.vect3, v2 = vars.vect4, v3 = vars.vect5; for (int i = l; i <= r; i++) { getTriangle(i, v1, v2, v3); BoundingBox.checkMinMax(min, max, v1); BoundingBox.checkMinMax(min, max, v2); BoundingBox.checkMinMax(min, max, v3); } BoundingBox bbox = new BoundingBox(min, max); vars.release(); return bbox; }
private BoundingBox createBox(int l, int r) { TempVars vars = TempVars.get(); Vector3f min = vars.vect1.set(new Vector3f(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY)); Vector3f max = vars.vect2.set(new Vector3f(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY)); Vector3f v1 = vars.vect3, v2 = vars.vect4, v3 = vars.vect5; for (int i = l; i <= r; i++) { getTriangle(i, v1, v2, v3); BoundingBox.checkMinMax(min, max, v1); BoundingBox.checkMinMax(min, max, v2); BoundingBox.checkMinMax(min, max, v3); } BoundingBox bbox = new BoundingBox(min, max); vars.release(); return bbox; }
public void computeFromTris(int[] indices, Mesh mesh, int start, int end) { if (end - start <= 0) { return; } TempVars vars = TempVars.get(); Vector3f vect1 = vars.vect1; Vector3f vect2 = vars.vect2; Triangle triangle = vars.triangle; Vector3f min = vect1.set(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY); Vector3f max = vect2.set(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY); Vector3f point; for (int i = start; i < end; i++) { mesh.getTriangle(indices[i], triangle); point = triangle.get(0); checkMinMax(min, max, point); point = triangle.get(1); checkMinMax(min, max, point); point = triangle.get(2); checkMinMax(min, max, point); } center.set(min.addLocal(max)); center.multLocal(0.5f); xExtent = max.x - center.x; yExtent = max.y - center.y; zExtent = max.z - center.z; vars.release(); }
public void computeFromTris(int[] indices, Mesh mesh, int start, int end) { if (end - start <= 0) { return; } TempVars vars = TempVars.get(); Vector3f vect1 = vars.vect1; Vector3f vect2 = vars.vect2; Triangle triangle = vars.triangle; Vector3f min = vect1.set(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY); Vector3f max = vect2.set(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY); Vector3f point; for (int i = start; i < end; i++) { mesh.getTriangle(indices[i], triangle); point = triangle.get(0); checkMinMax(min, max, point); point = triangle.get(1); checkMinMax(min, max, point); point = triangle.get(2); checkMinMax(min, max, point); } center.set(min.addLocal(max)); center.multLocal(0.5f); xExtent = max.x - center.x; yExtent = max.y - center.y; zExtent = max.z - center.z; vars.release(); }
for (int i = start; i < end; i++) { point = tris[i].get(0); checkMinMax(min, max, point); point = tris[i].get(1); checkMinMax(min, max, point); point = tris[i].get(2); checkMinMax(min, max, point);
for (int i = start; i < end; i++) { point = tris[i].get(0); checkMinMax(min, max, point); point = tris[i].get(1); checkMinMax(min, max, point); point = tris[i].get(2); checkMinMax(min, max, point);