void setup() {
final PVector pos = new PVector(200, 200);
final Polygon square = new Polygon(pos);
final Polygon pentagon = new Polygon(pos);
pentagon.vec.x = 400;
println(square.vec.x); // 200.0
exit();
}
class Polygon {
final PVector vec = new PVector();
Polygon(final PVector v) {
vec.set(v);
}
}
1 Like