Browse Source

Run the source through a formatter

tags/v0.1.0
Fen Dweller 5 years ago
parent
commit
27940dfaf0
12 changed files with 1230 additions and 1233 deletions
  1. +58
    -58
      macrovision.js
  2. +43
    -43
      media/attribution.js
  3. +2
    -2
      presets/buildings.js
  4. +156
    -156
      presets/characters.js
  5. +1
    -1
      presets/fiction.js
  6. +13
    -13
      presets/food.js
  7. +2
    -2
      presets/landmarks.js
  8. +887
    -887
      presets/naturals.js
  9. +14
    -17
      presets/objects.js
  10. +11
    -11
      presets/scenes.js
  11. +3
    -3
      presets/species.js
  12. +40
    -40
      presets/vehicles.js

+ 58
- 58
macrovision.js View File

@@ -195,7 +195,7 @@ function updateEntityElement(entity, element) {
element.style.left = position.x + "px"; element.style.left = position.x + "px";
element.style.top = position.y + "px"; element.style.top = position.y + "px";
element.style.setProperty("--xpos", position.x + "px"); element.style.setProperty("--xpos", position.x + "px");
element.style.setProperty("--entity-height", "'" + entity.views[view].height.to(config.height.units[0].unit.name).format({precision: 2}) + "'");
element.style.setProperty("--entity-height", "'" + entity.views[view].height.to(config.height.units[0].unit.name).format({ precision: 2 }) + "'");
const pixels = math.divide(entity.views[view].height, config.height) * (canvasHeight - 50); const pixels = math.divide(entity.views[view].height, config.height) * (canvasHeight - 50);
const extra = entity.views[view].image.extra; const extra = entity.views[view].image.extra;
const bottom = entity.views[view].image.bottom; const bottom = entity.views[view].image.bottom;
@@ -206,7 +206,7 @@ function updateEntityElement(entity, element) {
if (entity.views[view].rename) if (entity.views[view].rename)
element.querySelector(".entity-name").innerText = entity.name == "" ? "" : entity.views[view].name; element.querySelector(".entity-name").innerText = entity.name == "" ? "" : entity.views[view].name;
else else
element.querySelector(".entity-name").innerText = entity.name;
element.querySelector(".entity-name").innerText = entity.name;


const bottomName = document.querySelector("#bottom-name-" + element.dataset.key); const bottomName = document.querySelector("#bottom-name-" + element.dataset.key);


@@ -238,7 +238,7 @@ function updateSizes(dirtyOnly = false) {
} else { } else {
return e1[1].views[e1[1].view].height.value - e2[1].views[e2[1].view].height.value return e1[1].views[e1[1].view].height.value - e2[1].views[e2[1].view].height.value
} }
}); });


let zIndex = ordered.length; let zIndex = ordered.length;
@@ -256,7 +256,7 @@ function updateSizes(dirtyOnly = false) {


} }


function drawScale(ifDirty=false) {
function drawScale(ifDirty = false) {
if (ifDirty && !worldSizeDirty) if (ifDirty && !worldSizeDirty)
return; return;
function drawTicks(/** @type {CanvasRenderingContext2D} */ ctx, pixelsPer, heightPer) { function drawTicks(/** @type {CanvasRenderingContext2D} */ ctx, pixelsPer, heightPer) {
@@ -538,7 +538,7 @@ function deselect() {
clearViewList(); clearViewList();
clearEntityOptions(); clearEntityOptions();
clearViewOptions(); clearViewOptions();
document.querySelector("#delete-entity").disabled = true; document.querySelector("#delete-entity").disabled = true;


document.querySelector("#grow").disabled = true; document.querySelector("#grow").disabled = true;
@@ -554,13 +554,13 @@ function select(target) {
document.getElementById("options-selected-entity-" + target.dataset.key).selected = "selected"; document.getElementById("options-selected-entity-" + target.dataset.key).selected = "selected";


selected.classList.add("selected"); selected.classList.add("selected");
displayAttribution(selectedEntity.views[selectedEntity.view].image.source); displayAttribution(selectedEntity.views[selectedEntity.view].image.source);


configViewList(selectedEntity, selectedEntity.view); configViewList(selectedEntity, selectedEntity.view);
configEntityOptions(selectedEntity, selectedEntity.view); configEntityOptions(selectedEntity, selectedEntity.view);
configViewOptions(selectedEntity, selectedEntity.view); configViewOptions(selectedEntity, selectedEntity.view);
document.querySelector("#delete-entity").disabled = false; document.querySelector("#delete-entity").disabled = false;


document.querySelector("#grow").disabled = false; document.querySelector("#grow").disabled = false;
@@ -605,7 +605,7 @@ function updateWorldOptions(entity, view) {


function configEntityOptions(entity, view) { function configEntityOptions(entity, view) {
const holder = document.querySelector("#options-entity"); const holder = document.querySelector("#options-entity");
document.querySelector("#entity-category-header").style.display = "block"; document.querySelector("#entity-category-header").style.display = "block";
document.querySelector("#entity-category").style.display = "block"; document.querySelector("#entity-category").style.display = "block";


@@ -687,10 +687,10 @@ function configEntityOptions(entity, view) {
entity.dirty = true; entity.dirty = true;
updateEntityOptions(entity, entity.view); updateEntityOptions(entity, entity.view);
updateViewOptions(entity, entity.view); updateViewOptions(entity, entity.view);
if (!checkFitWorld()){
if (!checkFitWorld()) {
updateSizes(true); updateSizes(true);
} }
}); });


defaultHolder.appendChild(button); defaultHolder.appendChild(button);
@@ -722,7 +722,7 @@ function clearEntityOptions() {


function configViewOptions(entity, view) { function configViewOptions(entity, view) {
const holder = document.querySelector("#options-view"); const holder = document.querySelector("#options-view");
document.querySelector("#view-category-header").style.display = "block"; document.querySelector("#view-category-header").style.display = "block";
document.querySelector("#view-category").style.display = "block"; document.querySelector("#view-category").style.display = "block";


@@ -778,7 +778,7 @@ function configViewOptions(entity, view) {


select.setAttribute("oldUnit", select.value); select.setAttribute("oldUnit", select.value);


// TODO does this ever cause a change in the world?
// TODO does this ever cause a change in the world?
select.addEventListener("input", e => { select.addEventListener("input", e => {
const value = input.value == 0 ? 1 : input.value; const value = input.value == 0 ? 1 : input.value;
const oldUnit = select.getAttribute("oldUnit"); const oldUnit = select.getAttribute("oldUnit");
@@ -809,7 +809,7 @@ function updateViewOptions(entity, view, changed) {
if (key != changed) { if (key != changed) {
const input = document.querySelector("#options-view-" + key + "-input"); const input = document.querySelector("#options-view-" + key + "-input");
const select = document.querySelector("#options-view-" + key + "-select"); const select = document.querySelector("#options-view-" + key + "-select");
const currentUnit = select.value; const currentUnit = select.value;
const convertedAmount = entity.views[view][key].toNumber(currentUnit); const convertedAmount = entity.views[view][key].toNumber(currentUnit);
setNumericInput(input, convertedAmount); setNumericInput(input, convertedAmount);
@@ -818,7 +818,7 @@ function updateViewOptions(entity, view, changed) {
}); });
} }


function setNumericInput(input, value, round=3) {
function setNumericInput(input, value, round = 3) {
input.value = math.round(value, round); input.value = math.round(value, round);
} }


@@ -1045,9 +1045,9 @@ function checkEntity(entity) {
}); });
} }


function displayEntity(entity, view, x, y, selectEntity=false, refresh=false) {
function displayEntity(entity, view, x, y, selectEntity = false, refresh = false) {
checkEntity(entity); checkEntity(entity);
const box = document.createElement("div"); const box = document.createElement("div");
box.classList.add("entity-box"); box.classList.add("entity-box");


@@ -1056,7 +1056,7 @@ function displayEntity(entity, view, x, y, selectEntity=false, refresh=false) {
img.addEventListener("dragstart", e => { img.addEventListener("dragstart", e => {
e.preventDefault(); e.preventDefault();
}); });
const nameTag = document.createElement("div"); const nameTag = document.createElement("div");
nameTag.classList.add("entity-name"); nameTag.classList.add("entity-name");
nameTag.innerText = entity.name; nameTag.innerText = entity.name;
@@ -1093,7 +1093,7 @@ function displayEntity(entity, view, x, y, selectEntity=false, refresh=false) {
box.id = "entity-" + entityIndex; box.id = "entity-" + entityIndex;
box.dataset.key = entityIndex; box.dataset.key = entityIndex;
entity.view = view; entity.view = view;
entity.priority = 0; entity.priority = 0;
entities[entityIndex] = entity; entities[entityIndex] = entity;
entity.index = entityIndex; entity.index = entityIndex;
@@ -1118,7 +1118,7 @@ function displayEntity(entity, view, x, y, selectEntity=false, refresh=false) {
topName.addEventListener("click", () => select(box)); topName.addEventListener("click", () => select(box));


world.appendChild(topName); world.appendChild(topName);
const entityOption = document.createElement("option"); const entityOption = document.createElement("option");
entityOption.id = "options-selected-entity-" + entityIndex; entityOption.id = "options-selected-entity-" + entityIndex;
entityOption.value = entityIndex; entityOption.value = entityIndex;
@@ -1154,17 +1154,17 @@ window.onfocus = function () {
function toggleFullScreen() { function toggleFullScreen() {
var doc = window.document; var doc = window.document;
var docEl = doc.documentElement; var docEl = doc.documentElement;
var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen; var requestFullScreen = docEl.requestFullscreen || docEl.mozRequestFullScreen || docEl.webkitRequestFullScreen || docEl.msRequestFullscreen;
var cancelFullScreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen || doc.msExitFullscreen; var cancelFullScreen = doc.exitFullscreen || doc.mozCancelFullScreen || doc.webkitExitFullscreen || doc.msExitFullscreen;
if(!doc.fullscreenElement && !doc.mozFullScreenElement && !doc.webkitFullscreenElement && !doc.msFullscreenElement) {
requestFullScreen.call(docEl);
if (!doc.fullscreenElement && !doc.mozFullScreenElement && !doc.webkitFullscreenElement && !doc.msFullscreenElement) {
requestFullScreen.call(docEl);
} }
else { else {
cancelFullScreen.call(doc);
cancelFullScreen.call(doc);
} }
}
}


function handleResize() { function handleResize() {
const oldCanvasWidth = canvasWidth; const oldCanvasWidth = canvasWidth;
@@ -1173,7 +1173,7 @@ function handleResize() {
canvasHeight = document.querySelector("#display").clientHeight - 50; canvasHeight = document.querySelector("#display").clientHeight - 50;


const change = oldCanvasWidth / canvasWidth; const change = oldCanvasWidth / canvasWidth;
doHorizReposition(change); doHorizReposition(change);


updateSizes(); updateSizes();
@@ -1262,7 +1262,7 @@ function prepareMenu() {
button.classList.add("menu-button"); button.classList.add("menu-button");
const icon = document.createElement("i"); const icon = document.createElement("i");
icon.classList.add(...entry.icon.split(" ")); icon.classList.add(...entry.icon.split(" "));
if (entry.rotates) { if (entry.rotates) {
icon.classList.add("rotate-backward", "transitions"); icon.classList.add("rotate-backward", "transitions");
} }
@@ -1318,7 +1318,7 @@ function setHelpDate() {


function doScroll() { function doScroll() {
document.querySelectorAll(".entity-box").forEach(element => { document.querySelectorAll(".entity-box").forEach(element => {
element.dataset.x = parseFloat(element.dataset.x) + scrollDirection/180;
element.dataset.x = parseFloat(element.dataset.x) + scrollDirection / 180;
}); });
updateSizes(); updateSizes();
scrollDirection *= 1.05; scrollDirection *= 1.05;
@@ -1335,7 +1335,7 @@ function doSize() {
if (selected) { if (selected) {
const entity = entities[selected.dataset.key]; const entity = entities[selected.dataset.key];
const oldHeight = entity.views[entity.view].height; const oldHeight = entity.views[entity.view].height;
entity.views[entity.view].height = math.multiply(oldHeight, 1 + sizeDirection/20);
entity.views[entity.view].height = math.multiply(oldHeight, 1 + sizeDirection / 20);
entity.dirty = true; entity.dirty = true;
updateEntityOptions(entity, entity.view); updateEntityOptions(entity, entity.view);
updateViewOptions(entity, entity.view); updateViewOptions(entity, entity.view);
@@ -1347,7 +1347,7 @@ function doSize() {


console.log(ownHeight, worldHeight) console.log(ownHeight, worldHeight)
if (ownHeight > worldHeight) { if (ownHeight > worldHeight) {
setWorldHeight(config.height, entity.views[entity.view].height)
setWorldHeight(config.height, entity.views[entity.view].height)
} else if (ownHeight * 10 < worldHeight) { } else if (ownHeight * 10 < worldHeight) {
setWorldHeight(config.height, math.multiply(entity.views[entity.view].height, 10)); setWorldHeight(config.height, math.multiply(entity.views[entity.view].height, 10));
} }
@@ -1379,7 +1379,7 @@ document.addEventListener("DOMContentLoaded", () => {
document.addEventListener("click", e => { document.addEventListener("click", e => {
document.querySelector("#popout-menu").classList.remove("visible"); document.querySelector("#popout-menu").classList.remove("visible");
}); });
window.addEventListener("unload", () => saveScene("autosave")); window.addEventListener("unload", () => saveScene("autosave"));
document.querySelector("#options-selected-entity").addEventListener("input", e => { document.querySelector("#options-selected-entity").addEventListener("input", e => {
if (e.target.value == "none") { if (e.target.value == "none") {
@@ -1387,7 +1387,7 @@ document.addEventListener("DOMContentLoaded", () => {
} else { } else {
select(document.querySelector("#entity-" + e.target.value)); select(document.querySelector("#entity-" + e.target.value));
} }
}); });


document.querySelector("#menu-toggle-sidebar").addEventListener("click", e => { document.querySelector("#menu-toggle-sidebar").addEventListener("click", e => {
@@ -1522,7 +1522,7 @@ document.addEventListener("DOMContentLoaded", () => {
if (param === null) { if (param === null) {
scenes["Default"](); scenes["Default"]();
} }
else { else {
try { try {
const data = JSON.parse(b64DecodeUnicode(param)); const data = JSON.parse(b64DecodeUnicode(param));
@@ -1546,7 +1546,7 @@ document.addEventListener("DOMContentLoaded", () => {


if (shiftHeld) { if (shiftHeld) {
if (selected) { if (selected) {
const dir = e.deltaY > 0 ? 10/11 : 11/10;
const dir = e.deltaY > 0 ? 10 / 11 : 11 / 10;
const entity = entities[selected.dataset.key]; const entity = entities[selected.dataset.key];
entity.views[entity.view].height = math.multiply(entity.views[entity.view].height, dir); entity.views[entity.view].height = math.multiply(entity.views[entity.view].height, dir);
entity.dirty = true; entity.dirty = true;
@@ -1561,7 +1561,7 @@ document.addEventListener("DOMContentLoaded", () => {
} }


} else { } else {
const dir = e.deltaY < 0 ? 10/11 : 11/10;
const dir = e.deltaY < 0 ? 10 / 11 : 11 / 10;
setWorldHeight(config.height, math.multiply(config.height, dir)); setWorldHeight(config.height, math.multiply(config.height, dir));
updateWorldOptions(); updateWorldOptions();
} }
@@ -1587,7 +1587,7 @@ document.addEventListener("DOMContentLoaded", () => {
document.querySelector("#entity-view").addEventListener("input", e => { document.querySelector("#entity-view").addEventListener("input", e => {
const entity = entities[selected.dataset.key]; const entity = entities[selected.dataset.key];
entity.view = e.target.value; entity.view = e.target.value;
const image = entities[selected.dataset.key].views[e.target.value].image; const image = entities[selected.dataset.key].views[e.target.value].image;
selected.querySelector(".entity-image").src = image.source; selected.querySelector(".entity-image").src = image.source;


@@ -1608,7 +1608,7 @@ document.addEventListener("DOMContentLoaded", () => {
document.querySelector("#menu-clear").addEventListener("click", e => { document.querySelector("#menu-clear").addEventListener("click", e => {
removeAllEntities(); removeAllEntities();
}); });
document.querySelector("#delete-entity").disabled = true; document.querySelector("#delete-entity").disabled = true;
document.querySelector("#delete-entity").addEventListener("click", e => { document.querySelector("#delete-entity").addEventListener("click", e => {
if (selected) { if (selected) {
@@ -1636,28 +1636,28 @@ document.addEventListener("DOMContentLoaded", () => {
document.querySelector("#scroll-left").addEventListener("mousedown", e => { document.querySelector("#scroll-left").addEventListener("mousedown", e => {
scrollDirection = 1; scrollDirection = 1;
clearInterval(scrollHandle); clearInterval(scrollHandle);
scrollHandle = setInterval(doScroll, 1000/20);
scrollHandle = setInterval(doScroll, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


document.querySelector("#scroll-right").addEventListener("mousedown", e => { document.querySelector("#scroll-right").addEventListener("mousedown", e => {
scrollDirection = -1; scrollDirection = -1;
clearInterval(scrollHandle); clearInterval(scrollHandle);
scrollHandle = setInterval(doScroll, 1000/20);
scrollHandle = setInterval(doScroll, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


document.querySelector("#scroll-left").addEventListener("touchstart", e => { document.querySelector("#scroll-left").addEventListener("touchstart", e => {
scrollDirection = 1; scrollDirection = 1;
clearInterval(scrollHandle); clearInterval(scrollHandle);
scrollHandle = setInterval(doScroll, 1000/20);
scrollHandle = setInterval(doScroll, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


document.querySelector("#scroll-right").addEventListener("touchstart", e => { document.querySelector("#scroll-right").addEventListener("touchstart", e => {
scrollDirection = -1; scrollDirection = -1;
clearInterval(scrollHandle); clearInterval(scrollHandle);
scrollHandle = setInterval(doScroll, 1000/20);
scrollHandle = setInterval(doScroll, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


@@ -1674,28 +1674,28 @@ document.addEventListener("DOMContentLoaded", () => {
document.querySelector("#zoom-in").addEventListener("mousedown", e => { document.querySelector("#zoom-in").addEventListener("mousedown", e => {
zoomDirection = -1; zoomDirection = -1;
clearInterval(zoomHandle); clearInterval(zoomHandle);
zoomHandle = setInterval(doZoom, 1000/20);
zoomHandle = setInterval(doZoom, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


document.querySelector("#zoom-out").addEventListener("mousedown", e => { document.querySelector("#zoom-out").addEventListener("mousedown", e => {
zoomDirection = 1; zoomDirection = 1;
clearInterval(zoomHandle); clearInterval(zoomHandle);
zoomHandle = setInterval(doZoom, 1000/20);
zoomHandle = setInterval(doZoom, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


document.querySelector("#zoom-in").addEventListener("touchstart", e => { document.querySelector("#zoom-in").addEventListener("touchstart", e => {
zoomDirection = -1; zoomDirection = -1;
clearInterval(zoomHandle); clearInterval(zoomHandle);
zoomHandle = setInterval(doZoom, 1000/20);
zoomHandle = setInterval(doZoom, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


document.querySelector("#zoom-out").addEventListener("touchstart", e => { document.querySelector("#zoom-out").addEventListener("touchstart", e => {
zoomDirection = 1; zoomDirection = 1;
clearInterval(zoomHandle); clearInterval(zoomHandle);
zoomHandle = setInterval(doZoom, 1000/20);
zoomHandle = setInterval(doZoom, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


@@ -1712,28 +1712,28 @@ document.addEventListener("DOMContentLoaded", () => {
document.querySelector("#shrink").addEventListener("mousedown", e => { document.querySelector("#shrink").addEventListener("mousedown", e => {
sizeDirection = -1; sizeDirection = -1;
clearInterval(sizeHandle); clearInterval(sizeHandle);
sizeHandle = setInterval(doSize, 1000/20);
sizeHandle = setInterval(doSize, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


document.querySelector("#grow").addEventListener("mousedown", e => { document.querySelector("#grow").addEventListener("mousedown", e => {
sizeDirection = 1; sizeDirection = 1;
clearInterval(sizeHandle); clearInterval(sizeHandle);
sizeHandle = setInterval(doSize, 1000/20);
sizeHandle = setInterval(doSize, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


document.querySelector("#shrink").addEventListener("touchstart", e => { document.querySelector("#shrink").addEventListener("touchstart", e => {
sizeDirection = -1; sizeDirection = -1;
clearInterval(sizeHandle); clearInterval(sizeHandle);
sizeHandle = setInterval(doSize, 1000/20);
sizeHandle = setInterval(doSize, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


document.querySelector("#grow").addEventListener("touchstart", e => { document.querySelector("#grow").addEventListener("touchstart", e => {
sizeDirection = 1; sizeDirection = 1;
clearInterval(sizeHandle); clearInterval(sizeHandle);
sizeHandle = setInterval(doSize, 1000/20);
sizeHandle = setInterval(doSize, 1000 / 20);
e.stopPropagation(); e.stopPropagation();
}); });


@@ -1889,7 +1889,7 @@ function prepareEntities() {
button.id = "create-entity-" + category + "-button"; button.id = "create-entity-" + category + "-button";


button.innerHTML = "<i class=\"far fa-plus-square\"></i>"; button.innerHTML = "<i class=\"far fa-plus-square\"></i>";
button.addEventListener("click", e => { button.addEventListener("click", e => {
const newEntity = entityList[select.value].constructor() const newEntity = entityList[select.value].constructor()
displayEntity(newEntity, newEntity.defaultView, 0.5, 1, true, true); displayEntity(newEntity, newEntity.defaultView, 0.5, 1, true, true);
@@ -1911,7 +1911,7 @@ function prepareEntities() {
}); });


console.log("Loaded " + Object.keys(availableEntitiesByName).length + " entities"); console.log("Loaded " + Object.keys(availableEntitiesByName).length + " entities");
categorySelect.addEventListener("input", e => { categorySelect.addEventListener("input", e => {
const oldSelect = document.querySelector("select.category-visible"); const oldSelect = document.querySelector("select.category-visible");
oldSelect.classList.remove("category-visible"); oldSelect.classList.remove("category-visible");
@@ -1987,7 +1987,7 @@ const fitModes = {
} }
} }


function fitWorld(manual=false, factor=1.1) {
function fitWorld(manual = false, factor = 1.1) {
const fitMode = fitModes[config.autoFitMode] const fitMode = fitModes[config.autoFitMode]
let max = fitMode.start let max = fitMode.start


@@ -2045,7 +2045,7 @@ function setWorldHeight(oldHeight, newHeight) {
updateSizes(); updateSizes();
} }


function loadScene(name="default") {
function loadScene(name = "default") {
try { try {
const data = JSON.parse(localStorage.getItem("macrovision-save-" + name)); const data = JSON.parse(localStorage.getItem("macrovision-save-" + name));
if (data === null) { if (data === null) {
@@ -2060,7 +2060,7 @@ function loadScene(name="default") {
} }
} }


function saveScene(name="default") {
function saveScene(name = "default") {
try { try {
const string = JSON.stringify(exportScene()); const string = JSON.stringify(exportScene());
localStorage.setItem("macrovision-save-" + name, string); localStorage.setItem("macrovision-save-" + name, string);
@@ -2070,10 +2070,10 @@ function saveScene(name="default") {
} }
} }


function deleteScene(name="default") {
function deleteScene(name = "default") {
try { try {
localStorage.removeItem("macrovision-save-" + name) localStorage.removeItem("macrovision-save-" + name)
} catch(err) {
} catch (err) {
console.error(err); console.error(err);
} }
} }
@@ -2117,12 +2117,12 @@ function b64EncodeUnicode(str) {
return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,
function toSolidBytes(match, p1) { function toSolidBytes(match, p1) {
return String.fromCharCode('0x' + p1); return String.fromCharCode('0x' + p1);
}));
}));
} }


function b64DecodeUnicode(str) { function b64DecodeUnicode(str) {
// Going backwards: from bytestream, to percent-encoding, to original string. // Going backwards: from bytestream, to percent-encoding, to original string.
return decodeURIComponent(atob(str).split('').map(function(c) {
return decodeURIComponent(atob(str).split('').map(function (c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join('')); }).join(''));
} }


+ 43
- 43
media/attribution.js View File

@@ -1152,38 +1152,38 @@ const attributionData = {
{ {
prefix: "./media/cities/", prefix: "./media/cities/",
files: [ files: [
{ name: "city_atlanta.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_boston.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_calgary.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_chicago.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_columbus.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_dallas.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_detroit.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_edmonton.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_guadalajara.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_houston.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_indianapolis.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_jacksonville.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_kansas-city.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_los-angeles.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_mexico-city.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_mississauga.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_montreal.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_new-york-city.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_ottawa.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_philadelphia.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_phoenix.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_puebla.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_san-antonio.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_san-diego.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_san-francisco.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_seattle.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_st-louis.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_tijuana.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_toronto.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_vancouver.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_washington.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_winnipeg.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html"},
{ name: "city_atlanta.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_boston.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_calgary.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_chicago.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_columbus.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_dallas.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_detroit.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_edmonton.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_guadalajara.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_houston.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_indianapolis.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_jacksonville.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_kansas-city.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_los-angeles.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_mexico-city.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_mississauga.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_montreal.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_new-york-city.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_ottawa.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_philadelphia.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_phoenix.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_puebla.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_san-antonio.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_san-diego.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_san-francisco.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_seattle.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_st-louis.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_tijuana.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_toronto.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_vancouver.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_washington.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
{ name: "city_winnipeg.svg", source: "https://all-free-download.com/free-vector/download/big-cities-silhouette-set-vector_548864.html" },
], ],
authors: [ authors: [
"freedesignfile" "freedesignfile"
@@ -2429,7 +2429,7 @@ const attributionData = {
{ name: "front.svg", source: "https://www.furaffinity.net/view/35993069/" }, { name: "front.svg", source: "https://www.furaffinity.net/view/35993069/" },
{ name: "back.svg", source: "https://www.furaffinity.net/view/35993069/" }, { name: "back.svg", source: "https://www.furaffinity.net/view/35993069/" },
{ name: "foot.svg", source: "https://www.furaffinity.net/view/35993069/" }, { name: "foot.svg", source: "https://www.furaffinity.net/view/35993069/" },
], ],
authors: [ authors: [
"victni" "victni"
@@ -8396,8 +8396,8 @@ const attributionData = {
{ {
prefix: "./media/characters/gabira/", prefix: "./media/characters/gabira/",
files: [ files: [
{ name: "front.svg", source: "https://www.furaffinity.net/view/22244723/" },
{ name: "back.svg", source: "https://www.furaffinity.net/view/22244723/" },
{ name: "front.svg", source: "https://www.furaffinity.net/view/22244723/" },
{ name: "back.svg", source: "https://www.furaffinity.net/view/22244723/" },
], ],
authors: [ authors: [
"gabira" "gabira"
@@ -11456,7 +11456,7 @@ const attributionData = {
"evilwithin": { "evilwithin": {
"name": "evilwithin", "name": "evilwithin",
"url": "https://www.furaffinity.net/user/evilwithin/", "url": "https://www.furaffinity.net/user/evilwithin/",
},
},
"dragondruid": { "dragondruid": {
"name": "dragondruid", "name": "dragondruid",
"url": "https://www.furaffinity.net/user/dragondruid/", "url": "https://www.furaffinity.net/user/dragondruid/",
@@ -12388,7 +12388,7 @@ function prepareAttribution() {
} }
}) })
} }
}); });
} }


@@ -12399,7 +12399,7 @@ function authorsOf(file) {
const found = attribution.prefixes[Object.keys(attribution.prefixes).find(path => { const found = attribution.prefixes[Object.keys(attribution.prefixes).find(path => {
return (file.indexOf(path) == 0); return (file.indexOf(path) == 0);
})]; })];


if (found === undefined) { if (found === undefined) {
return undefined; return undefined;
@@ -12421,7 +12421,7 @@ function authorsOfFull(file) {
const found = attribution.prefixes[Object.keys(attribution.prefixes).find(path => { const found = attribution.prefixes[Object.keys(attribution.prefixes).find(path => {
return (file.indexOf(path) == 0); return (file.indexOf(path) == 0);
})]; })];


if (found === undefined || found.authors === undefined) { if (found === undefined || found.authors === undefined) {
return undefined; return undefined;
@@ -12441,7 +12441,7 @@ function ownersOf(file) {
const found = attribution.prefixes[Object.keys(attribution.prefixes).find(path => { const found = attribution.prefixes[Object.keys(attribution.prefixes).find(path => {
return (file.indexOf(path) == 0); return (file.indexOf(path) == 0);
})]; })];


if (found === undefined) { if (found === undefined) {
return undefined; return undefined;
@@ -12468,12 +12468,12 @@ function ownersOfFull(file) {
const found = attribution.prefixes[Object.keys(attribution.prefixes).find(path => { const found = attribution.prefixes[Object.keys(attribution.prefixes).find(path => {
return (file.indexOf(path) == 0); return (file.indexOf(path) == 0);
})]; })];


if (found === undefined) { if (found === undefined) {
return undefined; return undefined;
} else if (found.owners === undefined) { } else if (found.owners === undefined) {
return [];
return [];
} else { } else {
found.owners.forEach(owner => { found.owners.forEach(owner => {
result.push(attributionData.people[owner]); result.push(attributionData.people[owner]);
@@ -12490,7 +12490,7 @@ function sourceOf(file) {
const found = attribution.prefixes[Object.keys(attribution.prefixes).find(path => { const found = attribution.prefixes[Object.keys(attribution.prefixes).find(path => {
return (file.indexOf(path) == 0); return (file.indexOf(path) == 0);
})]; })];


if (found === undefined) { if (found === undefined) {
return undefined; return undefined;


+ 2
- 2
presets/buildings.js View File

@@ -153,7 +153,7 @@ function makeBuildings() {
) )


results.push( results.push(
makeHeight (
makeHeight(
[ [
["residential", 12, "feet"], ["residential", 12, "feet"],
["freeway", 50, "feet"] ["freeway", 50, "feet"]
@@ -165,7 +165,7 @@ function makeBuildings() {
) )


results.push( results.push(
makeHeight (
makeHeight(
[ [
["manhattan", 141.8, "meters"], ["manhattan", 141.8, "meters"],
["houston", 93, "meters"] ["houston", 93, "meters"]


+ 156
- 156
presets/characters.js View File

@@ -432,8 +432,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/elijah/front.svg", source: "./media/characters/elijah/front.svg",
extra: 639/626,
bottom: 58.7/697.8
extra: 639 / 626,
bottom: 58.7 / 697.8
} }
}, },
side: { side: {
@@ -442,8 +442,8 @@ characterMakers.push(() => makeCharacter(
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/elijah/side.svg", source: "./media/characters/elijah/side.svg",
extra: 1840/1795,
bottom: 106/1943
extra: 1840 / 1795,
bottom: 106 / 1943
} }
}, },
back: { back: {
@@ -452,8 +452,8 @@ characterMakers.push(() => makeCharacter(
name: "Back", name: "Back",
image: { image: {
source: "./media/characters/elijah/back.svg", source: "./media/characters/elijah/back.svg",
extra: 661.2/639.5,
bottom: 21.2/682.5
extra: 661.2 / 639.5,
bottom: 21.2 / 682.5
} }
}, },
foot: { foot: {
@@ -613,8 +613,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/flamm/front.svg", source: "./media/characters/flamm/front.svg",
extra: 1794/1677,
bottom: 31.7/1828.5
extra: 1794 / 1677,
bottom: 31.7 / 1828.5
} }
}, },
}, },
@@ -691,8 +691,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/fory/front.svg", source: "./media/characters/fory/front.svg",
extra: 2862/2674,
bottom: 180/3043.8
extra: 2862 / 2674,
bottom: 180 / 3043.8
} }
}, },
back: { back: {
@@ -701,8 +701,8 @@ characterMakers.push(() => makeCharacter(
name: "Back", name: "Back",
image: { image: {
source: "./media/characters/fory/back.svg", source: "./media/characters/fory/back.svg",
extra: 2962/2791,
bottom: 106/3071.8
extra: 2962 / 2791,
bottom: 106 / 3071.8
} }
}, },
foot: { foot: {
@@ -1001,14 +1001,14 @@ characterMakers.push(() => makeCharacter(
characterMakers.push(() => makeCharacter( characterMakers.push(() => makeCharacter(
{ name: "Talan" }, { name: "Talan" },
{ {
angled: { angled: {
height: math.unit(4, "meter"), height: math.unit(4, "meter"),
weight: math.unit(150, "kg"), weight: math.unit(150, "kg"),
name: "Angled", name: "Angled",
image: { image: {
source: "./media/characters/talan/angled-sfw.svg", source: "./media/characters/talan/angled-sfw.svg",
bottom: 29/3734
bottom: 29 / 3734
} }
}, },
angledNsfw: { angledNsfw: {
@@ -1017,7 +1017,7 @@ characterMakers.push(() => makeCharacter(
name: "Angled (NSFW)", name: "Angled (NSFW)",
image: { image: {
source: "./media/characters/talan/angled-nsfw.svg", source: "./media/characters/talan/angled-nsfw.svg",
bottom: 29/3734
bottom: 29 / 3734
} }
}, },
frontNsfw: { frontNsfw: {
@@ -1026,7 +1026,7 @@ characterMakers.push(() => makeCharacter(
name: "Front (NSFW)", name: "Front (NSFW)",
image: { image: {
source: "./media/characters/talan/front-nsfw.svg", source: "./media/characters/talan/front-nsfw.svg",
bottom: 29/3734
bottom: 29 / 3734
} }
}, },
sideNsfw: { sideNsfw: {
@@ -1035,7 +1035,7 @@ characterMakers.push(() => makeCharacter(
name: "Side (NSFW)", name: "Side (NSFW)",
image: { image: {
source: "./media/characters/talan/side-nsfw.svg", source: "./media/characters/talan/side-nsfw.svg",
bottom: 29/3734
bottom: 29 / 3734
} }
}, },
back: { back: {
@@ -1254,8 +1254,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/elbial/front.svg", source: "./media/characters/elbial/front.svg",
extra: 1643/1556,
bottom: 60.2/1696
extra: 1643 / 1556,
bottom: 60.2 / 1696
} }
}, },
side: { side: {
@@ -1264,8 +1264,8 @@ characterMakers.push(() => makeCharacter(
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/elbial/side.svg", source: "./media/characters/elbial/side.svg",
extra: 1630/1565,
bottom: 71.5/1697
extra: 1630 / 1565,
bottom: 71.5 / 1697
} }
}, },
back: { back: {
@@ -1274,8 +1274,8 @@ characterMakers.push(() => makeCharacter(
name: "Back", name: "Back",
image: { image: {
source: "./media/characters/elbial/back.svg", source: "./media/characters/elbial/back.svg",
extra: 1668/1595,
bottom: 5.6/1672
extra: 1668 / 1595,
bottom: 5.6 / 1672
} }
}, },
frontDressed: { frontDressed: {
@@ -1284,12 +1284,12 @@ characterMakers.push(() => makeCharacter(
name: "Front (Dressed)", name: "Front (Dressed)",
image: { image: {
source: "./media/characters/elbial/front-dressed.svg", source: "./media/characters/elbial/front-dressed.svg",
extra: 1653/1584,
bottom: 57/1708
extra: 1653 / 1584,
bottom: 57 / 1708
} }
}, },
genitals: { genitals: {
height: math.unit(2/3.367, "meter"),
height: math.unit(2 / 3.367, "meter"),
name: "Genitals", name: "Genitals",
image: { image: {
source: "./media/characters/elbial/genitals.svg" source: "./media/characters/elbial/genitals.svg"
@@ -2775,7 +2775,7 @@ characterMakers.push(() => makeCharacter(
image: { image: {
source: "./media/characters/tobias/side.svg", source: "./media/characters/tobias/side.svg",
extra: 1474 / 1096, extra: 1474 / 1096,
bottom: 38.9/1513.1235
bottom: 38.9 / 1513.1235
} }
}, },
}, },
@@ -9590,7 +9590,7 @@ characterMakers.push(() => makeCharacter(
} }
}, },
elemental: { elemental: {
height: math.unit(4 + 2/12, "feet"),
height: math.unit(4 + 2 / 12, "feet"),
weight: math.unit(150, "lb"), weight: math.unit(150, "lb"),
name: "Elemental", name: "Elemental",
image: { image: {
@@ -19003,8 +19003,8 @@ characterMakers.push(() => makeCharacter(
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/fixerdragon/side.svg", source: "./media/characters/fixerdragon/side.svg",
extra: (1293.0514-116.03)/1106.86,
bottom: 116.03/1293.0514
extra: (1293.0514 - 116.03) / 1106.86,
bottom: 116.03 / 1293.0514
} }
}, },
}, },
@@ -19046,7 +19046,7 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/kite/front.svg", source: "./media/characters/kite/front.svg",
extra: 2796/2659,
extra: 2796 / 2659,
bottom: 0.002 bottom: 0.002
} }
}, },
@@ -19072,30 +19072,30 @@ characterMakers.push(() => makeCharacter(
{ name: "Poojawa Vynar" }, { name: "Poojawa Vynar" },
{ {
front: { front: {
height: math.unit(5 + 10/12, "feet"),
height: math.unit(5 + 10 / 12, "feet"),
weight: math.unit(150, "lb"), weight: math.unit(150, "lb"),
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/poojawa-vynar/front.svg", source: "./media/characters/poojawa-vynar/front.svg",
extra: (1506.1547-55) / 1356.6,
bottom: 55/1506.1547
extra: (1506.1547 - 55) / 1356.6,
bottom: 55 / 1506.1547
} }
}, },
frontTailless: { frontTailless: {
height: math.unit(5 + 10/12, "feet"),
height: math.unit(5 + 10 / 12, "feet"),
weight: math.unit(150, "lb"), weight: math.unit(150, "lb"),
name: "Front (Tailless)", name: "Front (Tailless)",
image: { image: {
source: "./media/characters/poojawa-vynar/front-tailless.svg", source: "./media/characters/poojawa-vynar/front-tailless.svg",
extra: (1506.1547-55) / 1356.6,
bottom: 55/1506.1547
extra: (1506.1547 - 55) / 1356.6,
bottom: 55 / 1506.1547
} }
}, },
}, },
[ [
{ {
name: "Normal", name: "Normal",
height: math.unit(5 + 10/12, "feet"),
height: math.unit(5 + 10 / 12, "feet"),
default: true default: true
}, },
] ]
@@ -19110,7 +19110,7 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/violette/front.svg", source: "./media/characters/violette/front.svg",
extra: 1227/1180,
extra: 1227 / 1180,
bottom: 0.005 bottom: 0.005
} }
}, },
@@ -19120,7 +19120,7 @@ characterMakers.push(() => makeCharacter(
name: "Back", name: "Back",
image: { image: {
source: "./media/characters/violette/back.svg", source: "./media/characters/violette/back.svg",
extra: 1227/1180,
extra: 1227 / 1180,
bottom: 0.005 bottom: 0.005
} }
}, },
@@ -19143,7 +19143,7 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/alessandra/front.svg", source: "./media/characters/alessandra/front.svg",
extra: 960/912,
extra: 960 / 912,
bottom: 0.06 bottom: 0.06
} }
}, },
@@ -19170,8 +19170,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/person/front.svg", source: "./media/characters/person/front.svg",
extra: 3087/2945,
bottom: 91/3181
extra: 3087 / 2945,
bottom: 91 / 3181
} }
}, },
}, },
@@ -19205,8 +19205,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/ty/front.svg", source: "./media/characters/ty/front.svg",
extra: 1038/960,
bottom: 31.156/1068
extra: 1038 / 960,
bottom: 31.156 / 1068
} }
}, },
back: { back: {
@@ -19215,8 +19215,8 @@ characterMakers.push(() => makeCharacter(
name: "Back", name: "Back",
image: { image: {
source: "./media/characters/ty/back.svg", source: "./media/characters/ty/back.svg",
extra: 1044/966,
bottom: 7.48/1049
extra: 1044 / 966,
bottom: 7.48 / 1049
} }
}, },
}, },
@@ -19233,20 +19233,20 @@ characterMakers.push(() => makeCharacter(
{ name: "Rocky" }, { name: "Rocky" },
{ {
front: { front: {
height: math.unit(5 + 4/12, "feet"),
height: math.unit(5 + 4 / 12, "feet"),
weight: math.unit(115, "lb"), weight: math.unit(115, "lb"),
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/rocky/front.svg", source: "./media/characters/rocky/front.svg",
extra: 1012/975,
bottom: 54/1066
extra: 1012 / 975,
bottom: 54 / 1066
} }
}, },
}, },
[ [
{ {
name: "Normal", name: "Normal",
height: math.unit(5 + 4/12, "feet"),
height: math.unit(5 + 4 / 12, "feet"),
default: true default: true
}, },
] ]
@@ -19261,8 +19261,8 @@ characterMakers.push(() => makeCharacter(
name: "Upright", name: "Upright",
image: { image: {
source: "./media/characters/ruin/upright.svg", source: "./media/characters/ruin/upright.svg",
extra: 668/661,
bottom: 42/799.8396
extra: 668 / 661,
bottom: 42 / 799.8396
} }
}, },
}, },
@@ -19283,8 +19283,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/robin/front.svg", source: "./media/characters/robin/front.svg",
extra: 862/799,
bottom: 42.4/914.8856
extra: 862 / 799,
bottom: 42.4 / 914.8856
} }
}, },
}, },
@@ -19306,8 +19306,8 @@ characterMakers.push(() => makeCharacter(
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/saian/side.svg", source: "./media/characters/saian/side.svg",
extra: 566/356,
bottom: 79.7/643
extra: 566 / 356,
bottom: 79.7 / 643
} }
}, },
maw: { maw: {
@@ -19336,8 +19336,8 @@ characterMakers.push(() => makeCharacter(
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/equus-silvermane/side.svg", source: "./media/characters/equus-silvermane/side.svg",
extra: 2176/2050,
bottom: 65.7/2245
extra: 2176 / 2050,
bottom: 65.7 / 2245
} }
}, },
front: { front: {
@@ -19346,8 +19346,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/equus-silvermane/front.svg", source: "./media/characters/equus-silvermane/front.svg",
extra: 4633/4400,
bottom: 71.3/4706.915
extra: 4633 / 4400,
bottom: 71.3 / 4706.915
} }
}, },
sideStepping: { sideStepping: {
@@ -19356,8 +19356,8 @@ characterMakers.push(() => makeCharacter(
name: "Side (Stepping)", name: "Side (Stepping)",
image: { image: {
source: "./media/characters/equus-silvermane/side-stepping.svg", source: "./media/characters/equus-silvermane/side-stepping.svg",
extra: 1968/1860,
bottom: 16.4/1989
extra: 1968 / 1860,
bottom: 16.4 / 1989
} }
}, },
}, },
@@ -19395,8 +19395,8 @@ characterMakers.push(() => makeCharacter(
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/windar/side.svg", source: "./media/characters/windar/side.svg",
extra: 1491/1248,
bottom: 82.56/1568
extra: 1491 / 1248,
bottom: 82.56 / 1568
} }
}, },
}, },
@@ -19418,8 +19418,8 @@ characterMakers.push(() => makeCharacter(
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/melody/side.svg", source: "./media/characters/melody/side.svg",
extra: 1097/944,
bottom: 11.8/1109
extra: 1097 / 944,
bottom: 11.8 / 1109
} }
}, },
sideOutfit: { sideOutfit: {
@@ -19428,8 +19428,8 @@ characterMakers.push(() => makeCharacter(
name: "Side (Outfit)", name: "Side (Outfit)",
image: { image: {
source: "./media/characters/melody/side-outfit.svg", source: "./media/characters/melody/side-outfit.svg",
extra: 1097/944,
bottom: 11.8/1109
extra: 1097 / 944,
bottom: 11.8 / 1109
} }
}, },
}, },
@@ -19451,8 +19451,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/windera/front.svg", source: "./media/characters/windera/front.svg",
extra: 3180/2845,
bottom: 178/3365
extra: 3180 / 2845,
bottom: 178 / 3365
} }
}, },
}, },
@@ -19474,8 +19474,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/sonear/front.svg", source: "./media/characters/sonear/front.svg",
extra: 1041.1/964.9,
bottom: 53.7/1096.6
extra: 1041.1 / 964.9,
bottom: 53.7 / 1096.6
} }
}, },
}, },
@@ -19518,8 +19518,8 @@ characterMakers.push(() => makeCharacter(
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/ereus/side.svg", source: "./media/characters/ereus/side.svg",
extra: 1157/959,
bottom: 153/1312.5
extra: 1157 / 959,
bottom: 153 / 1312.5
} }
}, },
}, },
@@ -19541,8 +19541,8 @@ characterMakers.push(() => makeCharacter(
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/e-ter/side.svg", source: "./media/characters/e-ter/side.svg",
extra: 1550/1248,
bottom: 146/1694
extra: 1550 / 1248,
bottom: 146 / 1694
} }
}, },
}, },
@@ -19585,8 +19585,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/anders/front.svg", source: "./media/characters/anders/front.svg",
extra: 570/539,
bottom: 14.7/586.7
extra: 570 / 539,
bottom: 14.7 / 586.7
} }
}, },
}, },
@@ -19611,17 +19611,17 @@ characterMakers.push(() => makeCharacter(
{ name: "Reban" }, { name: "Reban" },
{ {
front: { front: {
height: math.unit(7 + 2/12, "feet"),
height: math.unit(7 + 2 / 12, "feet"),
weight: math.unit(300, "lb"), weight: math.unit(300, "lb"),
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/reban/front.svg", source: "./media/characters/reban/front.svg",
extra: 516/487,
bottom: 42.82/558.356
extra: 516 / 487,
bottom: 42.82 / 558.356
} }
}, },
dick: { dick: {
height: math.unit(7/5, "feet"),
height: math.unit(7 / 5, "feet"),
name: "Dick", name: "Dick",
image: { image: {
source: "./media/characters/reban/dick.svg" source: "./media/characters/reban/dick.svg"
@@ -19631,7 +19631,7 @@ characterMakers.push(() => makeCharacter(
[ [
{ {
name: "Natural Height", name: "Natural Height",
height: math.unit(7 + 2/12, "feet")
height: math.unit(7 + 2 / 12, "feet")
}, },
{ {
name: "Macro", name: "Macro",
@@ -19655,7 +19655,7 @@ characterMakers.push(() => makeCharacter(
image: { image: {
source: "./media/characters/terrance-keayes/front.svg", source: "./media/characters/terrance-keayes/front.svg",
extra: 1.005, extra: 1.005,
bottom: 151/1615
bottom: 151 / 1615
} }
}, },
side: { side: {
@@ -19665,7 +19665,7 @@ characterMakers.push(() => makeCharacter(
image: { image: {
source: "./media/characters/terrance-keayes/side.svg", source: "./media/characters/terrance-keayes/side.svg",
extra: 1.005, extra: 1.005,
bottom: 129.4/1544
bottom: 129.4 / 1544
} }
}, },
back: { back: {
@@ -19675,11 +19675,11 @@ characterMakers.push(() => makeCharacter(
image: { image: {
source: "./media/characters/terrance-keayes/back.svg", source: "./media/characters/terrance-keayes/back.svg",
extra: 1.005, extra: 1.005,
bottom: 58.4/1557.3
bottom: 58.4 / 1557.3
} }
}, },
dick: { dick: {
height: math.unit(6*0.208, "feet"),
height: math.unit(6 * 0.208, "feet"),
name: "Dick", name: "Dick",
image: { image: {
source: "./media/characters/terrance-keayes/dick.svg" source: "./media/characters/terrance-keayes/dick.svg"
@@ -19704,8 +19704,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/ofelia/front.svg", source: "./media/characters/ofelia/front.svg",
extra: 546/541,
bottom: 39/583
extra: 546 / 541,
bottom: 39 / 583
} }
}, },
back: { back: {
@@ -19714,8 +19714,8 @@ characterMakers.push(() => makeCharacter(
name: "Back", name: "Back",
image: { image: {
source: "./media/characters/ofelia/back.svg", source: "./media/characters/ofelia/back.svg",
extra: 564/559.5,
bottom: 8.69/573.02
extra: 564 / 559.5,
bottom: 8.69 / 573.02
} }
}, },
maw: { maw: {
@@ -19751,8 +19751,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/samuel/front.svg", source: "./media/characters/samuel/front.svg",
extra: 265/258,
bottom: 2/266.1566
extra: 265 / 258,
bottom: 2 / 266.1566
} }
}, },
}, },
@@ -19778,12 +19778,12 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/beishir-kiel/front.svg", source: "./media/characters/beishir-kiel/front.svg",
extra: 569/547,
bottom: 41.9/609
extra: 569 / 547,
bottom: 41.9 / 609
} }
}, },
maw: { maw: {
height: math.unit(6*0.202, "feet"),
height: math.unit(6 * 0.202, "feet"),
name: "Maw", name: "Maw",
image: { image: {
source: "./media/characters/beishir-kiel/maw.svg" source: "./media/characters/beishir-kiel/maw.svg"
@@ -19803,33 +19803,33 @@ characterMakers.push(() => makeCharacter(
{ name: "Logan Grey" }, { name: "Logan Grey" },
{ {
front: { front: {
height: math.unit(5 + 8/12, "feet"),
height: math.unit(5 + 8 / 12, "feet"),
weight: math.unit(120, "lb"), weight: math.unit(120, "lb"),
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/logan-grey/front.svg", source: "./media/characters/logan-grey/front.svg",
extra: 2539/2393,
bottom: 97.6/2636.37
extra: 2539 / 2393,
bottom: 97.6 / 2636.37
} }
}, },
frontAlt: { frontAlt: {
height: math.unit(5 + 8/12, "feet"),
height: math.unit(5 + 8 / 12, "feet"),
weight: math.unit(120, "lb"), weight: math.unit(120, "lb"),
name: "Front (Alt)", name: "Front (Alt)",
image: { image: {
source: "./media/characters/logan-grey/front-alt.svg", source: "./media/characters/logan-grey/front-alt.svg",
extra: 958/893,
bottom: 15/970.768
extra: 958 / 893,
bottom: 15 / 970.768
} }
}, },
back: { back: {
height: math.unit(5 + 8/12, "feet"),
height: math.unit(5 + 8 / 12, "feet"),
weight: math.unit(120, "lb"), weight: math.unit(120, "lb"),
name: "Back", name: "Back",
image: { image: {
source: "./media/characters/logan-grey/back.svg", source: "./media/characters/logan-grey/back.svg",
extra: 958/893,
bottom: 2.1881/970.9788
extra: 958 / 893,
bottom: 2.1881 / 970.9788
} }
}, },
dick: { dick: {
@@ -19843,7 +19843,7 @@ characterMakers.push(() => makeCharacter(
[ [
{ {
name: "Normal", name: "Normal",
height: math.unit(5 + 8/12, "feet")
height: math.unit(5 + 8 / 12, "feet")
}, },
{ {
name: "The 500 Foot Femboy", name: "The 500 Foot Femboy",
@@ -19861,20 +19861,20 @@ characterMakers.push(() => makeCharacter(
{ name: "Draganta" }, { name: "Draganta" },
{ {
front: { front: {
height: math.unit(8 + 2/12, "feet"),
height: math.unit(8 + 2 / 12, "feet"),
weight: math.unit(275, "lb"), weight: math.unit(275, "lb"),
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/draganta/front.svg", source: "./media/characters/draganta/front.svg",
extra: 1177/1135,
bottom: 33.46/1212.1
extra: 1177 / 1135,
bottom: 33.46 / 1212.1
} }
}, },
}, },
[ [
{ {
name: "Normal", name: "Normal",
height: math.unit(8 + 6/12, "feet"),
height: math.unit(8 + 6 / 12, "feet"),
default: true default: true
}, },
{ {
@@ -19897,8 +19897,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/voski/front.svg", source: "./media/characters/voski/front.svg",
extra: 2076.22/2022.4,
bottom: 102.7/2177.3866
extra: 2076.22 / 2022.4,
bottom: 102.7 / 2177.3866
} }
}, },
back: { back: {
@@ -19907,8 +19907,8 @@ characterMakers.push(() => makeCharacter(
name: "Back", name: "Back",
image: { image: {
source: "./media/characters/voski/back.svg", source: "./media/characters/voski/back.svg",
extra: 2104/2051,
bottom: 10.45/2113.63
extra: 2104 / 2051,
bottom: 10.45 / 2113.63
} }
}, },
}, },
@@ -19954,8 +19954,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/icowom-lee/front.svg", source: "./media/characters/icowom-lee/front.svg",
extra: 3076/2933,
bottom: 51.4/3125.1889
extra: 3076 / 2933,
bottom: 51.4 / 3125.1889
} }
}, },
}, },
@@ -19982,8 +19982,8 @@ characterMakers.push(() => makeCharacter(
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/shock-diamond/front.svg", source: "./media/characters/shock-diamond/front.svg",
extra: 2204/2053,
bottom: 65/2239.47
extra: 2204 / 2053,
bottom: 65 / 2239.47
} }
}, },
frontNude: { frontNude: {
@@ -19992,8 +19992,8 @@ characterMakers.push(() => makeCharacter(
name: "Front (Nude)", name: "Front (Nude)",
image: { image: {
source: "./media/characters/shock-diamond/front-nude.svg", source: "./media/characters/shock-diamond/front-nude.svg",
extra: 2514/2285,
bottom: 13/2527.56
extra: 2514 / 2285,
bottom: 13 / 2527.56
} }
}, },
}, },
@@ -20014,43 +20014,43 @@ characterMakers.push(() => makeCharacter(
{ name: "Rory" }, { name: "Rory" },
{ {
front: { front: {
height: math.unit(5 + 4/12, "feet"),
height: math.unit(5 + 4 / 12, "feet"),
weight: math.unit(120, "lb"), weight: math.unit(120, "lb"),
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/rory/front.svg", source: "./media/characters/rory/front.svg",
extra: 589/556,
bottom: 45.7/635.76
extra: 589 / 556,
bottom: 45.7 / 635.76
} }
}, },
frontNude: { frontNude: {
height: math.unit(5 + 4/12, "feet"),
height: math.unit(5 + 4 / 12, "feet"),
weight: math.unit(120, "lb"), weight: math.unit(120, "lb"),
name: "Front (Nude)", name: "Front (Nude)",
image: { image: {
source: "./media/characters/rory/front-nude.svg", source: "./media/characters/rory/front-nude.svg",
extra: 589/556,
bottom: 45.7/635.76
extra: 589 / 556,
bottom: 45.7 / 635.76
} }
}, },
side: { side: {
height: math.unit(5 + 4/12, "feet"),
height: math.unit(5 + 4 / 12, "feet"),
weight: math.unit(120, "lb"), weight: math.unit(120, "lb"),
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/rory/side.svg", source: "./media/characters/rory/side.svg",
extra: 597/564,
bottom: 55/653
extra: 597 / 564,
bottom: 55 / 653
} }
}, },
back: { back: {
height: math.unit(5 + 4/12, "feet"),
height: math.unit(5 + 4 / 12, "feet"),
weight: math.unit(120, "lb"), weight: math.unit(120, "lb"),
name: "Back", name: "Back",
image: { image: {
source: "./media/characters/rory/back.svg", source: "./media/characters/rory/back.svg",
extra: 620/585,
bottom: 8.86/630.43
extra: 620 / 585,
bottom: 8.86 / 630.43
} }
}, },
dick: { dick: {
@@ -20064,7 +20064,7 @@ characterMakers.push(() => makeCharacter(
[ [
{ {
name: "Normal", name: "Normal",
height: math.unit(5 + 4/12, "feet"),
height: math.unit(5 + 4 / 12, "feet"),
default: true default: true
}, },
{ {
@@ -20086,33 +20086,33 @@ characterMakers.push(() => makeCharacter(
{ name: "Sprisk" }, { name: "Sprisk" },
{ {
front: { front: {
height: math.unit(5 + 9/12, "feet"),
height: math.unit(5 + 9 / 12, "feet"),
weight: math.unit(190, "lb"), weight: math.unit(190, "lb"),
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/sprisk/front.svg", source: "./media/characters/sprisk/front.svg",
extra: 1225/1180,
bottom: 42.7/1266.4
extra: 1225 / 1180,
bottom: 42.7 / 1266.4
} }
}, },
frontNsfw: { frontNsfw: {
height: math.unit(5 + 9/12, "feet"),
height: math.unit(5 + 9 / 12, "feet"),
weight: math.unit(190, "lb"), weight: math.unit(190, "lb"),
name: "Front (NSFW)", name: "Front (NSFW)",
image: { image: {
source: "./media/characters/sprisk/front-nsfw.svg", source: "./media/characters/sprisk/front-nsfw.svg",
extra: 1225/1180,
bottom: 42.7/1266.4
extra: 1225 / 1180,
bottom: 42.7 / 1266.4
} }
}, },
back: { back: {
height: math.unit(5 + 9/12, "feet"),
height: math.unit(5 + 9 / 12, "feet"),
weight: math.unit(190, "lb"), weight: math.unit(190, "lb"),
name: "Back", name: "Back",
image: { image: {
source: "./media/characters/sprisk/back.svg", source: "./media/characters/sprisk/back.svg",
extra: 1247/1200,
bottom: 5.6/1253.04
extra: 1247 / 1200,
bottom: 5.6 / 1253.04
} }
}, },
}, },
@@ -20123,7 +20123,7 @@ characterMakers.push(() => makeCharacter(
}, },
{ {
name: "Normal", name: "Normal",
height: math.unit(5 + 9/12, "feet"),
height: math.unit(5 + 9 / 12, "feet"),
default: true default: true
}, },
{ {
@@ -20154,11 +20154,11 @@ characterMakers.push(() => makeCharacter(
name: "Side", name: "Side",
image: { image: {
source: "./media/characters/bunsen/side.svg", source: "./media/characters/bunsen/side.svg",
extra: 1644/358
extra: 1644 / 358
} }
}, },
foot: { foot: {
height: math.unit(1.611*1644/358, "meter"),
height: math.unit(1.611 * 1644 / 358, "meter"),
name: "Foot", name: "Foot",
image: { image: {
source: "./media/characters/bunsen/foot.svg" source: "./media/characters/bunsen/foot.svg"
@@ -20182,20 +20182,20 @@ characterMakers.push(() => makeCharacter(
{ name: "Sesh" }, { name: "Sesh" },
{ {
front: { front: {
height: math.unit(4 + 11/12, "feet"),
height: math.unit(4 + 11 / 12, "feet"),
weight: math.unit(140, "lb"), weight: math.unit(140, "lb"),
name: "Front", name: "Front",
image: { image: {
source: "./media/characters/sesh/front.svg", source: "./media/characters/sesh/front.svg",
extra: 3420/3231,
bottom: 72/3949.5
extra: 3420 / 3231,
bottom: 72 / 3949.5
} }
}, },
}, },
[ [
{ {
name: "Normal", name: "Normal",
height: math.unit(4 + 11/12, "feet")
height: math.unit(4 + 11 / 12, "feet")
}, },
{ {
name: "Grown", name: "Grown",
@@ -20232,10 +20232,10 @@ characterMakers.push(() => makeCharacter(
//characters //characters


function makeCharacters() { function makeCharacters() {
const results = [];
const results = [];


characterMakers.forEach(character => {
results.push(character());
});
return results;
}
characterMakers.forEach(character => {
results.push(character());
});
return results;
}

+ 1
- 1
presets/fiction.js View File

@@ -28,7 +28,7 @@ function makeFiction() {
) )
}); });


results.sort((b1, b2) => { results.sort((b1, b2) => {
e1 = b1.constructor(); e1 = b1.constructor();
e2 = b2.constructor(); e2 = b2.constructor();


+ 13
- 13
presets/food.js View File

@@ -7,13 +7,13 @@ function makeFood() {
"Human", "Human",
{ {
woman1: { woman1: {
height: math.unit(5 + 7/12, "feet"),
height: math.unit(5 + 7 / 12, "feet"),
mass: math.unit(140, "lbs"), mass: math.unit(140, "lbs"),
image: { source: "./media/food/humans/woman-1.svg" }, image: { source: "./media/food/humans/woman-1.svg" },
name: "Woman 1" name: "Woman 1"
}, },
man1: { man1: {
height: math.unit(5 + 11/12, "feet"),
height: math.unit(5 + 11 / 12, "feet"),
mass: math.unit(150, "lbs"), mass: math.unit(150, "lbs"),
image: { source: "./media/food/humans/man-1.svg" }, image: { source: "./media/food/humans/man-1.svg" },
name: "Man 1" name: "Man 1"
@@ -82,10 +82,10 @@ function makeFood() {
["horse", 2.08, "meters", 550, "kg"], ["horse", 2.08, "meters", 550, "kg"],
["african-elephant", 3.2, "meters", 4000, "kg"] ["african-elephant", 3.2, "meters", 4000, "kg"]
], ],
"Animals",
"",
"food"
));
"Animals",
"",
"food"
));


results.push( results.push(
makeHeightWeight([ makeHeightWeight([
@@ -95,10 +95,10 @@ function makeFood() {
["tyrannosaurus", 5.2, "meters", 14e3, "kg"], ["tyrannosaurus", 5.2, "meters", 14e3, "kg"],
["velociraptor", 1.6, "meters", 15, "kg"] ["velociraptor", 1.6, "meters", 15, "kg"]
], ],
"Dinosaurs",
"",
"food"
));
"Dinosaurs",
"",
"food"
));


results.push(makeHeight( results.push(makeHeight(
[ [
@@ -155,8 +155,8 @@ function makeFood() {


results.push(makeHeightWeight( results.push(makeHeightWeight(
[ [
["m&m", 0.5262, "inches", 43/50, "g", "./media/objects/circle.svg"],
["skittle", 0.50, "inches", 53/50, "g", "./media/objects/circle.svg"],
["m&m", 0.5262, "inches", 43 / 50, "g", "./media/objects/circle.svg"],
["skittle", 0.50, "inches", 53 / 50, "g", "./media/objects/circle.svg"],
["gummy-bear", 2, "inches", 3.5, "g"], ["gummy-bear", 2, "inches", 3.5, "g"],
["lifesaver", 0.925, "inches", 3.5, "g"], ["lifesaver", 0.925, "inches", 3.5, "g"],
], ],
@@ -170,7 +170,7 @@ function makeFood() {
e2 = b2.constructor(); e2 = b2.constructor();
return -math.subtract(e1.views[e1.defaultView].height, e2.views[e2.defaultView].height).value; return -math.subtract(e1.views[e1.defaultView].height, e2.views[e2.defaultView].height).value;
}); });


return results; return results;
} }

+ 2
- 2
presets/landmarks.js View File

@@ -96,7 +96,7 @@ function makeLandmarks() {
name: "Washington Monument", name: "Washington Monument",
constructor: () => makeLandmark( constructor: () => makeLandmark(
"Washington Monument", "Washington Monument",
math.unit(555 + 5/12, "feet"),
math.unit(555 + 5 / 12, "feet"),
{ source: "./media/landmarks/washington-monument.svg" } { source: "./media/landmarks/washington-monument.svg" }
) )
}); });
@@ -124,7 +124,7 @@ function makeLandmarks() {
constructor: () => makeLandmark( constructor: () => makeLandmark(
"Leaning Tower of Pisa", "Leaning Tower of Pisa",
math.unit(185.93, "feet"), math.unit(185.93, "feet"),
{ source: "./media/landmarks/leaning-tower-of-pisa.svg", bottom: 84/3755 }
{ source: "./media/landmarks/leaning-tower-of-pisa.svg", bottom: 84 / 3755 }
) )
}); });




+ 887
- 887
presets/naturals.js
File diff suppressed because it is too large
View File


+ 14
- 17
presets/objects.js View File

@@ -1,6 +1,3 @@



function makeObject(name, viewInfo) { function makeObject(name, viewInfo) {
views = {}; views = {};


@@ -42,13 +39,13 @@ function addShoeView(object, name, points) {
} }
} }


function makeHeight(info, category, prefix="", type="objects") {
function makeHeight(info, category, prefix = "", type = "objects") {
const views = {}; const views = {};




info.forEach(object => { info.forEach(object => {
let src; let src;
// this lets us provide our own source if needed // this lets us provide our own source if needed
// useful for reusing existing art // useful for reusing existing art
if (object[3]) { if (object[3]) {
@@ -73,7 +70,7 @@ function makeHeight(info, category, prefix="", type="objects") {
} }
} }


function makeHeightWeight(info, category, prefix="", type="objects") {
function makeHeightWeight(info, category, prefix = "", type = "objects") {
const views = {}; const views = {};
info.forEach(object => { info.forEach(object => {
let src; let src;
@@ -196,7 +193,7 @@ function makeObjects() {
"Shot Glass", "Shot Glass",
{ {
glass: { glass: {
height: math.unit(2 + 3/8, "inches"),
height: math.unit(2 + 3 / 8, "inches"),
mass: math.unit(75, "g"), mass: math.unit(75, "g"),
image: { source: "./media/objects/shot-glass.svg" }, image: { source: "./media/objects/shot-glass.svg" },
name: "Bottle" name: "Bottle"
@@ -455,15 +452,15 @@ function makeObjects() {
} }
) )
}) })
results.push(makeHeight( results.push(makeHeight(
[ [
["king", 4, "inches"], ["king", 4, "inches"],
["queen", 351/407*4, "inches"],
["bishop", 340/407*4, "inches"],
["knight", 309/407*4, "inches"],
["rook", 271/407*4, "inches"],
["pawn", 197/407*4, "inches"],
["queen", 351 / 407 * 4, "inches"],
["bishop", 340 / 407 * 4, "inches"],
["knight", 309 / 407 * 4, "inches"],
["rook", 271 / 407 * 4, "inches"],
["pawn", 197 / 407 * 4, "inches"],
], ],
"Chess Pieces", "Chess Pieces",
"chess_" "chess_"
@@ -556,7 +553,7 @@ function makeObjects() {
name: value.name, name: value.name,
rename: true rename: true
} }
if (value.mass) { if (value.mass) {
views[key].attributes.mass = { views[key].attributes.mass = {
name: "Mass", name: "Mass",
@@ -566,7 +563,7 @@ function makeObjects() {
}; };
} }
}); });
return makeEntity({ name: "Strand" }, views); return makeEntity({ name: "Strand" }, views);
} }
}) })
@@ -586,13 +583,13 @@ function makeObjects() {
"cell_" "cell_"
)) ))


results.sort((b1, b2) => { results.sort((b1, b2) => {
e1 = b1.constructor(); e1 = b1.constructor();
e2 = b2.constructor(); e2 = b2.constructor();
return -math.subtract(e1.views[e1.defaultView].height, e2.views[e2.defaultView].height).value; return -math.subtract(e1.views[e1.defaultView].height, e2.views[e2.defaultView].height).value;
}); });


return results; return results;
} }

+ 11
- 11
presets/scenes.js View File

@@ -1,11 +1,11 @@
const scenes = {}; const scenes = {};


scenes["Default"] = () => { scenes["Default"] = () => {
importScene({"entities":[{"name":"Fen","scale":1,"view":"back","x":"0.5152113970588236","y":"1"}],"world":{"height":2.9053707516337908,"unit":"meters"}});
importScene({ "entities": [{ "name": "Fen", "scale": 1, "view": "back", "x": "0.5152113970588236", "y": "1" }], "world": { "height": 2.9053707516337908, "unit": "meters" } });
fitWorld(true); fitWorld(true);
} }
scenes["Demo"] = () => { scenes["Demo"] = () => {
importScene({"entities":[{"name":"Fen","scale":13.37613697164259,"view":"back","x":"0.4739888072901602","y":"1"},{"name":"Cars","scale":1,"view":"Toyota Prius C (Side)","x":"0.5446325587240624","y":"1"},{"name":"Flagpole","scale":1,"view":"medium","x":"0.6884494749664603","y":"1"},{"name":"Aircraft","scale":1,"view":"Cessena 172 (Side)","x":"0.5554263161666061","y":"0.22135128477620036"},{"name":"Bus","scale":1,"view":"side","x":"0.3384726446176792","y":"1"},{"name":"Leopard 2 Rev. 1","scale":1,"view":"side","x":"0.6168929701770606","y":"1"},{"name":"Trees","scale":1,"view":"sycamore","x":"0.19678198200160846","y":"1"},{"name":"18-Wheeler","scale":1,"view":"side","x":"0.7563502890715608","y":"1"},{"name":"Cars","scale":1,"view":"Toyota Prius C (Top)","x":"0.5363900938385269","y":"0.7215473541048467"},{"name":"Human","scale":1,"view":"woman1","x":"0.4756975717747481","y":"1"},{"name":"Human","scale":1,"view":"man1","x":"0.47400075247875356","y":"0.2538019287833828"}],"world":{"height":38.5,"unit":"meters"}})
importScene({ "entities": [{ "name": "Fen", "scale": 13.37613697164259, "view": "back", "x": "0.4739888072901602", "y": "1" }, { "name": "Cars", "scale": 1, "view": "Toyota Prius C (Side)", "x": "0.5446325587240624", "y": "1" }, { "name": "Flagpole", "scale": 1, "view": "medium", "x": "0.6884494749664603", "y": "1" }, { "name": "Aircraft", "scale": 1, "view": "Cessena 172 (Side)", "x": "0.5554263161666061", "y": "0.22135128477620036" }, { "name": "Bus", "scale": 1, "view": "side", "x": "0.3384726446176792", "y": "1" }, { "name": "Leopard 2 Rev. 1", "scale": 1, "view": "side", "x": "0.6168929701770606", "y": "1" }, { "name": "Trees", "scale": 1, "view": "sycamore", "x": "0.19678198200160846", "y": "1" }, { "name": "18-Wheeler", "scale": 1, "view": "side", "x": "0.7563502890715608", "y": "1" }, { "name": "Cars", "scale": 1, "view": "Toyota Prius C (Top)", "x": "0.5363900938385269", "y": "0.7215473541048467" }, { "name": "Human", "scale": 1, "view": "woman1", "x": "0.4756975717747481", "y": "1" }, { "name": "Human", "scale": 1, "view": "man1", "x": "0.47400075247875356", "y": "0.2538019287833828" }], "world": { "height": 38.5, "unit": "meters" } })
fitWorld(true); fitWorld(true);
} }


@@ -41,12 +41,12 @@ function makeSlice(min, max) {
const entity = x.constructor(); const entity = x.constructor();
return math.compare(entity.views[entity.view].height, min) == 1 && math.compare(entity.views[entity.view].height, max) != 1 return math.compare(entity.views[entity.view].height, min) == 1 && math.compare(entity.views[entity.view].height, max) != 1
}); });
characters.forEach(character => { characters.forEach(character => {
const entity = character.constructor(); const entity = character.constructor();
displayEntity(entity, entity.view, 0, 1); displayEntity(entity, entity.view, 0, 1);
}); });
arrangeEntities(getSortedEntities()); arrangeEntities(getSortedEntities());
fitWorld(true); fitWorld(true);
} }
@@ -129,7 +129,7 @@ function makeOwnerScene(owners) {
console.log(entity) console.log(entity)
displayEntity(entity, entity.view, 0, 1); displayEntity(entity, entity.view, 0, 1);
}); });
arrangeEntities(getSortedEntities()); arrangeEntities(getSortedEntities());
fitWorld(true); fitWorld(true);
} }
@@ -160,7 +160,7 @@ function makeOwnerSceneViews(owners) {
console.log(entity) console.log(entity)
displayEntity(entity, entity.view, 0, 1); displayEntity(entity, entity.view, 0, 1);
}); });
arrangeEntities(getSortedEntities()); arrangeEntities(getSortedEntities());
fitWorld(true); fitWorld(true);
} }
@@ -183,18 +183,18 @@ scenes["Neopuc"] = () => {
}).reduce((size, entity) => { }).reduce((size, entity) => {
entity.views[entity.view].height = math.unit(100 * Math.sqrt(size) * (entity.name == "Ilisha Devya" ? 2 : 1), "meters"); entity.views[entity.view].height = math.unit(100 * Math.sqrt(size) * (entity.name == "Ilisha Devya" ? 2 : 1), "meters");
displayEntity(entity, entity.view, 0, 1); displayEntity(entity, entity.view, 0, 1);
return size+1;
return size + 1;
}, 1) }, 1)
arrangeEntities(getSortedEntities()); arrangeEntities(getSortedEntities());
fitWorld(true); fitWorld(true);
} }


scenes["Fidverse"] = () => { scenes["Fidverse"] = () => {
makeOwnerSceneViews(["fidchell", "cam"])(); makeOwnerSceneViews(["fidchell", "cam"])();
document.querySelector("#entity-" + (entityIndex-1)).dataset.x = 0.5;
document.querySelector("#entity-" + (entityIndex-2)).dataset.x = 0.25;
document.querySelector("#entity-" + (entityIndex-3)).dataset.x = 0.75;
document.querySelector("#entity-" + (entityIndex - 1)).dataset.x = 0.5;
document.querySelector("#entity-" + (entityIndex - 2)).dataset.x = 0.25;
document.querySelector("#entity-" + (entityIndex - 3)).dataset.x = 0.75;
updateSizes(); updateSizes();
fitWorld(true, 1); fitWorld(true, 1);
} }

+ 3
- 3
presets/species.js View File

@@ -28,7 +28,7 @@ speciesMakers["Synx"] = () => {
name: "Synx", name: "Synx",
image: { image: {
source: "./media/species/synx/synx.svg", source: "./media/species/synx/synx.svg",
extra: 8.06/6.6,
extra: 8.06 / 6.6,
bottom: 0.05 bottom: 0.05
} }
}, },
@@ -38,13 +38,13 @@ speciesMakers["Synx"] = () => {
name: "Weeper", name: "Weeper",
image: { image: {
source: "./media/species/synx/weeper.svg", source: "./media/species/synx/weeper.svg",
extra: 8.04/7.5,
extra: 8.04 / 7.5,
bottom: 0.05 bottom: 0.05
} }
}, },
}, },
[ [
] ]
); );




+ 40
- 40
presets/vehicles.js View File

@@ -68,8 +68,8 @@ function makeAircraft() {
], ],




sides = {}
const sorted = options.sort((a,b) => a[1]-b[1])
sides = {}
const sorted = options.sort((a, b) => a[1] - b[1])


sorted.forEach(plane => { sorted.forEach(plane => {
sides[plane[0] + " (Side)"] = { sides[plane[0] + " (Side)"] = {
@@ -102,23 +102,23 @@ function makeAircraft() {


entity.sizes.push({ entity.sizes.push({
name: "1:72", name: "1:72",
height: math.unit(sorted[0][2]/72, "meters")
height: math.unit(sorted[0][2] / 72, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:24", name: "1:24",
height: math.unit(sorted[0][2]/24, "meters")
height: math.unit(sorted[0][2] / 24, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:16", name: "1:16",
height: math.unit(sorted[0][2]/16, "meters")
height: math.unit(sorted[0][2] / 16, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:8", name: "1:8",
height: math.unit(sorted[0][2]/8, "meters")
height: math.unit(sorted[0][2] / 8, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:4", name: "1:4",
height: math.unit(sorted[0][2]/4, "meters")
height: math.unit(sorted[0][2] / 4, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1", name: "1",
@@ -137,7 +137,7 @@ function makeCars() {
["Ford F-150", 5.89, 1.92, 1950, 1, 1, 1] ["Ford F-150", 5.89, 1.92, 1950, 1, 1, 1]
] ]
sides = {} sides = {}
const sorted = options.sort((a,b) => a[1]-b[1])
const sorted = options.sort((a, b) => a[1] - b[1])


sorted.forEach(car => { sorted.forEach(car => {
sides[car[0] + " (Front)"] = { sides[car[0] + " (Front)"] = {
@@ -147,7 +147,7 @@ function makeCars() {
mass: math.unit(car[3], "kg"), mass: math.unit(car[3], "kg"),
image: { source: "./media/vehicles/cars/car_" + car[0].replace(/ /g, "-").toLowerCase() + "-front.svg", extra: car[4] } image: { source: "./media/vehicles/cars/car_" + car[0].replace(/ /g, "-").toLowerCase() + "-front.svg", extra: car[4] }
}; };
sides[car[0] + " (Side)"] = { sides[car[0] + " (Side)"] = {
name: car[0] + " (Side)", name: car[0] + " (Side)",
rename: true, rename: true,
@@ -169,23 +169,23 @@ function makeCars() {


entity.sizes.push({ entity.sizes.push({
name: "1:72", name: "1:72",
height: math.unit(sorted[0][2]/72, "meters")
height: math.unit(sorted[0][2] / 72, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:24", name: "1:24",
height: math.unit(sorted[0][2]/24, "meters")
height: math.unit(sorted[0][2] / 24, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:16", name: "1:16",
height: math.unit(sorted[0][2]/16, "meters")
height: math.unit(sorted[0][2] / 16, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:8", name: "1:8",
height: math.unit(sorted[0][2]/8, "meters")
height: math.unit(sorted[0][2] / 8, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:4", name: "1:4",
height: math.unit(sorted[0][2]/4, "meters")
height: math.unit(sorted[0][2] / 4, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1", name: "1",
@@ -212,7 +212,7 @@ function makeBuses() {
mass: math.unit(bus[3], "kg"), mass: math.unit(bus[3], "kg"),
image: { source: "./media/vehicles/buses/bus_" + bus[0].replace(/ /g, "-").toLowerCase() + "-front.svg", extra: bus[4] } image: { source: "./media/vehicles/buses/bus_" + bus[0].replace(/ /g, "-").toLowerCase() + "-front.svg", extra: bus[4] }
}; };
sides[bus[0] + " (Side)"] = { sides[bus[0] + " (Side)"] = {
name: bus[0] + " (Side)", name: bus[0] + " (Side)",
rename: true, rename: true,
@@ -234,23 +234,23 @@ function makeBuses() {


entity.sizes.push({ entity.sizes.push({
name: "1:72", name: "1:72",
height: math.unit(options[0][2]/72, "meters")
height: math.unit(options[0][2] / 72, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:24", name: "1:24",
height: math.unit(options[0][2]/24, "meters")
height: math.unit(options[0][2] / 24, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:16", name: "1:16",
height: math.unit(options[0][2]/16, "meters")
height: math.unit(options[0][2] / 16, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:8", name: "1:8",
height: math.unit(options[0][2]/8, "meters")
height: math.unit(options[0][2] / 8, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:4", name: "1:4",
height: math.unit(options[0][2]/4, "meters")
height: math.unit(options[0][2] / 4, "meters")
}); });
entity.sizes.push({ entity.sizes.push({
name: "1", name: "1",
@@ -284,23 +284,23 @@ function makeVehicleGroup(info, name, prefix) {


entity.sizes.push({ entity.sizes.push({
name: "1:72", name: "1:72",
height: math.unit(math.divide(defaultHeight,72))
height: math.unit(math.divide(defaultHeight, 72))
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:24", name: "1:24",
height: math.unit(math.divide(defaultHeight,24))
height: math.unit(math.divide(defaultHeight, 24))
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:16", name: "1:16",
height: math.unit(math.divide(defaultHeight,16))
height: math.unit(math.divide(defaultHeight, 16))
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:8", name: "1:8",
height: math.unit(math.divide(defaultHeight,8))
height: math.unit(math.divide(defaultHeight, 8))
}); });
entity.sizes.push({ entity.sizes.push({
name: "1:4", name: "1:4",
height: math.unit(math.divide(defaultHeight,4))
height: math.unit(math.divide(defaultHeight, 4))
}); });


return entity; return entity;
@@ -336,7 +336,7 @@ function makeVehicles() {
{ {
side: { side: {
name: "Side", name: "Side",
height: math.unit(883*1114/4250, "feet"),
height: math.unit(883 * 1114 / 4250, "feet"),
image: { source: "./media/vehicles/titanic.svg" }, image: { source: "./media/vehicles/titanic.svg" },
}, },
sideVertical: { sideVertical: {
@@ -398,22 +398,22 @@ function makeVehicles() {
} }
) )
}); });
results.push({ results.push({
name: "Aircraft", name: "Aircraft",
constructor: () => makeAircraft() constructor: () => makeAircraft()
}); });
results.push({ results.push({
name: "Cars", name: "Cars",
constructor: () => makeCars() constructor: () => makeCars()
}); });
results.push({ results.push({
name: "Buses", name: "Buses",
constructor: () => makeBuses() constructor: () => makeBuses()
}); });
results.push({ results.push({
name: "Trains", name: "Trains",
constructor: () => makeVehicleGroup([ constructor: () => makeVehicleGroup([
@@ -437,23 +437,23 @@ function makeVehicles() {
name: "3250 Cubic Ft Hopper", name: "3250 Cubic Ft Hopper",
mass: math.unit(52000, "lbs"), mass: math.unit(52000, "lbs"),
sides: { sides: {
"Side": { height: math.unit(15 + 3/12, "feet") },
"Front": { height: math.unit(15 + 3/12, "feet") },
"Side": { height: math.unit(15 + 3 / 12, "feet") },
"Front": { height: math.unit(15 + 3 / 12, "feet") },
} }
}, },
{ {
name: "28600 Gallon Tank Car", name: "28600 Gallon Tank Car",
mass: math.unit(93000, "lbs"), mass: math.unit(93000, "lbs"),
sides: { sides: {
"Side": { height: math.unit(15 + 5.7/12, "feet") },
"Front": { height: math.unit(15 + 5.7/12, "feet") },
"Side": { height: math.unit(15 + 5.7 / 12, "feet") },
"Front": { height: math.unit(15 + 5.7 / 12, "feet") },
} }
} }
], ],
"Trains",
"train")
});
"Trains",
"train")
});
results.push({ results.push({
name: "Warships", name: "Warships",
constructor: () => makeVehicleGroup([ constructor: () => makeVehicleGroup([
@@ -512,8 +512,8 @@ function makeVehicles() {
} }
}, },
], ],
"Warships",
"")
"Warships",
"")
}); });


return results; return results;


Loading…
Cancel
Save