MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

HoverOffsetYScale on AppBar doesn't do anything

Open BenWoodford opened this issue 8 years ago • 4 comments

Does this affect the legacy HoloToolkit (master) or the Mixed Reality Toolkit (mrtk_release)? HoloToolkit

Describe the bug It's not referenced anywhere in the code it seems, at least not in 2017.4.2.0. Changing it has no effect on the AppBar

To Reproduce Change the HoverOffsetYScale on the AppBar - the example should work for this I assume.

Expected behavior Not sure what is meant to happen with it but I assume the Y coordinate on the bar should change to an extent?

Actual behavior Nothing

BenWoodford avatar Oct 24 '18 14:10 BenWoodford

Closing older HTK issue as we are no longer actively working on HTK.

Please upgrade to MRTK V2 for the latest fixes.

Yoyozilla avatar Jun 07 '19 05:06 Yoyozilla

In MRTK RC2.1 the bug is still there. Please check https://github.com/microsoft/MixedRealityToolkit-Unity/blob/mrtk_release/Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/AppBar/AppBar.cs You will see HoverOffsetYScale is not used in the code.

FlorianJa avatar Jun 26 '19 11:06 FlorianJa

I just ran into this issue myself, and can confirm that it is still present in MRTK RC2.1. HoverOffsetYScale is exposed as a property, but is not actually used anywhere in AppBar.cs to determine the position of the AppBar. It appears that this was introduced during the rework done in #2212.

Please consider reopening this issue.

kwmeyer avatar Aug 08 '19 20:08 kwmeyer

I couldn't resist playing around with this a bit, and I found a solution that at least works for me. Not sure how it worked in HTK before, but here's what I did. In AppBar.cs, add this after the line where the final position is calculated:

finalPosition += (helper.GetFaceCentroid(followingFaceIndex) - helper.GetFaceBottomCentroid(followingFaceIndex)).normalized * hoverOffsetYScale;

This basically finds the upwards direction along the following face, scales it by the aforementioned property, then adds it to the app bar's final position.

kwmeyer avatar Aug 16 '19 16:08 kwmeyer