Could you please explain me what Coord and Coord2d are, and how does rc and sc of Gob are connected with each other?
And what the difference between w9's coordinate system and w10's in general?
For example, here's old version of a method which finds a nearest gob to the point by the given resname.
- Code: Select all
public Gob findNearestObjectToPoint(int radius, Coord coord, String... names) {
Coord my = coord;
double min = radius*11;
Gob nearest = null;
synchronized (ui().sess.glob.oc) {
for (Gob gob :ui().sess.glob.oc) {
double dist = gob.rc.dist(my);
if (dist < min) {
boolean matches = false;
for (String name : names) {
if (gob.getres()!=null) {
if (gob.getres().name.contains(name)) {
matches = true;
break;
}
}
}
if (matches) {
min = dist;
nearest = gob;
}
}
}
}
return nearest;
}
How I'll need to change it to get it work with w10 coord system?