Pārlūkot izejas kodu

Fixed position of cubes emission in daydream/gearvr examples.

Mr.doob 7 gadi atpakaļ
vecāks
revīzija
64ec761a56
2 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  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;