/** * Sets the local bounding volume for this mesh to the given bounding volume. If autoCompute is true (default, if * not given) then we will modify the given modelBound to fit the current vertices of this mesh. This will also mark * the spatial as having dirty world bounds. * * @param modelBound * the bounding volume * @param autoCompute * if true, update the given modelBound to fit the vertices of this Mesh. */ public void setModelBound(final BoundingVolume modelBound, final boolean autoCompute) { _modelBound = modelBound != null ? modelBound.clone(_modelBound) : null; if (autoCompute) { updateModelBound(); } markDirty(DirtyType.Bounding); }
/** * Sets the local bounding volume for this mesh to the given bounding volume. If autoCompute is true (default, if * not given) then we will modify the given modelBound to fit the current vertices of this mesh. This will also mark * the spatial as having dirty world bounds. * * @param modelBound * the bounding volume * @param autoCompute * if true, update the given modelBound to fit the vertices of this Mesh. */ public void setModelBound(final BoundingVolume modelBound, final boolean autoCompute) { _modelBound = modelBound != null ? modelBound.clone(_modelBound) : null; if (autoCompute) { updateModelBound(); } markDirty(DirtyType.Bounding); }
/** * Recalculate the local bounding volume of this Mesh to fit its vertices. */ public void updateModelBound() { if (_modelBound != null && _meshData.getVertexBuffer() != null) { // using duplicate to allow walking through buffer without altering current position, etc. // NB: this maintains a measure of thread safety when using shared meshdata. _modelBound.computeFromPoints(_meshData.getVertexBuffer().duplicate()); markDirty(DirtyType.Bounding); } }
/** * Recalculate the local bounding volume of this Mesh to fit its vertices. */ public void updateModelBound() { if (_modelBound != null && _meshData.getVertexBuffer() != null) { // using duplicate to allow walking through buffer without altering current position, etc. // NB: this maintains a measure of thread safety when using shared meshdata. _modelBound.computeFromPoints(_meshData.getVertexBuffer().duplicate()); markDirty(DirtyType.Bounding); } }