From b9fa48c1cf3c3bd66668f8f3923bf3261998ebae Mon Sep 17 00:00:00 2001 From: linbingquan <695601626@qq.com> Date: Sun, 2 Jan 2022 20:21:45 +0800 Subject: [PATCH] Examples: Clean up. --- examples/games_fps.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/games_fps.html b/examples/games_fps.html index bc3736f63b86dd..bac4ddb39dd808 100644 --- a/examples/games_fps.html +++ b/examples/games_fps.html @@ -422,14 +422,18 @@ } ); - function teleportPlayerIfOob(){ - if (camera.position.y <= -25){ + function teleportPlayerIfOob() { + + if ( camera.position.y <= - 25 ) { + playerCollider.start.set( 0, 0.35, 0 ); playerCollider.end.set( 0, 1, 0 ); - playerCollider.radius = 0.35; + playerCollider.radius = 0.35; camera.position.copy( playerCollider.end ); camera.rotation.set( 0, 0, 0 ); + } + }