Browse Source

Decals: More robust moved code.

Mr.doob 11 years ago
parent
commit
1e8728682f
2 changed files with 10 additions and 4 deletions
  1. 1 1
      examples/index.html
  2. 9 3
      examples/webgl_decals.html

+ 1 - 1
examples/index.html

@@ -113,7 +113,6 @@
 				"webgl_buffergeometry_particles",
 				"webgl_buffergeometry_rawshader",
 				"webgl_buffergeometry_uint",
-				"webgl_decals",
 				"webgl_camera",
 				"webgl_camera_logarithmicdepthbuffer",
 				"webgl_custom_attributes",
@@ -121,6 +120,7 @@
 				"webgl_custom_attributes_particles",
 				"webgl_custom_attributes_particles2",
 				"webgl_custom_attributes_particles3",
+				"webgl_decals",
 				"webgl_effects_anaglyph",
 				"webgl_effects_oculusrift",
 				"webgl_effects_parallaxbarrier",

+ 9 - 3
examples/webgl_decals.html

@@ -153,16 +153,22 @@ function init() {
 	var moved = false;
 
 	controls.addEventListener( 'change', function() {
+
 		moved = true;
+
 	} );
 
-	controls.addEventListener( 'start', function() {
+	window.addEventListener( 'mousedown', function () {
+
 		moved = false;
-	} );
+	
+	}, false );
+
+	window.addEventListener( 'mouseup', function() {
 
-	controls.addEventListener( 'end', function() {
 		checkIntersection();
 		if( !moved ) shoot();
+
 	} );
 
     window.addEventListener( 'mousemove', onTouchMove );