public BoundingBox(Vector3f min, Vector3f max) { setMinMax(min, max); }
@Override public void updateModelBound() { if (boundingBox == null) { boundingBox = new BoundingBox(); } Vector3f min = new Vector3f(Float.MAX_VALUE, Float.MAX_VALUE, Float.MAX_VALUE); Vector3f max = new Vector3f(Float.MIN_VALUE, Float.MIN_VALUE, Float.MIN_VALUE); for (Vector3f v : vertices) { min.set(Math.min(min.x, v.x), Math.min(min.y, v.y), Math.min(min.z, v.z)); max.set(Math.max(max.x, v.x), Math.max(max.y, v.y), Math.max(max.z, v.z)); } boundingBox.setMinMax(min, max); }
private void setMinMax(BoundingBox bbox, boolean doMin, int axis, float value) { Vector3f min = bbox.getMin(null); Vector3f max = bbox.getMax(null); if (doMin) { min.set(axis, value); } else { max.set(axis, value); } bbox.setMinMax(min, max); }
/** * Instantly emits available particles, up to num. */ public void emitParticles(int num) { // Force world transform to update this.getWorldTransform(); TempVars vars = TempVars.get(); BoundingBox bbox = (BoundingBox) this.getMesh().getBound(); Vector3f min = vars.vect1; Vector3f max = vars.vect2; bbox.getMin(min); bbox.getMax(max); if (!Vector3f.isValidVector(min)) { min.set(Vector3f.POSITIVE_INFINITY); } if (!Vector3f.isValidVector(max)) { max.set(Vector3f.NEGATIVE_INFINITY); } for(int i=0;i<num;i++) { if( emitParticle(min, max) == null ) break; } bbox.setMinMax(min, max); this.setBoundRefresh(); vars.release(); }
bbox.setMinMax(min, max); this.setBoundRefresh();
public BoundingBox(Vector3f min, Vector3f max) { setMinMax(min, max); }
public BoundingBox(Vector3f min, Vector3f max) { setMinMax(min, max); }
private void setMinMax(BoundingBox bbox, boolean doMin, int axis, float value) { Vector3f min = bbox.getMin(null); Vector3f max = bbox.getMax(null); if (doMin) { min.set(axis, value); } else { max.set(axis, value); } bbox.setMinMax(min, max); }
private void setMinMax(BoundingBox bbox, boolean doMin, int axis, float value) { Vector3f min = bbox.getMin(null); Vector3f max = bbox.getMax(null); if (doMin) { min.set(axis, value); } else { max.set(axis, value); } bbox.setMinMax(min, max); }
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); }
/** * Instantly emits all the particles possible to be emitted. Any particles * which are currently inactive will be spawned immediately. */ public void emitAllParticles() { // Force world transform to update this.getWorldTransform(); TempVars vars = TempVars.get(); BoundingBox bbox = (BoundingBox) this.getMesh().getBound(); Vector3f min = vars.vect1; Vector3f max = vars.vect2; bbox.getMin(min); bbox.getMax(max); if (!Vector3f.isValidVector(min)) { min.set(Vector3f.POSITIVE_INFINITY); } if (!Vector3f.isValidVector(max)) { max.set(Vector3f.NEGATIVE_INFINITY); } while (emitParticle(min, max) != null); bbox.setMinMax(min, max); this.setBoundRefresh(); vars.release(); }
/** * Instantly emits available particles, up to num. */ public void emitParticles(int num) { // Force world transform to update this.getWorldTransform(); TempVars vars = TempVars.get(); BoundingBox bbox = (BoundingBox) this.getMesh().getBound(); Vector3f min = vars.vect1; Vector3f max = vars.vect2; bbox.getMin(min); bbox.getMax(max); if (!Vector3f.isValidVector(min)) { min.set(Vector3f.POSITIVE_INFINITY); } if (!Vector3f.isValidVector(max)) { max.set(Vector3f.NEGATIVE_INFINITY); } for(int i=0;i<num;i++) { if( emitParticle(min, max) == null ) break; } bbox.setMinMax(min, max); this.setBoundRefresh(); vars.release(); }
bbox.setMinMax(min, max); this.setBoundRefresh();
bbox.setMinMax(min, max); this.setBoundRefresh();