Explorar el Código

Add more options for ground elevation and change their offsets

master
Fen Dweller hace 4 años
padre
commit
6d96b4ed32
Se han modificado 1 ficheros con 20 adiciones y 8 borrados
  1. +20
    -8
      macrovision.js

+ 20
- 8
macrovision.js Ver fichero

@@ -617,12 +617,16 @@ function updateSizes(dirtyOnly = false) {
updateRatios();

if (config.lockYAxis) {
if (config.groundPos === "high") {
config.y = -config.height.toNumber("meters") / 2;
if (config.groundPos === "very-high") {
config.y = -config.height.toNumber("meters") / 12 * 5;
} else if (config.groundPos === "high") {
config.y = -config.height.toNumber("meters") / 12 * 4;
} else if (config.groundPos === "medium") {
config.y = -config.height.toNumber("meters") / 4;
config.y = -config.height.toNumber("meters") / 12 * 3;
} else if (config.groundPos === "low") {
config.y = -config.height.toNumber("meters") / 6;
config.y = -config.height.toNumber("meters") / 12 * 2;
} else if (config.groundPos === "very-low") {
config.y = -config.height.toNumber("meters") / 12;
} else {
config.y = 0;
}
@@ -2405,9 +2409,11 @@ const settingsData = {
type: "select",
default: "bottom",
options: [
"very-high",
"high",
"medium",
"low",
"very-low",
"bottom",
],
get value() {
@@ -3922,14 +3928,20 @@ function prepareEntities() {
let yOffset = 0;

if (config.lockYAxis) {
if (config.groundPos === "high") {
yOffset = config.height.toNumber("meters")/2;
if (config.groundPos === "very-high") {
yOffset = config.height.toNumber("meters") / 12 * 5;
}
else if (config.groundPos === "high") {
yOffset = config.height.toNumber("meters") / 12 * 4;
}
else if (config.groundPos === "medium") {
yOffset = config.height.toNumber("meters")/4;
yOffset = config.height.toNumber("meters") / 12 * 3;
}
else if (config.groundPos === "low") {
yOffset = config.height.toNumber("meters")/6;
yOffset = config.height.toNumber("meters") / 12 * 2;
}
else if (config.groundPos === "very-low") {
yOffset = config.height.toNumber("meters") / 12 * 1;
}
else if (config.groundPos === "bottom") {
yOffset = 0;


Cargando…
Cancelar
Guardar