public Vertex(Vertex original) { position = original.getPosition(); index = original.getIndex(); inHole = original.getInHole(); UV = original.getUV(); }
/** Adds a new vertex to the mesh **/ private void addVertex(Vertex v) { mVertices.Add(v.getPosition()); //Generate random texture position TODO:Improve this //Vector2 uv = new Vector2 (Random.Range (0.0f, 1.0f), Random.Range (0.0f, 1.0f)); mUVs.Add(v.getUV()); }
/**Duplicates first vertex and set it at last position with UV coord (1,y). This has to be called as the last * of all the polyline modifier functions **/ public void duplicateFirstVertex() { InitialPolyline newPolyline = new InitialPolyline(getSize() + 1); for (int i = 0; i < getSize(); ++i) { newPolyline.setVertex(i, getVertex(i)); } Vertex lastV = new Vertex(getVertex(0)); newPolyline.setVertex(getSize(), lastV); Vector2 newUV = lastV.getUV(); newUV.x = 1.0f; lastV.setUV(newUV); this.mVertices = newPolyline.mVertices; }