public static FloatBuffer createVector3Buffer(FloatBuffer buf, int vertices) {
        if (buf != null && buf.limit() == 3 * vertices) {
            buf.rewind();
            return buf;
        }

        return createFloatBuffer(3 * vertices);
    }
Create a new FloatBuffer of an appropriate size to hold the specified
number of Vector3f object data only if the given buffer if not already
the right size.

@param buf
           the buffer to first check and rewind
@param vertices
           number of vertices that need to be held by the newly created
           buffer
@return the requested new FloatBuffer
jme3-core/src/main/java/com/jme3/util/BufferUtils.java