/** * * <code>transform</code> alters the location of the bounding volume by a * rotation, translation and a scalar. * * @param trans * the transform to affect the bound. * @return the new bounding volume. */ public final BoundingVolume transform(Transform trans) { return transform(trans, null); }
/** * <code>updateWorldBound</code> updates the bounding volume that contains * this geometry. The location of the geometry is based on the location of * all this node's parents. * * @see Spatial#updateWorldBound() */ @Override protected void updateWorldBound() { super.updateWorldBound(); if (mesh == null) { throw new NullPointerException("Geometry: " + getName() + " has null mesh"); } if (mesh.getBound() != null) { if (ignoreTransform) { // we do not transform the model bound by the world transform, // just use the model bound as-is worldBound = mesh.getBound().clone(worldBound); } else { worldBound = mesh.getBound().transform(worldTransform, worldBound); } } }
/** * Compute bounds of a geomList * @param list * @param transform * @return */ public static BoundingBox computeUnionBound(GeometryList list, Transform transform) { BoundingBox bbox = new BoundingBox(); TempVars tempv = TempVars.get(); for (int i = 0; i < list.size(); i++) { BoundingVolume vol = list.get(i).getWorldBound(); BoundingVolume newVol = vol.transform(transform, tempv.bbox); //Nehon : prevent NaN and infinity values to screw the final bounding box if (!Float.isNaN(newVol.getCenter().x) && !Float.isInfinite(newVol.getCenter().x)) { bbox.mergeLocal(newVol); } } tempv.release(); return bbox; }
/** * Compute bounds of a geomList * @param list * @param mat * @return */ public static BoundingBox computeUnionBound(GeometryList list, Matrix4f mat) { BoundingBox bbox = new BoundingBox(); TempVars tempv = TempVars.get(); for (int i = 0; i < list.size(); i++) { BoundingVolume vol = list.get(i).getWorldBound(); BoundingVolume store = vol.transform(mat, tempv.bbox); //Nehon : prevent NaN and infinity values to screw the final bounding box if (!Float.isNaN(store.getCenter().x) && !Float.isInfinite(store.getCenter().x)) { bbox.mergeLocal(store); } } tempv.release(); return bbox; }
BoundingVolume recvBox = bv.transform(viewProjMatrix, vars.bbox);
/** * * <code>transform</code> alters the location of the bounding volume by a * rotation, translation and a scalar. * * @param trans * the transform to affect the bound. * @return the new bounding volume. */ public final BoundingVolume transform(Transform trans) { return transform(trans, null); }
/** * * <code>transform</code> alters the location of the bounding volume by a * rotation, translation and a scalar. * * @param trans * the transform to affect the bound. * @return the new bounding volume. */ public final BoundingVolume transform(Transform trans) { return transform(trans, null); }
/** * <code>updateWorldBound</code> updates the bounding volume that contains * this geometry. The location of the geometry is based on the location of * all this node's parents. * * @see Spatial#updateWorldBound() */ @Override protected void updateWorldBound() { super.updateWorldBound(); if (mesh == null) { throw new NullPointerException("Geometry: " + getName() + " has null mesh"); } if (mesh.getBound() != null) { if (ignoreTransform) { // we do not transform the model bound by the world transform, // just use the model bound as-is worldBound = mesh.getBound().clone(worldBound); } else { worldBound = mesh.getBound().transform(worldTransform, worldBound); } } }
/** * <code>updateWorldBound</code> updates the bounding volume that contains * this geometry. The location of the geometry is based on the location of * all this node's parents. * * @see Spatial#updateWorldBound() */ @Override protected void updateWorldBound() { super.updateWorldBound(); if (mesh == null) { throw new NullPointerException("Geometry: " + getName() + " has null mesh"); } if (mesh.getBound() != null) { if (ignoreTransform) { // we do not transform the model bound by the world transform, // just use the model bound as-is worldBound = mesh.getBound().clone(worldBound); } else { worldBound = mesh.getBound().transform(worldTransform, worldBound); } } }
/** * Compute bounds of a geomList * @param list * @param mat * @return */ public static BoundingBox computeUnionBound(GeometryList list, Matrix4f mat) { BoundingBox bbox = new BoundingBox(); TempVars tempv = TempVars.get(); for (int i = 0; i < list.size(); i++) { BoundingVolume vol = list.get(i).getWorldBound(); BoundingVolume store = vol.transform(mat, tempv.bbox); //Nehon : prevent NaN and infinity values to screw the final bounding box if (!Float.isNaN(store.getCenter().x) && !Float.isInfinite(store.getCenter().x)) { bbox.mergeLocal(store); } } tempv.release(); return bbox; }
/** * Compute bounds of a geomList * @param list * @param transform * @return */ public static BoundingBox computeUnionBound(GeometryList list, Transform transform) { BoundingBox bbox = new BoundingBox(); TempVars tempv = TempVars.get(); for (int i = 0; i < list.size(); i++) { BoundingVolume vol = list.get(i).getWorldBound(); BoundingVolume newVol = vol.transform(transform, tempv.bbox); //Nehon : prevent NaN and infinity values to screw the final bounding box if (!Float.isNaN(newVol.getCenter().x) && !Float.isInfinite(newVol.getCenter().x)) { bbox.mergeLocal(newVol); } } tempv.release(); return bbox; }
/** * Compute bounds of a geomList * @param list * @param transform * @return */ public static BoundingBox computeUnionBound(GeometryList list, Transform transform) { BoundingBox bbox = new BoundingBox(); for (int i = 0; i < list.size(); i++) { BoundingVolume vol = list.get(i).getWorldBound(); BoundingVolume newVol = vol.transform(transform); //Nehon : prevent NaN and infinity values to screw the final bounding box if (newVol.getCenter().x != Float.NaN && newVol.getCenter().x != Float.POSITIVE_INFINITY && newVol.getCenter().x != Float.NEGATIVE_INFINITY) { bbox.mergeLocal(newVol); } } return bbox; }
/** * Compute bounds of a geomList * @param list * @param mat * @return */ public static BoundingBox computeUnionBound(GeometryList list, Matrix4f mat) { BoundingBox bbox = new BoundingBox(); BoundingVolume store = null; for (int i = 0; i < list.size(); i++) { BoundingVolume vol = list.get(i).getWorldBound(); store = vol.clone().transform(mat, null); //Nehon : prevent NaN and infinity values to screw the final bounding box if (store.getCenter().x != Float.NaN && store.getCenter().x != Float.POSITIVE_INFINITY && store.getCenter().x != Float.NEGATIVE_INFINITY) { bbox.mergeLocal(store); } } return bbox; }
BoundingVolume recvBox = bv.transform(viewProjMatrix, vars.bbox);