resolves #17
This commit is contained in:
@@ -144,13 +144,18 @@ class MazeObject {
|
|||||||
o[e].scale.set(scale, scale, scale)
|
o[e].scale.set(scale, scale, scale)
|
||||||
});
|
});
|
||||||
this.mazeObject(def, room);
|
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({
|
const floor = new Mesh(floorGeometry,new MeshStandardMaterial({
|
||||||
roughness: 0, metalness:1, color: 0x00ffff, side: DoubleSide
|
roughness: 0, metalness:1, color: 0x00ffff, side: DoubleSide
|
||||||
}))
|
}))
|
||||||
floor.rotation.set(Math.PI/2, 0, 0)
|
floor.rotation.set(Math.PI/2, 0, 0)
|
||||||
floor.position.set((bbox.l + bbox.r)/2, 0, bbox.f/2);
|
floor.position.set((bbox.l + bbox.r)/2, 0, bbox.f/2);
|
||||||
root.add(floor);
|
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
|
engine.hero.animationsMap.idle = engine.hero.animationsMap.win
|
||||||
}
|
}
|
||||||
await Utils.wait(1000);
|
await Utils.wait(1000);
|
||||||
engine.hero.characterControls.cameraDelta = Math.PI;
|
engine.hero.cameraDelta = Math.PI;
|
||||||
engine.hero.characterControls.direction += Math.PI;
|
engine.hero.direction += Math.PI;
|
||||||
//engine.hero.model.rotation.y += Math.PI;
|
//engine.hero.model.rotation.y += Math.PI;
|
||||||
await Utils.wait(10000);
|
await Utils.wait(10000);
|
||||||
this.dispatchEvent({type:'finish'})
|
this.dispatchEvent({type:'finish'})
|
||||||
}else{
|
}else{
|
||||||
engine.hero.animationsMap.idle = engine.hero.animationsMap._idle
|
engine.hero.animationsMap.idle = engine.hero.animationsMap._idle
|
||||||
engine.hero.characterControls.cameraDelta = 0
|
engine.hero.cameraDelta = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ud.qid !== undefined && e.started){
|
if (ud.qid !== undefined && e.started){
|
||||||
|
|||||||
Reference in New Issue
Block a user