fix PointerLockControls erratic behaviour

This commit is contained in:
2025-11-30 11:44:18 +02:00
parent 07ce5bc2af
commit f7d6244fa5
3 changed files with 9 additions and 9 deletions
+6 -6
View File
@@ -1,12 +1,12 @@
{ {
"name": "pronature-platform", "name": "pronature-platform",
"version": "0.2.0", "version": "0.7.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "pronature-platform", "name": "pronature-platform",
"version": "0.2.0", "version": "0.7.0",
"dependencies": { "dependencies": {
"@mdi/font": "7.4.47", "@mdi/font": "7.4.47",
"@vitejs/plugin-basic-ssl": "^1.1.0", "@vitejs/plugin-basic-ssl": "^1.1.0",
@@ -24,7 +24,6 @@
"mongodb": "^6.10.0", "mongodb": "^6.10.0",
"roboto-fontface": "*", "roboto-fontface": "*",
"sharp": "^0.33.5", "sharp": "^0.33.5",
"three": "^0.169.0",
"three-viewport-gizmo": "^2.2.0", "three-viewport-gizmo": "^2.2.0",
"uuid": "^11.0.2", "uuid": "^11.0.2",
"vue": "^3.5.13", "vue": "^3.5.13",
@@ -43,6 +42,7 @@
"eslint-plugin-vue": "^9.27.0", "eslint-plugin-vue": "^9.27.0",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"sass": "1.77.6", "sass": "1.77.6",
"three": "^0.181.2",
"troika-three-text": "^0.52.4", "troika-three-text": "^0.52.4",
"unplugin-auto-import": "^0.17.6", "unplugin-auto-import": "^0.17.6",
"unplugin-fonts": "^1.1.1", "unplugin-fonts": "^1.1.1",
@@ -7169,9 +7169,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/three": { "node_modules/three": {
"version": "0.169.0", "version": "0.181.2",
"resolved": "https://registry.npmjs.org/three/-/three-0.169.0.tgz", "resolved": "https://registry.npmjs.org/three/-/three-0.181.2.tgz",
"integrity": "sha512-Ed906MA3dR4TS5riErd4QBsRGPcx+HBDX2O5yYE5GqJeFQTPU+M56Va/f/Oph9X7uZo3W3o4l2ZhBZ6f6qUv0w==", "integrity": "sha512-k/CjiZ80bYss6Qs7/ex1TBlPD11whT9oKfT8oTGiHa34W4JRd1NiH/Tr1DbHWQ2/vMUypxksLnF2CfmlmM5XFQ==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/three-viewport-gizmo": { "node_modules/three-viewport-gizmo": {
+1 -1
View File
@@ -26,7 +26,6 @@
"mongodb": "^6.10.0", "mongodb": "^6.10.0",
"roboto-fontface": "*", "roboto-fontface": "*",
"sharp": "^0.33.5", "sharp": "^0.33.5",
"three": "^0.169.0",
"three-viewport-gizmo": "^2.2.0", "three-viewport-gizmo": "^2.2.0",
"uuid": "^11.0.2", "uuid": "^11.0.2",
"vue": "^3.5.13", "vue": "^3.5.13",
@@ -45,6 +44,7 @@
"eslint-plugin-vue": "^9.27.0", "eslint-plugin-vue": "^9.27.0",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"sass": "1.77.6", "sass": "1.77.6",
"three": "^0.181.2",
"troika-three-text": "^0.52.4", "troika-three-text": "^0.52.4",
"unplugin-auto-import": "^0.17.6", "unplugin-auto-import": "^0.17.6",
"unplugin-fonts": "^1.1.1", "unplugin-fonts": "^1.1.1",
+2 -2
View File
@@ -87,7 +87,7 @@ class Hero{
} }
lockControls(){ lockControls(){
this.pointerControls.controls.lock(); this.pointerControls.controls.lock(true);
} }
update(delta){ update(delta){
@@ -107,7 +107,7 @@ class Hero{
let pc = this.pointerControls; let pc = this.pointerControls;
if (pc.controls.isLocked && this.model.visible){ if (pc.controls.isLocked && this.model.visible){
this.model.visible = false; this.model.visible = false;
this.camera.rotation.reorder('YXZ'); this.camera.rotation.reorder('YZX');
} }
if (!pc.controls.isLocked && !this.model.visible){ if (!pc.controls.isLocked && !this.model.visible){
this.model.visible = true; this.model.visible = true;