This line doesn't do anything.
you have to use setters here, like setVertex(i, vector) in this case.