public void updateCounts() {
        if (getBuffer(Type.InterleavedData) != null) {
            throw new IllegalStateException("Should update counts before interleave");
        }

        VertexBuffer pb = getBuffer(Type.Position);
        VertexBuffer ib = getBuffer(Type.Index);
        if (pb != null) {
            vertCount = pb.getData().limit() / pb.getNumComponents();
        }
        if (ib != null) {
            elementCount = computeNumElements(ib.getData().limit());
        } else {
            elementCount = computeNumElements(vertCount);
        }
        instanceCount = computeInstanceCount();
    }
Update the {@link #getVertexCount() vertex} and
{@link #getTriangleCount() triangle} counts for this mesh
based on the current data. This method should be called
after the {@link Buffer#capacity() capacities} of the mesh's
{@link VertexBuffer vertex buffers} has been altered.

@throws IllegalStateException If this mesh is in
{@link #setInterleaved() interleaved} format.
jme3-core/src/main/java/com/jme3/scene/Mesh.java