/** Calculates the {@link BoundingBox} of the vertices contained in this mesh. In case no vertices are defined yet a * {@link GdxRuntimeException} is thrown. This method creates a new BoundingBox instance. * * @return the bounding box. */ public BoundingBox calculateBoundingBox () { BoundingBox bbox = new BoundingBox(); calculateBoundingBox(bbox); return bbox; }
/** Calculates the {@link BoundingBox} of the vertices contained in this mesh. In case no vertices are defined yet a * {@link GdxRuntimeException} is thrown. This method creates a new BoundingBox instance. * * @return the bounding box. */ public BoundingBox calculateBoundingBox () { BoundingBox bbox = new BoundingBox(); calculateBoundingBox(bbox); return bbox; }
/** Calculates and updates the {@link #center}, {@link #halfExtents} and {@link #radius} values. This is considered a costly * operation and should not be called frequently. All vertices (points) of the shape are traversed to calculate the maximum and * minimum x, y and z coordinate of the shape. Note that MeshPart is not aware of any transformation that might be applied when * rendering. It calculates the untransformed (not moved, not scaled, not rotated) values. */ public void update () { mesh.calculateBoundingBox(bounds, offset, size); bounds.getCenter(center); bounds.getDimensions(halfExtents).scl(0.5f); radius = halfExtents.len(); }
/** Calculates and updates the {@link #center}, {@link #halfExtents} and {@link #radius} values. This is considered a costly * operation and should not be called frequently. All vertices (points) of the shape are traversed to calculate the maximum and * minimum x, y and z coordinate of the shape. Note that MeshPart is not aware of any transformation that might be applied when * rendering. It calculates the untransformed (not moved, not scaled, not rotated) values. */ public void update () { mesh.calculateBoundingBox(bounds, offset, size); bounds.getCenter(center); bounds.getDimensions(halfExtents).scl(0.5f); radius = halfExtents.len(); }
@Override public void getBoundingBox (BoundingBox bbox) { mesh.calculateBoundingBox(bbox); }
/** Calculates the {@link BoundingBox} of the vertices contained in this mesh. In case no vertices are defined yet a * {@link GdxRuntimeException} is thrown. This method creates a new BoundingBox instance. * * @return the bounding box. */ public BoundingBox calculateBoundingBox () { BoundingBox bbox = new BoundingBox(); calculateBoundingBox(bbox); return bbox; }
@Override public void getBoundingBox (BoundingBox bbox) { bbox.inf(); for (int i = 0; i < subMeshes.length; i++) { subMeshes[i].mesh.calculateBoundingBox(tmpBox); bbox.ext(tmpBox); } }
/** Calculates and updates the {@link #center}, {@link #halfExtents} and {@link #radius} values. This is considered a costly * operation and should not be called frequently. All vertices (points) of the shape are traversed to calculate the maximum and * minimum x, y and z coordinate of the shape. Note that MeshPart is not aware of any transformation that might be applied when * rendering. It calculates the untransformed (not moved, not scaled, not rotated) values. */ public void update () { mesh.calculateBoundingBox(bounds, offset, size); bounds.getCenter(center); bounds.getDimensions(halfExtents).scl(0.5f); radius = halfExtents.len(); }