OK, if the following variable cityClone were to be initialized as cityClone = city.cloneObject() and simply added to the world, the endless runner would forever run seamlessly. Alas, Chunk2.obj is of the exact same size as City.obj and it's in the exact same place in Max, but when I reach it in my game it's always lower and slightly to its left. Only significant difference in the handling of the two, as far as I can tell, is that not all parts of the city variable are merged onto it (and it has, as its child, treesRoot) whereas for cityClone I call mergeAll right from the start. But as I'm not even looking for its transformed center, just translating it by the same amount as I translated city, I can't see how this would be an issue.
Object3D[] parts = Loader.loadOBJ("City5/City.obj", "City5/City.mtl", .05f);
int numberOfSubParts = 0;
treesRoot = Object3D.createDummyObj();
for (int i = 0; i < parts.length; i++) {
if (parts[i].getName().toLowerCase().startsWith("tree")) {
parts[i].setTransparency(100);
parts[i].setCulling(false);
theWorld.addObject(parts[i]);
treesRoot.addChild(parts[i]);
parts[i].build();
}
else numberOfSubParts++;
}
Object3D[] subParts = new Object3D[numberOfSubParts];
int h = 0;
for (int i = 0; i < parts.length; i++) {
if (!parts[i].getName().toLowerCase().startsWith("tree"))
subParts[h++] = parts[i];
}
city = Object3D.mergeAll(subParts);
city.addChild(treesRoot);
city.build();
city.rotateX((float)Math.PI*-.5f);//-.5f
final SimpleVector center = city.getTransformedCenter();
city.translate(-center.x, -center.y, -center.z);
cityClone = Object3D.mergeAll(Loader.loadOBJ("City5/Chunk2.obj", "City5/Chunk2.mtl", .05f));
cityClone.build();
cityClone.rotateX((float)Math.PI*-.5f);//-.5f
cityClone.translate(-center.x, -center.y, -center.z);
cityClone.translate(character.getZ().x*-59700f, 0, character.getZ().z*-59700f);
theWorld.addObject(cityClone);
theWorld.addObject(city);