c-frame / aframe-stereo-component

aframe.io component to enable separate eye rendering of objects, plus stereo video rendering (full 360 or half dome)
https://c-frame.github.io/aframe-stereo-component/
MIT License
137 stars 52 forks source link

- Added playOnClick to stereo_component's schema #25

Closed realitylab-ruben closed 6 years ago

realitylab-ruben commented 6 years ago

For a project I'm working on, the feature to automatically add a click event to the canvas was causing me some issues, because the video needed to be paused and played according to the project's parameters. So I forked the code and added a parameter to the stereo component to make it optional.

Thought you might be interested as well. Personally, I do think that this setting should actually be placed in a system, but I'd first like to hear some feedback before doing any further work on it :)

oscarmarinmiro commented 6 years ago

Thanks! Makes 100% sense :)

About putting it in a system, do not really know, is it because the flag is doing things 'outside' the component?

realitylab-ruben commented 6 years ago

Well, it's more that I now have to define playOnClick: false on every stereo component that I have in a scene.

Technically, I think it makes more sense if I could set this parameter on an a-scene level, because you most likely want to use this behaviour on all stereo components. So all I'd have to do is set <a-scene stereo="playOnClick: false">, instead of having to set the parameter for each and every component in the scene.

I may have some time this evening to expand a bit on the subject. I'll create PR, so you can have a look at it.

oscarmarinmiro commented 6 years ago

ah, sounds great! didn't know you could do that with systems :)

realitylab-ruben commented 6 years ago

https://aframe.io/docs/0.7.0/core/systems.html

Have to admit that I only started using them at the end of last year. They're essentially like services in other frameworks. Really handy.