{"action":"opened","issue":{"url":"https://api.github.com/repos/aframevr/aframe-core/issues/797","repository_url":"https://api.github.com/repos/aframevr/aframe-core","labels_url":"https://api.github.com/repos/aframevr/aframe-core/issues/797/labels{/name}","comments_url":"https://api.github.com/repos/aframevr/aframe-core/issues/797/comments","events_url":"https://api.github.com/repos/aframevr/aframe-core/issues/797/events","html_url":"https://github.com/aframevr/aframe-core/issues/797","id":137107225,"number":797,"title":"Raycaster does not intersect with .obj meshes","user":{"login":"drryanjames","id":2764891,"avatar_url":"https://avatars.githubusercontent.com/u/2764891?v=3","gravatar_id":"","url":"https://api.github.com/users/drryanjames","html_url":"https://github.com/drryanjames","followers_url":"https://api.github.com/users/drryanjames/followers","following_url":"https://api.github.com/users/drryanjames/following{/other_user}","gists_url":"https://api.github.com/users/drryanjames/gists{/gist_id}","starred_url":"https://api.github.com/users/drryanjames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drryanjames/subscriptions","organizations_url":"https://api.github.com/users/drryanjames/orgs","repos_url":"https://api.github.com/users/drryanjames/repos","events_url":"https://api.github.com/users/drryanjames/events{/privacy}","received_events_url":"https://api.github.com/users/drryanjames/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-28T22:52:45Z","updated_at":"2016-02-28T22:52:45Z","closed_at":null,"body":"### Repo Steps\r\n1) Create a scene with an obj mesh\r\n```html\r\n...\r\n<a-model src=loader=\"src: url(...); format: obj\"></a-model>\r\n...\r\n```\r\n2) Hover over the obj mesh with the cursor\r\n\r\n\r\n### Actual Behavior\r\nThe cursor does not intersect with the obj mesh (i.e. cursor.onIntersection is not called)\r\n\r\n\r\n### Expected Behavior\r\nThe cursor intersects with the obj mesh (i.e. cursor.onIntersection is called)\r\n\r\n\r\n### More Details\r\nWhen I use the cursor to hover over an .obj mesh the cursor does not detect an intersection. The cursor relies on its raycaster to detect intersections in raycaster.getClosestIntersected, which only detects intersections on objects with the el property defined.\r\n\r\n`if (intersectedObj.object.el === undefined) { continue; }`\r\n\r\nThe problem in this issues seems to reside loader.js. After an object is loaded, child meshes are not assigned the el property, so raycaster.getClosestIntersected does not detect an intersection\r\n\r\nOn my local machine, assigning each child mesh the el property in loader.applyMaterial seems to resolve the issue.\r\n\r\n```javascript\r\napplyMaterial: function () {\r\n    var el = this.el;\r\n    var material = this.el.components.material.material;\r\n    if (!this.model) { return; }\r\n    this.model.traverse(function (child) {\r\n      if (child instanceof THREE.Mesh) {\r\n        child.material = material;\r\n\r\n        // Objects are not detected by the raycaster because\r\n        // the intersected mesh does not define the el property (see getClosestIntersected)\r\n        // Add the el property to each child mesh so the raycaster detects its intersection\r\n        child.el = el;\r\n      }\r\n    });\r\n  },\r\n```\r\n\r\nIs the original behavior expected? Is this the right fix?"}}