fix mal de mer
This commit is contained in:
parent
cdadb7d42e
commit
1196e896e3
14
main.js
14
main.js
@ -471,9 +471,12 @@ document.addEventListener('keyup', (event) => {
|
||||
|
||||
function playerCollisions() {
|
||||
|
||||
if (!escaped && raftOctree.capsuleIntersect(playerCollider)) {
|
||||
if (raftOctree.capsuleIntersect(playerCollider)) {
|
||||
|
||||
gameEnd()
|
||||
|
||||
camera.position.y = raft.position.y + 0.9;
|
||||
|
||||
if (!escaped) gameEnd()
|
||||
|
||||
}
|
||||
|
||||
@ -696,6 +699,9 @@ function animate() {
|
||||
const delta = Math.min(0.05, clock.getDelta())
|
||||
const deltaTime = delta / STEPS_PER_FRAME;
|
||||
|
||||
ocean.material.uniforms['time'].value += delta;
|
||||
updateRaft(delta);
|
||||
|
||||
// we look for collisions in substeps to mitigate the risk of
|
||||
// an object traversing another too quickly for detection.
|
||||
|
||||
@ -712,10 +718,6 @@ function animate() {
|
||||
if (camera.position.y > 3.5)
|
||||
camera.lookAt(raft.position.x, raft.position.y, raft.position.z);
|
||||
|
||||
ocean.material.uniforms['time'].value += delta;
|
||||
updateRaft(delta);
|
||||
if (escaped) camera.position.y = raft.position.y + 0.9;
|
||||
|
||||
renderer.render(scene, camera);
|
||||
|
||||
if (showStats) stats.update();
|
||||
|
Loading…
x
Reference in New Issue
Block a user