aestheticinteractive / Hover-UI-Kit

Create beautiful user interfaces for immersive VR/AR experiences.
Other
791 stars 162 forks source link

Expose more menu/cursor information #12

Closed zachkinstner closed 9 years ago

zachkinstner commented 9 years ago

@squakmix wrote:

I wanted to disable drawing while the Hovercast menu is visible, and I found that the most straightforward way to do that was to add a method to the HovercastLeapInputProvider that returned the IsActive value of the vMenu. Maybe consider including that method to get the active state of the menu by default in the HovercastLeapInputProvider.

zachkinstner commented 9 years ago

You can currently get at this information via LeapInputMenu.DisplayStrength. This property is required by the IInputMenu interface, so all input modules will support it. This value essentially represents the menu's opacity -- any non-zero values means that the menu is available.

The IsActive value that you're using looks like it's true whenever the menu-hand is present, even in cases where the menu is completely transparent. This might be a bug -- the menu should probably have IsActive == false whenever DisplayStrength == 0. I can investigate.

zachkinstner commented 9 years ago

Also, agreed that this information could be exposed more directly. Maybe this (and other) overall information could be obtained via functions in HovercastSetup.

squakmix commented 9 years ago

My "getMenuActive" function for the HovercastLeapInputProvider is now "return !vSideL.Menu.DisplayStrength.Equals(0) || !vSideR.Menu.DisplayStrength.Equals(0);" This avoids the issues you pointed out with the menu hand in view while the menu is hidden and allows left-handed mode to function properly as well.

I agree that ideally "IsActive" should be false when the DisplayStrength is 0 as well.

zachkinstner commented 9 years ago

I have added a HovercastSetup.State property, which provides an IHovercastState object.

This exposes information about the menu and cursor state, their Transform data, the current menu items, and the "providers" that you linked to Hovercast. Please let me know if there is anything else you'd like to see included here. Note that you can also access lots of navigation data and events via the NavigationProvider property.

zachkinstner commented 9 years ago

The IsActive value that you're using looks like it's true whenever the menu-hand is present, even in cases where the menu is completely transparent.

This is the expected behavior for the input modules. I have renamed this to a more descriptive IsAvailable, to describe that the hand (input) for that left/right side is currently available in the scene. The DisplayStrength value is then used to determine if the menu is visible.

There are three related properties in IHovercastState: