Closed zachkinstner closed 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.
Also, agreed that this information could be exposed more directly. Maybe this (and other) overall information could be obtained via functions in HovercastSetup
.
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.
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.
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
:
IsMenuInputAvailable
: when true, the menu hand/input is currently in the sceneMenuDisplayStrength
: when greater than 0, the menu is visible, when equal to 1, the menu is at full visibility. For Leap Motion input, this value is determined by the palm-toward-eye orientation.IsMenuVisible
: convenience function; when true, it means that IsMenuInputAvailable
is true and that MenuDisplayStrength
is greater than 0.
@squakmix wrote: