return mode;
}
@Override
public JsonObject toJson() {
JsonObject sky = new JsonObject();
sky.add("skyYaw", rotation);
sky.add("skyMirrored", mirrored);
sky.add("skyLight", skyLightModifier);
sky.add("mode", mode.name());
sky.add("horizonOffset", horizonOffset);
sky.add("cloudsEnabled", cloudsEnabled);
sky.add("cloudSize", cloudSize);
sky.add("cloudOffset", cloudOffset.toJson());
// always save gradient
sky.add("gradient", gradientJson(gradient));
switch (mode) {
case SKYMAP_PANORAMIC:
case SKYMAP_SPHERICAL:
{
if (!skymap.isEmptyTexture()) {
sky.add("skymap", skymapFileName);
}
break;
}
case SKYBOX:
{
JsonArray array = new JsonArray();
for (int i = 0; i < 6; ++i) {
if (!skybox[i].isEmptyTexture()) {
array.add(skyboxFileName[i]);
} else {
array.add(new JsonNull());
}
}
sky.add("skybox", array);
break;
}
default:
break;
}