Browse Source

use set instead of new

Joe 3 years ago
parent
commit
4021e68a37
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/games_fps.html

+ 2 - 2
examples/games_fps.html

@@ -424,8 +424,8 @@
 
 
 			function teleportPlayerIfOob(){
 			function teleportPlayerIfOob(){
 				if (camera.position.y <= -25){
 				if (camera.position.y <= -25){
-					playerCollider.start = new THREE.Vector3( 0, 0.35, 0 );
-					playerCollider.end = new THREE.Vector3( 0, 1, 0 );
+					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.position.copy( playerCollider.end );
 				}
 				}