Cursor disappears when a navigation/manipulation gesture is cancelled
I am using the new HoloToolkit Input Module. I created an object to respond to navigation gestures - added a script to implement the INavigationHandler interface.
Things work well excepting for the fact that the cursor disappears when a navigation is cancelled( hand disappears from view). I am using the cursor prefabs (BasicCursor or CursorWithFeedback) provided by HoloToolkit.
Am I missing something in my implementation?
I get the same effect with the manipulation interfafce.
After some digging, CheckCursorState function in Cursor.cs must also check that the # of visible hands is > than zero before returning CursorStateEnum.Select
public virtual CursorStateEnum CheckCursorState()
{
if (cursorState != CursorStateEnum.Contextual)
{
if (IsInputSourceDown ) {
return CursorStateEnum.Select;
}
must be changed to
public virtual CursorStateEnum CheckCursorState()
{
if (cursorState != CursorStateEnum.Contextual)
{
if (IsInputSourceDown && visibleHandsCount > 0) {
return CursorStateEnum.Select;
}
Hi @islacoder, great find! Would you like to submit a PR that addresses these changes?
Thanks . I will do that.
With just that fix it, the cursor disappears when the hand becomes visible because IsInputSourceDown is still set to true due toOnInputUp never being called. Something like another check with an if statement resolves this:
public virtual CursorStateEnum CheckCursorState()
{
if (cursorState != CursorStateEnum.Contextual)
{
if (IsInputSourceDown && visibleHandsCount > 0)
{
return CursorStateEnum.Select;
}
else if (IsInputSourceDown && visibleHandsCount == 0)
{
IsInputSourceDown = false;
}
I don't think a PR ever got submitted for this.