public FloatBuffer getVertices() {
        // There are 3 floats needed for each vertex (x,y,z)
        final int numberOfFloats = vertices.size() * 3;
        FloatBuffer verticesBuffer = BufferUtils.createFloatBuffer(numberOfFloats); 

        // Force the limit, set the cap - the largest number of floats we will use the buffer for
        verticesBuffer.limit(numberOfFloats);

        // Copy the values from the list to the direct float buffer
        for (Vector3f v : vertices) {
            verticesBuffer.put(v.x).put(v.y).put(v.z);
        }

        vertices.clear();
        return verticesBuffer;
    }
Retrieves the vertices from the Triangle buffer.
jme3-jbullet/src/main/java/com/jme3/bullet/util/DebugShapeFactory.java