From c4182d5024b0b57e65f0ae6ec4356c6faf4b0bb3 Mon Sep 17 00:00:00 2001 From: goynov Date: Fri, 21 Nov 2025 17:29:39 +0200 Subject: [PATCH] resolves #17 --- .../InteractiveObjects/MazeQuizGame/MazeObject.js | 7 ++++++- .../InteractiveObjects/MazeQuizGame/MazeQuizGame.js | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/InteractiveObjects/MazeQuizGame/MazeObject.js b/src/components/InteractiveObjects/MazeQuizGame/MazeObject.js index d17b216..6c434e9 100644 --- a/src/components/InteractiveObjects/MazeQuizGame/MazeObject.js +++ b/src/components/InteractiveObjects/MazeQuizGame/MazeObject.js @@ -144,13 +144,18 @@ class MazeObject { o[e].scale.set(scale, scale, scale) }); this.mazeObject(def, room); - const floorGeometry = new PlaneGeometry(bbox.r - bbox.l + 10*scale, bbox.f + 10*scale); + + let floorSize = { width: (bbox.r - bbox.l + 10*scale)/2, height: 0.01, depth: (bbox.f + 10*scale)/2 } + const floorGeometry = new PlaneGeometry(floorSize.width*2, floorSize.depth*2); const floor = new Mesh(floorGeometry,new MeshStandardMaterial({ roughness: 0, metalness:1, color: 0x00ffff, side: DoubleSide })) floor.rotation.set(Math.PI/2, 0, 0) floor.position.set((bbox.l + bbox.r)/2, 0, bbox.f/2); root.add(floor); + let pf = engine.physics.add({position: floor.position}, 'fixed', false, undefined, 'cuboid', floorSize) + //pf.collider.setRestitution(0); + //pf.collider.setTranslationWrtParent({x:0, y: -100, z:0}) } } } diff --git a/src/components/InteractiveObjects/MazeQuizGame/MazeQuizGame.js b/src/components/InteractiveObjects/MazeQuizGame/MazeQuizGame.js index a7ee3bd..606d637 100644 --- a/src/components/InteractiveObjects/MazeQuizGame/MazeQuizGame.js +++ b/src/components/InteractiveObjects/MazeQuizGame/MazeQuizGame.js @@ -58,14 +58,14 @@ class MazeQuizGame extends EventDispatcher { engine.hero.animationsMap.idle = engine.hero.animationsMap.win } await Utils.wait(1000); - engine.hero.characterControls.cameraDelta = Math.PI; - engine.hero.characterControls.direction += Math.PI; + engine.hero.cameraDelta = Math.PI; + engine.hero.direction += Math.PI; //engine.hero.model.rotation.y += Math.PI; await Utils.wait(10000); this.dispatchEvent({type:'finish'}) }else{ engine.hero.animationsMap.idle = engine.hero.animationsMap._idle - engine.hero.characterControls.cameraDelta = 0 + engine.hero.cameraDelta = 0 } } if (ud.qid !== undefined && e.started){