// cluster
if (cluster.width == 1) {
StageLocation loc = new StageLocation(
MisoUtil.toFull(cluster.x, 2), MisoUtil.toFull(cluster.y, 2),
(byte)DirectionCodes.SOUTHWEST);
list.add(new SceneLocation(loc, 0));
return list;
}
double radius = (double)fwid/2;
int clidx = cluster.width-2;
if (clidx >= CLUSTER_METRICS.length/2 || clidx < 0) {
log.warning("Requested locs from invalid cluster " + cluster + ".", new Exception());
return list;
}
for (double angle = CLUSTER_METRICS[clidx*2]; angle < Math.PI*2;
angle += CLUSTER_METRICS[clidx*2+1]) {
int sx = cx + (int)Math.round(Math.cos(angle) * radius);
int sy = cy + (int)Math.round(Math.sin(angle) * radius);
// obtain the orientation facing toward the center
int orient = 2*(int)(Math.round(angle/(Math.PI/4))%8);
orient = DirectionUtil.rotateCW(DirectionCodes.SOUTH, orient);
orient = DirectionUtil.getOpposite(orient);
// convert them back to full coordinates for the location
int tx = MathUtil.floorDiv(sx, _metrics.finegran);
sx = MisoUtil.toFull(tx, sx-(tx*_metrics.finegran));
int ty = MathUtil.floorDiv(sy, _metrics.finegran);
sy = MisoUtil.toFull(ty, sy-(ty*_metrics.finegran));
StageLocation loc = new StageLocation(sx, sy, (byte) orient);
list.add(new SceneLocation(loc, 0));
}
return list;
}