|  |  | @@ -1,6 +1,31 @@ | 
		
	
		
			
			|  |  |  | const scenes = {}; | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | scenes["military"] = () => { | 
		
	
		
			
			|  |  |  | scenes["Demo"] = () => { | 
		
	
		
			
			|  |  |  | removeAllEntities(); | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | let entity = availableEntitiesByName["Fen"].constructor(); | 
		
	
		
			
			|  |  |  | displayEntity(entity, entity.defaultView, 0, 1); | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | entity = availableEntitiesByName["Deerpuff"].constructor(); | 
		
	
		
			
			|  |  |  | displayEntity(entity, entity.defaultView, 0, 1); | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | entity = availableEntitiesByName["Sofia"].constructor(); | 
		
	
		
			
			|  |  |  | entity.views[entity.view].height = entity.sizes[2].height; | 
		
	
		
			
			|  |  |  | displayEntity(entity, entity.defaultView, 0, 1); | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | entity = availableEntitiesByName["Vivian"].constructor(); | 
		
	
		
			
			|  |  |  | entity.views[entity.view].height = entity.sizes[2].height; | 
		
	
		
			
			|  |  |  | displayEntity(entity, entity.defaultView, 0, 1); | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | arrangeEntities(getSortedEntities()); | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | entity = availableEntitiesByName["Houston"].constructor(); | 
		
	
		
			
			|  |  |  | displayEntity(entity, entity.defaultView, 0.5, 1); | 
		
	
		
			
			|  |  |  | fitWorld(); | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | scenes["Military"] = () => { | 
		
	
		
			
			|  |  |  | removeAllEntities(); | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | let entity = availableEntitiesByName["Asana (Mech)"].constructor(); | 
		
	
	
		
			
				|  |  | @@ -12,17 +37,37 @@ scenes["military"] = () => { | 
		
	
		
			
			|  |  |  | entity = availableEntitiesByName["Leopard 2 Rev. 1"].constructor(); | 
		
	
		
			
			|  |  |  | displayEntity(entity, entity.defaultView, 0, 1); | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | entity = availableEntitiesByName["Asana"].constructor(); | 
		
	
		
			
			|  |  |  | displayEntity(entity, entity.defaultView, 0, 1); | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | const order = Object.keys(entities).sort((a, b) => { | 
		
	
		
			
			|  |  |  | const entA = entities[a]; | 
		
	
		
			
			|  |  |  | const entB = entities[b]; | 
		
	
		
			
			|  |  |  | const viewA = document.querySelector("#entity-" + a).dataset.view; | 
		
	
		
			
			|  |  |  | const viewB = document.querySelector("#entity-" + b).dataset.view; | 
		
	
		
			
			|  |  |  | const heightA = entA.views[viewA].height.to("meter").value; | 
		
	
		
			
			|  |  |  | const heightB = entB.views[viewB].height.to("meter").value; | 
		
	
		
			
			|  |  |  | return heightA - heightB; | 
		
	
		
			
			|  |  |  | }); | 
		
	
		
			
			|  |  |  | entity = availableEntitiesByName["Ashtrek"].constructor(); | 
		
	
		
			
			|  |  |  | entity.views[entity.view].height = entity.sizes[0].height; | 
		
	
		
			
			|  |  |  | displayEntity(entity, entity.defaultView, 0, 1); | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | arrangeEntities(order); | 
		
	
		
			
			|  |  |  | arrangeEntities(getSortedEntities()); | 
		
	
		
			
			|  |  |  | fitWorld(); | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | function makeSlice(min, max) { | 
		
	
		
			
			|  |  |  | return () => { | 
		
	
		
			
			|  |  |  | const characters = availableEntities["characters"].filter(x => { | 
		
	
		
			
			|  |  |  | const entity = x.constructor(); | 
		
	
		
			
			|  |  |  | return math.compare(entity.views[entity.view].height, min) == 1 && math.compare(entity.views[entity.view].height, max) == -1 | 
		
	
		
			
			|  |  |  | }); | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | characters.forEach(character => { | 
		
	
		
			
			|  |  |  | const entity = character.constructor(); | 
		
	
		
			
			|  |  |  | displayEntity(entity, entity.view, 0, 1); | 
		
	
		
			
			|  |  |  | }); | 
		
	
		
			
			|  |  |  |  | 
		
	
		
			
			|  |  |  | arrangeEntities(getSortedEntities()); | 
		
	
		
			
			|  |  |  | fitWorld(); | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | } | 
		
	
		
			
			|  |  |  | 
 | 
		
	
		
			
			|  |  |  | scenes["x < 10m"] = makeSlice(math.unit(0, "meters"), math.unit(10, "meters")); | 
		
	
		
			
			|  |  |  | scenes["10m < x < 100m"] = makeSlice(math.unit(10, "meters"), math.unit(100, "meters")); | 
		
	
		
			
			|  |  |  | scenes["100m < x < 1km"] = makeSlice(math.unit(100, "meters"), math.unit(1000, "meters")); | 
		
	
		
			
			|  |  |  | scenes["1km < x < 10km"] = makeSlice(math.unit(1000, "meters"), math.unit(10000, "meters")); | 
		
	
		
			
			|  |  |  | scenes["10km < x < 100km"] = makeSlice(math.unit(10000, "meters"), math.unit(100000, "meters")); | 
		
	
		
			
			|  |  |  | scenes["100km < x < 1000km"] = makeSlice(math.unit(100000, "meters"), math.unit(1000000, "meters")); |