microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

Intended way to implement the GazeStabilizer #232

Closed christjt closed 7 years ago

christjt commented 7 years ago

I am facing an issue with the intended method to implement the gaze stabilizer in conjunction with the gaze manager in the current HoloToolkit. As of now, the gaze stabilizer exposes a simple UpdateHeadStability method that should be called to fetch a stable head position, however, I feel that the most applicable place to use this function is in the Update function of the gaze manager. I do not appreciate implementing at this location as this would mean changing the HoloToolKit for my personal usage and may cause future issues when updating the HoloToolKit.

This bottles down to a larger issue which is extending certain classes within the HoloToolKit scripts. I feel we went the correct direction when the managers were made partial, but it does not however, give an intuitive way to tap into certain cruicial functions such as the Update function. Would it not be easier to extend the HoloToolKit using inheritance versus making things partial?

StephenHodgson commented 7 years ago

I actually had the same issues and rewrote that class to do exactly that as well, haha. I chose to get rid of the partial class in my implementation, but not particularly for inheritance. I've went ahead and addressed this in pull request https://github.com/Microsoft/HoloToolkit-Unity/pull/234. Let me know what you think.

Also, I changed the raycast utilize the stabilized head ray and position for it's calculations.