Răsfoiți Sursa

Fixed position of cubes emission in daydream/gearvr examples.

Mr.doob 7 ani în urmă
părinte
comite
64ec761a56
2 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 1 1
      examples/webvr_daydream.html
  2. 1 1
      examples/webvr_gearvr.html

+ 1 - 1
examples/webvr_daydream.html

@@ -172,7 +172,7 @@
 					var cube = room.children[ 0 ];
 					room.remove( cube );
 
-					cube.position.copy( controller.position );
+					cube.position.copy( controller.position ).sub( room.position );
 					cube.userData.velocity.x = ( Math.random() - 0.5 ) * 0.02 * delta;
 					cube.userData.velocity.y = ( Math.random() - 0.5 ) * 0.02 * delta;
 					cube.userData.velocity.z = ( Math.random() * 0.01 - 0.05 ) * delta;

+ 1 - 1
examples/webvr_gearvr.html

@@ -180,7 +180,7 @@
 					var cube = room.children[ 0 ];
 					room.remove( cube );
 
-					cube.position.copy( controller.position );
+					cube.position.copy( controller.position ).sub( room.position );
 					cube.userData.velocity.x = ( Math.random() - 0.5 ) * 0.02 * delta;
 					cube.userData.velocity.y = ( Math.random() - 0.5 ) * 0.02 * delta;
 					cube.userData.velocity.z = ( Math.random() * 0.01 - 0.05 ) * delta;