Three.js SceneUtils has no traverseHierarchy!!! where is it?
three.js, updates, webgl
Solution
You should replace `scene.traverse(scene, function (child) {` by `scene.traverse(function (child) {` (I could not add a comment, so I created an answer instead).
Problem
I had not updated the three.js library in my system. Today, I updated the three.js file. But I encountered this error: "Uncaught TypeError: Object # has no method 'traverseHierarchy' ". I had used it for detecting intersection: Online code is here: https://dl.dropbox.com/u/44791710/test/simple2.html ``` function Intersect(event) { event.preventDefault(); var mousex = (event.clientX / window.innerWidth) * 2 - 1; var mousey = -(event.clientY / window.innerHeight) * 2 + 1; var vector = new THREE.Vector3(mousex, mousey, 1); var toIntersect = []; THREE.SceneUtils.traverseHierarchy(scene, function (child) { if (child instanceof THREE.Mesh) { toIntersect.push(child); } }); var projector = new THREE.Projector(); projector.unprojectVector(vector, camera); var ray = new THREE.Raycaster(camera.position,vector.sub(camera.position).normalize()); var intersects = ray.intersectObjects(toIntersect); if (intersects.length > 0) { for (var j = 0; j < intersects.length ; j++){ target = intersects[j].object; console.log('Intersects at ' + mouse.x + '/' + mouse.y + ':'); for(var i = 0, m = intersects.length; i<m; i++){ console.log(intersects[i].object.id, intersects[i]); } } } } ``` what kind of changes I need to do? Thanks.