From e7d5fa5e1489094ed1aa2069df63eca0e98212fd Mon Sep 17 00:00:00 2001 From: "M.S.T.O.P" Date: Mon, 2 Oct 2023 22:13:45 -0400 Subject: [PATCH 1/6] refactor imports from THREE --- src/components/objects/mapObjects.ts | 28 +++++++++++++++++----------- src/components/setup/camera.ts | 26 +++++++++++--------------- src/components/setup/mapScene.ts | 28 +++++++++++++++++----------- src/components/setup/materials.ts | 8 ++++---- src/components/setup/renderer.ts | 6 +++--- src/config/materials.ts | 6 +++--- src/main.ts | 10 +++++----- 7 files changed, 60 insertions(+), 52 deletions(-) diff --git a/src/components/objects/mapObjects.ts b/src/components/objects/mapObjects.ts index 42c8487..5152e40 100644 --- a/src/components/objects/mapObjects.ts +++ b/src/components/objects/mapObjects.ts @@ -1,4 +1,10 @@ -import * as THREE from 'three'; +import { + Mesh, + type MeshStandardMaterial, + BoxGeometry, + CylinderGeometry, + SphereGeometry, +} from 'three'; import { CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js'; import { LineGeometry } from 'three/addons/lines/LineGeometry.js'; import { Line2 } from 'three/addons/lines/Line2.js'; @@ -65,8 +71,8 @@ export function createPath(pathData: PathData, id: number) { } export function createRoom(roomData: RoomData, id: number) { - let roomMesh: THREE.Mesh | null = null; - const material = getMaterial('room') as THREE.MeshStandardMaterial; + let roomMesh: Mesh | null = null; + const material = getMaterial('room') as MeshStandardMaterial; if (isCuboidRoomData(roomData)) { const { corners } = roomData; @@ -75,22 +81,22 @@ export function createRoom(roomData: RoomData, id: number) { const height = Math.abs(corners[1][1] - corners[0][1]) + 1; const length = Math.abs(corners[1][2] - corners[0][2]) + 1; - const roomGeom = new THREE.BoxGeometry(width, height, length); - roomMesh = new THREE.Mesh(roomGeom, material); + const roomGeom = new BoxGeometry(width, height, length); + roomMesh = new Mesh(roomGeom, material); roomMesh.position.x = (corners[0][0] + corners[1][0]) / 2; roomMesh.position.y = (corners[0][1] + corners[1][1]) / 2; roomMesh.position.z = (corners[0][2] + corners[1][2]) / 2; } else if (isCylindricalRoomData(roomData)) { const { height, radius, bottomCenter } = roomData; - const roomGeom = new THREE.CylinderGeometry( + const roomGeom = new CylinderGeometry( radius + 1, radius + 1, height + 1, 8, 3, ); - roomMesh = new THREE.Mesh(roomGeom, material); + roomMesh = new Mesh(roomGeom, material); roomMesh.position.x = bottomCenter[0]; roomMesh.position.y = bottomCenter[1] + height / 2; roomMesh.position.z = bottomCenter[2]; @@ -138,8 +144,8 @@ export function createDoor(doorData: DoorData, id: number) { height = doorHeight; } - const doorGeom = new THREE.BoxGeometry(width, height, length); - const doorMesh = new THREE.Mesh(doorGeom, material); + const doorGeom = new BoxGeometry(width, height, length); + const doorMesh = new Mesh(doorGeom, material); doorMesh.position.x = location[0]; doorMesh.position.y = location[1] + height / 2; doorMesh.position.z = location[2]; @@ -156,12 +162,12 @@ export function createPortal(portalData: PortalData, id: number) { const material = getMaterial('portal'); // Create portal marker - const portalGeom = new THREE.SphereGeometry( + const portalGeom = new SphereGeometry( portalSize, portalWidthSegments, portalHeightSegments, ); - const portalMesh = new THREE.Mesh(portalGeom, material); + const portalMesh = new Mesh(portalGeom, material); portalMesh.position.x = location[0]; portalMesh.position.y = location[1] + portalSize / 2; portalMesh.position.z = location[2]; diff --git a/src/components/setup/camera.ts b/src/components/setup/camera.ts index c6c5b9f..9d23925 100644 --- a/src/components/setup/camera.ts +++ b/src/components/setup/camera.ts @@ -1,8 +1,8 @@ -import * as THREE from 'three'; +import { OrthographicCamera, type WebGLRenderer, Vector3 } from 'three'; import { MapControls } from 'three/addons/controls/MapControls.js'; import { CameraState } from '../../types'; -export let camera: THREE.OrthographicCamera; +export let camera: OrthographicCamera; export let cameraControls: MapControls; let lastZoom: number; @@ -17,7 +17,7 @@ const cameraStates: CameraState[] = []; let scaleNumberElem: HTMLElement | null; export function setupCamera() { - camera = new THREE.OrthographicCamera( + camera = new OrthographicCamera( -window.innerWidth / viewScale, window.innerWidth / viewScale, window.innerHeight / viewScale, @@ -27,7 +27,7 @@ export function setupCamera() { ); } -export function setupCameraControls(renderer: THREE.WebGLRenderer) { +export function setupCameraControls(renderer: WebGLRenderer) { cameraControls = new MapControls(camera, renderer.domElement); cameraControls.enableDamping = false; camera.position.set(camX, camY, camZ); @@ -43,14 +43,10 @@ export function setupCameraControls(renderer: THREE.WebGLRenderer) { const initCameraPos = getInitialCameraPosition(); - saveCameraState(new THREE.Vector3(0, 0, 0), initCameraPos, 1); // Isometric Camera - saveCameraState( - new THREE.Vector3(0, 0, 0), - new THREE.Vector3(0, initCameraPos.y, 0), - 1, - ); // Overhead Camera - saveCameraState(new THREE.Vector3(0, 64, 0), new THREE.Vector3(-1, 64, 0), 1); // Side Camera (East) - saveCameraState(new THREE.Vector3(0, 64, 0), new THREE.Vector3(0, 64, 1), 1); // Side Camera (North) + saveCameraState(new Vector3(0, 0, 0), initCameraPos, 1); // Isometric Camera + saveCameraState(new Vector3(0, 0, 0), new Vector3(0, initCameraPos.y, 0), 1); // Overhead Camera + saveCameraState(new Vector3(0, 64, 0), new Vector3(-1, 64, 0), 1); // Side Camera (East) + saveCameraState(new Vector3(0, 64, 0), new Vector3(0, 64, 1), 1); // Side Camera (North) } function onZoomChanged() { @@ -74,8 +70,8 @@ function onZoomChanged() { } export function saveCameraState( - target: THREE.Vector3, - position: THREE.Vector3, + target: Vector3, + position: Vector3, zoom: number, ) { cameraStates.push({ @@ -99,5 +95,5 @@ export function loadCameraState(index: number) { } export function getInitialCameraPosition() { - return new THREE.Vector3(camX, camY, camZ); + return new Vector3(camX, camY, camZ); } diff --git a/src/components/setup/mapScene.ts b/src/components/setup/mapScene.ts index a5f0eca..0da9cf6 100644 --- a/src/components/setup/mapScene.ts +++ b/src/components/setup/mapScene.ts @@ -1,4 +1,10 @@ -import * as THREE from 'three'; +import { + Scene, + Mesh, + AmbientLight, + DirectionalLight, + PlaneGeometry, +} from 'three'; import { createDoor, createPath, @@ -16,20 +22,20 @@ import roomsData from '../../data/rooms'; import doorsData from '../../data/doors'; import portalsData from '../../data/portals'; -export let mapScene: THREE.Scene; -const roomObjects: THREE.Mesh[] = []; -const doorObjects: THREE.Mesh[] = []; -const portalObjects: THREE.Mesh[] = []; -const pathObjects: THREE.Mesh[] = []; +export let mapScene: Scene; +const roomObjects: Mesh[] = []; +const doorObjects: Mesh[] = []; +const portalObjects: Mesh[] = []; +const pathObjects: Mesh[] = []; const labelObjects: CSS2DObject[] = []; export function setupMapScene() { - mapScene = new THREE.Scene(); + mapScene = new Scene(); // Set up lights - const light = new THREE.AmbientLight(0xffffff); // soft white light + const light = new AmbientLight(0xffffff); // soft white light mapScene.add(light); - const directionalLight = new THREE.DirectionalLight(0xffffff, 1); + const directionalLight = new DirectionalLight(0xffffff, 1); directionalLight.position.x = 1; directionalLight.position.y = 1; directionalLight.position.z = 1; @@ -37,8 +43,8 @@ export function setupMapScene() { // Lava if (featureConfig.lavaGeometry) { - const lavaGeom = new THREE.PlaneGeometry(1500, 1500); - const lavaMesh = new THREE.Mesh(lavaGeom, getMaterial('lava')); + const lavaGeom = new PlaneGeometry(1500, 1500); + const lavaMesh = new Mesh(lavaGeom, getMaterial('lava')); lavaMesh.rotation.x = Math.PI / 2; lavaMesh.position.y = 32; mapScene.add(lavaMesh); diff --git a/src/components/setup/materials.ts b/src/components/setup/materials.ts index bdd2ccc..2e802ba 100644 --- a/src/components/setup/materials.ts +++ b/src/components/setup/materials.ts @@ -1,8 +1,8 @@ -import * as THREE from 'three'; +import { type Material, MeshStandardMaterial } from 'three'; import { LineMaterial } from 'three/addons/lines/LineMaterial.js'; import materialDefs from '../../config/materials'; -const materials: Record = {}; +const materials: Record = {}; export function initMaterials() { const { mesh, line } = materialDefs; @@ -10,7 +10,7 @@ export function initMaterials() { // Mesh Materials for (const materialName in mesh) { const materialDef = mesh[materialName]; - materials[materialName] = new THREE.MeshStandardMaterial(materialDef); + materials[materialName] = new MeshStandardMaterial(materialDef); } // Line Materials @@ -30,6 +30,6 @@ export function initMaterials() { } } -export function getMaterial(name: string): THREE.Material { +export function getMaterial(name: string): Material { return materials[name] ?? null; } diff --git a/src/components/setup/renderer.ts b/src/components/setup/renderer.ts index 850dc8c..8c5246f 100644 --- a/src/components/setup/renderer.ts +++ b/src/components/setup/renderer.ts @@ -1,11 +1,11 @@ -import * as THREE from 'three'; +import { WebGLRenderer } from 'three'; import { CSS2DRenderer } from 'three/addons/renderers/CSS2DRenderer.js'; -export let renderer: THREE.WebGLRenderer; +export let renderer: WebGLRenderer; export let labelRenderer: CSS2DRenderer; export function setupRenderers() { - renderer = new THREE.WebGLRenderer(); + renderer = new WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setPixelRatio(window.devicePixelRatio); diff --git a/src/config/materials.ts b/src/config/materials.ts index ef2f7e5..2ee29c9 100644 --- a/src/config/materials.ts +++ b/src/config/materials.ts @@ -1,4 +1,4 @@ -import * as THREE from 'three'; +import { DoubleSide, type MeshStandardMaterialParameters } from 'three'; import { LineMaterialParameters } from 'three/addons/lines/LineMaterial.js'; import { defaultPathProps, simplePathProps } from './pathProps'; @@ -6,7 +6,7 @@ import { defaultPathProps, simplePathProps } from './pathProps'; type LineMaterialDefinitions = Record; export type MaterialDefinitions = { - mesh: Record; + mesh: Record; line: LineMaterialDefinitions; }; @@ -29,7 +29,7 @@ const materials: MaterialDefinitions = { color: 0xffe0c0, opacity: 0.5, transparent: true, - side: THREE.DoubleSide, + side: DoubleSide, }, }, line: (() => { diff --git a/src/main.ts b/src/main.ts index b353445..9237f24 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import * as THREE from 'three'; +import { Raycaster, Vector2 } from 'three'; import { ViewHelper } from 'three/addons/helpers/ViewHelper.js'; import { camera, @@ -21,16 +21,16 @@ import { setupLegend } from './components/objects/legend'; import featureConfig from './config/features.json'; let viewHelper: ViewHelper; -let raycaster: THREE.Raycaster; -let pointer: THREE.Vector2; +let raycaster: Raycaster; +let pointer: Vector2; function setup() { initMaterials(); setupCamera(); setupRenderers(); if (featureConfig.raycasterOn) { - raycaster = new THREE.Raycaster(); - pointer = new THREE.Vector2(); + raycaster = new Raycaster(); + pointer = new Vector2(); } setupMapScene(); From e6b32becf91bc232c5ac40db313bf00d11720bc6 Mon Sep 17 00:00:00 2001 From: "M.S.T.O.P" Date: Mon, 2 Oct 2023 22:26:01 -0400 Subject: [PATCH 2/6] testing vite config --- vite.config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vite.config.js b/vite.config.js index 24cf64f..a59cc81 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,4 +2,10 @@ import { defineConfig } from 'vite'; export default defineConfig({ base: '/mc-3d-path-map/', + resolve: { + alias: { + find: 'three', + replacement: '/node_modules/three/src/Three' + } + } }); From adba105c625cccab5536d95d7e2eeecec6193c90 Mon Sep 17 00:00:00 2001 From: "M.S.T.O.P" Date: Tue, 3 Oct 2023 12:45:18 -0400 Subject: [PATCH 3/6] calculkate map bounds and center camera to map center --- src/components/setup/camera.ts | 42 +++++++++++++------ src/components/setup/mapScene.ts | 71 +++++++++++++++++++++++++++++++- src/style.css | 1 + src/types.ts | 9 ++++ 4 files changed, 109 insertions(+), 14 deletions(-) diff --git a/src/components/setup/camera.ts b/src/components/setup/camera.ts index 9d23925..003d5b7 100644 --- a/src/components/setup/camera.ts +++ b/src/components/setup/camera.ts @@ -1,14 +1,13 @@ import { OrthographicCamera, type WebGLRenderer, Vector3 } from 'three'; import { MapControls } from 'three/addons/controls/MapControls.js'; +import { getMapBounds } from './mapScene'; import { CameraState } from '../../types'; export let camera: OrthographicCamera; export let cameraControls: MapControls; let lastZoom: number; -const camX = -1; -const camY = 1; -const camZ = 1; +let initialCameraPosition: Vector3; export const viewScale = 4; const zoomConst = 0.5133420832795057; // used to calculate the relationship between camera zoom and the scale on the gui const guiScaleSize = 100; @@ -30,10 +29,32 @@ export function setupCamera() { export function setupCameraControls(renderer: WebGLRenderer) { cameraControls = new MapControls(camera, renderer.domElement); cameraControls.enableDamping = false; - camera.position.set(camX, camY, camZ); - camera.lookAt(0, 0, 0); - cameraControls.update(); + + const { center } = getMapBounds(); + initialCameraPosition = new Vector3( + center[0] - 1, + center[1] + 1, + center[2] + 1, + ); lastZoom = 0; + + saveCameraState(new Vector3(...center), initialCameraPosition, 1); // Isometric Camera + saveCameraState( + new Vector3(...center), + new Vector3(center[0], 127, center[2]), + 1, + ); // Overhead Camera + saveCameraState( + new Vector3(center[0], 64, center[2]), + new Vector3(center[0] - 1, 64, center[2]), + 1, + ); // Side Camera (East) + saveCameraState( + new Vector3(center[0], 64, center[2]), + new Vector3(center[0], 64, center[2] + 1), + 1, + ); // Side Camera (North) + scaleNumberElem = document.getElementById('scaleNumber'); if (scaleNumberElem !== null) { @@ -41,12 +62,7 @@ export function setupCameraControls(renderer: WebGLRenderer) { cameraControls.addEventListener('change', onZoomChanged); } - const initCameraPos = getInitialCameraPosition(); - - saveCameraState(new Vector3(0, 0, 0), initCameraPos, 1); // Isometric Camera - saveCameraState(new Vector3(0, 0, 0), new Vector3(0, initCameraPos.y, 0), 1); // Overhead Camera - saveCameraState(new Vector3(0, 64, 0), new Vector3(-1, 64, 0), 1); // Side Camera (East) - saveCameraState(new Vector3(0, 64, 0), new Vector3(0, 64, 1), 1); // Side Camera (North) + loadCameraState(0); } function onZoomChanged() { @@ -95,5 +111,5 @@ export function loadCameraState(index: number) { } export function getInitialCameraPosition() { - return new Vector3(camX, camY, camZ); + return initialCameraPosition; } diff --git a/src/components/setup/mapScene.ts b/src/components/setup/mapScene.ts index 0da9cf6..65c20f9 100644 --- a/src/components/setup/mapScene.ts +++ b/src/components/setup/mapScene.ts @@ -14,7 +14,14 @@ import { import { getMaterial } from './materials'; import { type CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js'; -import { DoorData, PathData, PortalData, RoomData } from '../../types'; +import { + Coordinates, + DoorData, + MapBounds, + PathData, + PortalData, + RoomData, +} from '../../types'; import featureConfig from '../../config/features.json'; import pathsData from '../../data/paths'; @@ -28,6 +35,15 @@ const doorObjects: Mesh[] = []; const portalObjects: Mesh[] = []; const pathObjects: Mesh[] = []; const labelObjects: CSS2DObject[] = []; +const mapBounds: MapBounds = { + center: [0, 64, 0], + xMin: 0, + xMax: 0, + yMin: 64, + yMax: 64, + zMin: 0, + zMax: 0, +}; export function setupMapScene() { mapScene = new Scene(); @@ -65,6 +81,24 @@ export function setupMapScene() { labelObjects.push(roomLabel); } + if (object.shape === 'cuboid') { + const { corners } = object; + checkMapBounds([corners[0][0], corners[1][1], corners[0][2]]); + checkMapBounds([corners[1][0], corners[0][1], corners[1][2]]); + } else if (object.shape === 'cylinder') { + const { radius, height, bottomCenter } = object; + checkMapBounds([ + bottomCenter[0] - radius, + bottomCenter[1], + bottomCenter[2] - radius, + ]); + checkMapBounds([ + bottomCenter[0] + radius, + bottomCenter[1] + height, + bottomCenter[2] + radius, + ]); + } + return incrementId; }); @@ -73,6 +107,12 @@ export function setupMapScene() { if (pathMesh !== null) { pathObjects.push(pathMesh); mapScene.add(pathMesh); + + const { points } = object; + for (const point of points) { + checkMapBounds(point); + } + return true; } return false; @@ -82,6 +122,10 @@ export function setupMapScene() { const doorMesh = createDoor(object, id); doorObjects.push(doorMesh); mapScene.add(doorMesh); + + const { location } = object; + checkMapBounds(location); + return true; }); @@ -90,12 +134,17 @@ export function setupMapScene() { portalObjects.push(portalMesh); mapScene.add(portalMesh); + const { location } = object; + checkMapBounds(location); + if (portalLabel !== null) { labelObjects.push(portalLabel); } return true; }); + + calculateMapCenter(); } function initMapObjects( @@ -110,6 +159,22 @@ function initMapObjects( } } +function checkMapBounds(point: Coordinates) { + if (point[0] < mapBounds.xMin) mapBounds.xMin = point[0]; + if (point[0] > mapBounds.xMax) mapBounds.xMax = point[0]; + if (point[1] < mapBounds.yMin) mapBounds.yMin = point[1]; + if (point[1] > mapBounds.yMax) mapBounds.yMax = point[1]; + if (point[2] < mapBounds.zMin) mapBounds.zMin = point[2]; + if (point[2] > mapBounds.zMax) mapBounds.zMax = point[2]; +} + +function calculateMapCenter() { + const { xMin, yMin, xMax, yMax, zMin, zMax } = mapBounds; + mapBounds.center[0] = (xMin + xMax) / 2; + mapBounds.center[1] = (yMin + yMax) / 2; + mapBounds.center[2] = (zMin + zMax) / 2; +} + export function getMapObjects() { return { roomObjects, @@ -119,3 +184,7 @@ export function getMapObjects() { labelObjects, }; } + +export function getMapBounds() { + return mapBounds; +} diff --git a/src/style.css b/src/style.css index b27c44c..78a99a6 100644 --- a/src/style.css +++ b/src/style.css @@ -1,5 +1,6 @@ body { margin: 0; + background-color: #000; } .portalLabel { diff --git a/src/types.ts b/src/types.ts index 043cabd..146f35c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -14,6 +14,15 @@ export type RoomTypes = 'ugRoom' | 'ogRoom'; export type DoorTypes = 'ex' | 'conn'; export type DoorOrientation = 'x' | 'y' | 'z'; export type Coordinates = [number, number, number]; +export type MapBounds = { + center: Coordinates; + xMin: number; + xMax: number; + yMin: number; + yMax: number; + zMin: number; + zMax: number; +}; export type SceneComponents = { scene: THREE.Scene; From 2c9c5abdc363f0f1b072a468cb2ae2a5d386fdc4 Mon Sep 17 00:00:00 2001 From: "M.S.T.O.P" Date: Tue, 3 Oct 2023 12:57:53 -0400 Subject: [PATCH 4/6] refactor checkMapBounds to reduce array use --- index.html | 2 +- src/components/setup/mapScene.ts | 33 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/index.html b/index.html index 09be0d6..e9f9e4e 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@
- 100 blocks + ? blocks
diff --git a/src/components/setup/mapScene.ts b/src/components/setup/mapScene.ts index 65c20f9..a1666b1 100644 --- a/src/components/setup/mapScene.ts +++ b/src/components/setup/mapScene.ts @@ -15,7 +15,6 @@ import { getMaterial } from './materials'; import { type CSS2DObject } from 'three/addons/renderers/CSS2DRenderer.js'; import { - Coordinates, DoorData, MapBounds, PathData, @@ -83,20 +82,20 @@ export function setupMapScene() { if (object.shape === 'cuboid') { const { corners } = object; - checkMapBounds([corners[0][0], corners[1][1], corners[0][2]]); - checkMapBounds([corners[1][0], corners[0][1], corners[1][2]]); + checkMapBounds(corners[0][0], corners[1][1], corners[0][2]); + checkMapBounds(corners[1][0], corners[0][1], corners[1][2]); } else if (object.shape === 'cylinder') { const { radius, height, bottomCenter } = object; - checkMapBounds([ + checkMapBounds( bottomCenter[0] - radius, bottomCenter[1], bottomCenter[2] - radius, - ]); - checkMapBounds([ + ); + checkMapBounds( bottomCenter[0] + radius, bottomCenter[1] + height, bottomCenter[2] + radius, - ]); + ); } return incrementId; @@ -110,7 +109,7 @@ export function setupMapScene() { const { points } = object; for (const point of points) { - checkMapBounds(point); + checkMapBounds(...point); } return true; @@ -124,7 +123,7 @@ export function setupMapScene() { mapScene.add(doorMesh); const { location } = object; - checkMapBounds(location); + checkMapBounds(...location); return true; }); @@ -135,7 +134,7 @@ export function setupMapScene() { mapScene.add(portalMesh); const { location } = object; - checkMapBounds(location); + checkMapBounds(...location); if (portalLabel !== null) { labelObjects.push(portalLabel); @@ -159,13 +158,13 @@ function initMapObjects( } } -function checkMapBounds(point: Coordinates) { - if (point[0] < mapBounds.xMin) mapBounds.xMin = point[0]; - if (point[0] > mapBounds.xMax) mapBounds.xMax = point[0]; - if (point[1] < mapBounds.yMin) mapBounds.yMin = point[1]; - if (point[1] > mapBounds.yMax) mapBounds.yMax = point[1]; - if (point[2] < mapBounds.zMin) mapBounds.zMin = point[2]; - if (point[2] > mapBounds.zMax) mapBounds.zMax = point[2]; +export function checkMapBounds(x: number, y: number, z: number) { + if (x < mapBounds.xMin) mapBounds.xMin = x; + if (x > mapBounds.xMax) mapBounds.xMax = x; + if (y < mapBounds.yMin) mapBounds.yMin = y; + if (y > mapBounds.yMax) mapBounds.yMax = y; + if (z < mapBounds.zMin) mapBounds.zMin = z; + if (z > mapBounds.zMax) mapBounds.zMax = z; } function calculateMapCenter() { From 5c4d98f991987a1693b56a90645daddfe97d4920 Mon Sep 17 00:00:00 2001 From: "M.S.T.O.P" Date: Tue, 3 Oct 2023 19:37:04 -0400 Subject: [PATCH 5/6] adjust path colours --- src/config/pathProps.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/config/pathProps.ts b/src/config/pathProps.ts index 61f8439..c03eb0b 100644 --- a/src/config/pathProps.ts +++ b/src/config/pathProps.ts @@ -22,19 +22,19 @@ export type SimplePathPropertyDefinitions = Record< export const defaultPathProps: DefaultPathPropertyDefinitions = { ogTunnel: { name: 'Surface Tunnel', - colour: '8090ff', + colour: '6060ff', isExterior: false, isNatural: false, }, ugTunnel: { name: 'Underground Tunnel', - colour: '80b0d0', + colour: '60b0e0', isExterior: false, isNatural: false, }, cBridge: { name: 'Covered Bridge', - colour: '80ff80', + colour: '00ff00', isExterior: false, isNatural: false, }, @@ -68,12 +68,18 @@ export const defaultPathProps: DefaultPathPropertyDefinitions = { isExterior: true, isNatural: true, }, + nFortress: { + name: 'Nether Fortress', + colour: 'd00060', + isExterior: true, + isNatural: true, + }, }; export const simplePathProps: SimplePathPropertyDefinitions = { simpleInterior: { name: 'Interior', - colour: '80b0d0', + colour: '60b0e0', }, simpleExterior: { name: 'Exterior', @@ -85,6 +91,6 @@ export const simplePathProps: SimplePathPropertyDefinitions = { }, simpleArtificial: { name: 'Artificial', - colour: '80ff80', + colour: '00ff00', }, }; From 48f1a8a3d3eb932477d9457b0d60be01337ec26f Mon Sep 17 00:00:00 2001 From: "M.S.T.O.P" Date: Tue, 3 Oct 2023 19:43:04 -0400 Subject: [PATCH 6/6] remove resolve from vite config --- vite.config.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/vite.config.js b/vite.config.js index a59cc81..ab1e3fe 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,11 +1,5 @@ import { defineConfig } from 'vite'; export default defineConfig({ - base: '/mc-3d-path-map/', - resolve: { - alias: { - find: 'three', - replacement: '/node_modules/three/src/Three' - } - } + base: '/mc-3d-path-map/' });