From d4512f8ca1c171bd0af87f68e3dee242e711ed89 Mon Sep 17 00:00:00 2001 From: Yoshiki Ohshima Date: Thu, 7 Sep 2023 12:28:46 -0700 Subject: [PATCH] use library 0.7.8 --- index.html | 2 +- lib/{index-bcc3336e.js => index-d42aa9b0.js} | 17 +++++++++++++---- meta/version.txt | 2 +- package-lock.json | 8 ++++---- package.json | 2 +- 5 files changed, 20 insertions(+), 11 deletions(-) rename lib/{index-bcc3336e.js => index-d42aa9b0.js} (99%) diff --git a/index.html b/index.html index 90c5a06..48f2dd3 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ Microverse - + diff --git a/lib/index-bcc3336e.js b/lib/index-d42aa9b0.js similarity index 99% rename from lib/index-bcc3336e.js rename to lib/index-d42aa9b0.js index 751eb11..58e12b6 100644 --- a/lib/index-bcc3336e.js +++ b/lib/index-d42aa9b0.js @@ -8930,8 +8930,15 @@ const PM_ThreeCamera = superclass => class extends (0,_worldcore__WEBPACK_IMPORT render.camera.matrixWorldNeedsUpdate = true; } - setRaycastFrom2D(xy) { + setRaycastFrom2D(eventXY) { + // eventXY is now from offsetX and offsetY of the DOM event. const render = this.service("ThreeRenderManager"); + let xy = [...eventXY]; + if (render.useDevicePixelRatio) { + xy[0] *= window.devicePixelRatio; + xy[1] *= window.devicePixelRatio; + } + const x = ( xy[0] / render.canvas.width ) * 2 - 1; const y = - ( xy[1] / render.canvas.height) * 2 + 1; if (!this.raycaster) this.raycaster = new THREE.Raycaster(); @@ -9275,6 +9282,7 @@ class ThreeRenderManager extends _worldcore__WEBPACK_IMPORTED_MODULE_0__.RenderM // this.renderer.outputColorSpace = THREE.LinearSRGBColorSpace; this.renderer.toneMappingExposure = 1.4; + this.useDevicePixelRatio = !!options.useDevicePixelRatio; if (options.useDevicePixelRatio) { this.renderer.setPixelRatio(window.devicePixelRatio); this.listenOnDevicePixelRatio(); @@ -11066,10 +11074,11 @@ class AvatarActor extends (0,_worldcore__WEBPACK_IMPORTED_MODULE_0__.mix)(_card_ addSticky(pe) { if (!this.behaviorManager.hasBehavior("StickyNote")) {return;} + if (!pe.xyz) {return;} const tackOffset = 0.1; - let tackPoint = (0,_worldcore__WEBPACK_IMPORTED_MODULE_0__.v3_add)(pe.xyz, (0,_worldcore__WEBPACK_IMPORTED_MODULE_0__.v3_scale)(pe.normal, tackOffset)); - let normal = [...pe.normal]; // clear up and down - normal[1] = 0; + let normal = pe.normal || [0, 0, 1]; + let tackPoint = (0,_worldcore__WEBPACK_IMPORTED_MODULE_0__.v3_add)(pe.xyz, (0,_worldcore__WEBPACK_IMPORTED_MODULE_0__.v3_scale)(normal, tackOffset)); + normal = [normal[0], 0, normal[2]]; // clear up and down let nsq = (0,_worldcore__WEBPACK_IMPORTED_MODULE_0__.v3_sqrMag)(normal); let rotation; if (nsq > 0.0001) { diff --git a/meta/version.txt b/meta/version.txt index 82d9f69..8d4c3c4 100644 --- a/meta/version.txt +++ b/meta/version.txt @@ -1 +1 @@ -commit: ae0c614f57c1bf578c1b807f26080dbb5445b86e Date: Fri Sep 1 13:19:23 2023 -0700 +commit: a3e176311e950065755e7ea14f7151e04ade16e8 Date: Wed Sep 6 16:12:40 2023 -0700 diff --git a/package-lock.json b/package-lock.json index d806aca..d873f64 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "croquet-microverse-gallery-world", "version": "1.0.0", "dependencies": { - "@croquet/microverse-library": "^0.7.7" + "@croquet/microverse-library": "^0.7.8" }, "devDependencies": { "@croquet/microverse-file-server": "^1.0.7", @@ -27,9 +27,9 @@ } }, "node_modules/@croquet/microverse-library": { - "version": "0.7.7", - "resolved": "https://registry.npmjs.org/@croquet/microverse-library/-/microverse-library-0.7.7.tgz", - "integrity": "sha512-3Vjqvn5LQRA3uUe3680CMRSqQF4d8ptcbFU2Q2z3tvieffjBNwFqMU5VWndHKuM8PErCOjiHsdU3t/d3X1US2g==", + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/@croquet/microverse-library/-/microverse-library-0.7.8.tgz", + "integrity": "sha512-XbMwr27HZwLH+HinlR/J/d2kJKBL7giMQc56YVpvMJW9qJRAU5/D8bgqJIesKX4ju/SnyWoqR3EUBgQsYb/8+w==", "hasInstallScript": true }, "node_modules/@croquet/microverse-watch-server": { diff --git a/package.json b/package.json index bbf300c..4d10966 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "watch-server": "watch-server" }, "dependencies": { - "@croquet/microverse-library": "^0.7.7" + "@croquet/microverse-library": "^0.7.8" }, "devDependencies": { "@croquet/microverse-file-server": "^1.0.7",