This commit is contained in:
2025-11-21 17:29:39 +02:00
parent 65c3eabc56
commit c4182d5024
2 changed files with 9 additions and 4 deletions
@@ -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})
}
}
}
@@ -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){