Skip to content

Commit

Permalink
Merge pull request microsoft#4171 from julenka/nearptrinterfere
Browse files Browse the repository at this point in the history
Fix grab pointer is disabled when poke pointer near touchable.
  • Loading branch information
thalbern authored May 3, 2019
2 parents 0d5ff9b + b9a8040 commit 941a4aa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ public void UpdatePointers()
continue;
}

if (otherPointer is IMixedRealityNearPointer)
{
// Only disable far interaction pointers
// It is okay for example to have two near pointers active on a single controller
// like a poke pointer and a grab pointer
continue;
}

otherPointer.IsActive = false;
unassignedPointers.Remove(otherPointer);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ MonoBehaviour:
m_Bits: 4294967291
debugDrawPointingRays: 1
debugDrawPointingRayColors:
- {r: 0, g: 1, b: 0, a: 1}
- {r: 1, g: 0.58280706, b: 0, a: 1}
- {r: 0.86426115, g: 1, b: 0, a: 1}
- {r: 0, g: 1, b: 0.2163105, a: 1}
- {r: 0, g: 0.3028021, b: 1, a: 1}
- {r: 0.44855833, g: 0, b: 1, a: 1}
gazeCursorPrefab: {fileID: 1000012072213228, guid: 5b3e2856904e43c680f84f326861032a,
type: 3}
gazeProviderType:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@ private void UpdatePointers()
MixedRealityRaycaster.DebugEnabled = pointerProfile.DebugDrawPointingRays;

Color rayColor;

if ((pointerProfile.DebugDrawPointingRayColors != null) && (pointerProfile.DebugDrawPointingRayColors.Length > 0))
{
rayColor = pointerProfile.DebugDrawPointingRayColors[pointerCount++ % pointerProfile.DebugDrawPointingRayColors.Length];
Expand All @@ -716,6 +715,14 @@ private void UpdatePointers()
rayColor = Color.green;
}

if (!pointer.Pointer.IsActive)
{
// Only draw pointers that are currently active, but make sure to
// increment color even if pointer is disabled so that the color for e.g. the
// sphere pointer or the poke pointer remains consistent.
continue;
}

Debug.DrawRay(pointer.StartPoint, (pointer.Details.Point - pointer.StartPoint), rayColor);
}
}
Expand Down

0 comments on commit 941a4aa

Please sign in to comment.