2
0
Эх сурвалжийг харах

Fixed position of cubes emission in daydream/gearvr examples.

Mr.doob 7 жил өмнө
parent
commit
64ec761a56

+ 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;