Explorar o código

Fixed position of cubes emission in daydream/gearvr examples.

Mr.doob %!s(int64=7) %!d(string=hai) anos
pai
achega
64ec761a56
Modificáronse 2 ficheiros con 2 adicións e 2 borrados
  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;