oscarmarinmiro / aframe-video-controls

AFrame component to control (play/pause/jump) videos.
https://oscarmarinmiro.github.io/aframe-video-controls/
MIT License
55 stars 24 forks source link

Use intersection data rather than querySelector for `<a-cursor>` #11

Open ngokevin opened 8 years ago

ngokevin commented 8 years ago

On master branch of A-Frame that is about to release, on the cursor click event, you can do evt.detail.intersection to get UV coords.

oscarmarinmiro commented 8 years ago

That will be amazing :) Any idea of the release date so I can quickly make the change without dealing with official code?

oscarmarinmiro commented 7 years ago

Tried this, but this example code:

` document.querySelector('a-cursor').addEventListener("click", function(event){

    console.log("CURSOR CLICK");

    console.log(event);

});`

spits the attached output (no 'intersection' property). Any ideas?

screen shot 2016-11-01 at 21 43 42

ngokevin commented 7 years ago

I think right now, you have to listen from the intersected entity, rather than from the cursor.

The dev builds of A-Frame support listening on either right now.