public float[] toArray(float[] floats) {
        if (floats == null) {
            floats = new float[2];
        }
        floats[0] = x;
        floats[1] = y;
        return floats;
    }
Copies the vector to the array argument. The current instance is
unaffected.

@param floats storage for the components (must have length&ge;2) or null
    for a new float[2]
@return an array containing the X and Y components in that order (either
    {@code floats} or a new float[2])
jme3-core/src/main/java/com/jme3/math/Vector2f.java