Browse Source

Refactor collision function

Fernando Serrano 5 years ago
parent
commit
dee2d15923
1 changed files with 7 additions and 1 deletions
  1. 7 1
      examples/webxr_vr_haptics.html

+ 7 - 1
examples/webxr_vr_haptics.html

@@ -215,7 +215,7 @@
 
 
 			}
 			}
 
 
-			function render() {
+			function handleCollisions() {
 
 
 				for ( var g = 0; g < controllers.length; g ++ ) {
 				for ( var g = 0; g < controllers.length; g ++ ) {
 
 
@@ -275,6 +275,12 @@
 
 
 				}
 				}
 
 
+			}
+
+			function render() {
+
+				handleCollisions();
+
 				renderer.render( scene, camera );
 				renderer.render( scene, camera );
 
 
 			}
 			}