|
|
@ -16,7 +16,6 @@ let home = new THREE.Group() |
|
|
|
homeContainer.add(home) |
|
|
|
homeContainer.add(home) |
|
|
|
|
|
|
|
|
|
|
|
var areaData = { } |
|
|
|
var areaData = { } |
|
|
|
|
|
|
|
|
|
|
|
var areasWithEntitiesToUpdate = { } |
|
|
|
var areasWithEntitiesToUpdate = { } |
|
|
|
|
|
|
|
|
|
|
|
const renderer = new THREE.WebGLRenderer({ |
|
|
|
const renderer = new THREE.WebGLRenderer({ |
|
|
@ -197,6 +196,8 @@ function configureScene(data) { |
|
|
|
var maxX = -1000 |
|
|
|
var maxX = -1000 |
|
|
|
var minY = minX |
|
|
|
var minY = minX |
|
|
|
var maxY = maxX |
|
|
|
var maxY = maxX |
|
|
|
|
|
|
|
var minZ = minX |
|
|
|
|
|
|
|
var maxZ = maxX |
|
|
|
|
|
|
|
|
|
|
|
areaData = data |
|
|
|
areaData = data |
|
|
|
|
|
|
|
|
|
|
@ -225,19 +226,31 @@ function configureScene(data) { |
|
|
|
roomLabel.userData.name = "label" |
|
|
|
roomLabel.userData.name = "label" |
|
|
|
roomContainer.add(roomLabel) |
|
|
|
roomContainer.add(roomLabel) |
|
|
|
|
|
|
|
|
|
|
|
setPosition(roomContainer, room.x, room.y, room.z || 0, room.w, room.h, room.d) |
|
|
|
let roomZ = room.z || 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setPosition(roomContainer, room.x, room.y, roomZ, room.w, room.h, room.d) |
|
|
|
home.add(roomContainer) |
|
|
|
home.add(roomContainer) |
|
|
|
|
|
|
|
|
|
|
|
minX = Math.min(minX, room.x) |
|
|
|
minX = Math.min(minX, room.x) |
|
|
|
minY = Math.min(minY, room.y) |
|
|
|
minY = Math.min(minY, room.y) |
|
|
|
|
|
|
|
minZ = Math.min(minZ, roomZ) |
|
|
|
|
|
|
|
|
|
|
|
maxX = Math.max(maxX, room.x + room.w) |
|
|
|
maxX = Math.max(maxX, room.x + room.w) |
|
|
|
maxY = Math.max(maxY, room.y + room.h) |
|
|
|
maxY = Math.max(maxY, room.y + room.h) |
|
|
|
|
|
|
|
maxZ = Math.max(maxZ, roomZ + room.d) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let xExtent = maxX - minX |
|
|
|
let xExtent = maxX - minX |
|
|
|
let yExtent = maxY - minY |
|
|
|
let yExtent = maxY - minY |
|
|
|
|
|
|
|
let zExtent = maxZ - minZ |
|
|
|
|
|
|
|
|
|
|
|
home.position.x = -1 * (xExtent / 2) |
|
|
|
home.position.x = -1 * (xExtent / 2) |
|
|
|
home.position.y = +1 * (yExtent / 2) |
|
|
|
home.position.y = +1 * (yExtent / 2) |
|
|
|
|
|
|
|
home.position.z = -1 * (zExtent / 2) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let centerX = minX + (xExtent / 2) |
|
|
|
|
|
|
|
let centerY = minY + (yExtent / 2) |
|
|
|
|
|
|
|
let centerZ = minZ + (zExtent / 2) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function loadHomeData() { |
|
|
|
async function loadHomeData() { |
|
|
|