问题
I am trying to build a color selection list in my personal project, with 48 * PressableButtonHoloLens2
+ GridObjectCollection
. When I run and hover with the simulated fingertip, the editor gives me these warning messages.
Q1: Is this because too many buttons are too close to each other? Or just the number of the buttons with collider is over 64? The message says 'Consider increasing the query buffer size in the pointer profile'
Q2: Where can I increase the buffer size? I don't see any 'Buffer size' field in the pointer profile.
Q3: Would it decrease performance? (increasing the buffer size)
Warning message
Maximum number of 64 colliders found in PokePointer overlap query. Consider increasing the query buffer size in the pointer profile. UnityEngine.Debug:LogWarning(Object) Microsoft.MixedReality.Toolkit.Input.PokePointer:FindClosestTouchableForLayerMask(LayerMask, BaseNearInteractionTouchable&, Single&, Vector3&) (at Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Pointers/PokePointer.cs:169) Microsoft.MixedReality.Toolkit.Input.PokePointer:OnPreSceneQuery() (at Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Pointers/PokePointer.cs:127) Microsoft.MixedReality.Toolkit.Input.FocusProvider:UpdatePointer(PointerData) (at Assets/MixedRealityToolkit.Services/InputSystem/FocusProvider.cs:878) Microsoft.MixedReality.Toolkit.Input.FocusProvider:UpdatePointers() (at Assets/MixedRealityToolkit.Services/InputSystem/FocusProvider.cs:841) Microsoft.MixedReality.Toolkit.Input.FocusProvider:Update() (at Assets/MixedRealityToolkit.Services/InputSystem/FocusProvider.cs:518) Microsoft.MixedReality.Toolkit.<>c:b__60_0(IMixedRealityService) (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:880) Microsoft.MixedReality.Toolkit.MixedRealityToolkit:ExecuteOnAllServices(IEnumerable
1, Action
1) (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:969) Microsoft.MixedReality.Toolkit.MixedRealityToolkit:ExecuteOnAllServicesInOrder(Action`1) (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:950) Microsoft.MixedReality.Toolkit.MixedRealityToolkit:UpdateAllServices() (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:880) Microsoft.MixedReality.Toolkit.MixedRealityToolkit:Update() (at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:580)
To reproduce
- Create an empty game object
- Put 48 x PressableButtonHoloLens2 prefabs under it
- Assign GridObjectCollection to the parent
- Update layout (cell width x height = 0.032)
- Run and hover with simulated hand.
Expected behavior
No warning messages
Your Setup (please complete the following information)
- Unity Version [e.g. 2018.4.6f1]
- MRTK Version [e.g. v2.0.0]
https://github.com/microsoft/MixedRealityToolkit-Unity/issues/6052
回答1:
Q1: Is this because too many buttons are too close to each other? Or just the number of the buttons with collider is over 64? The message says 'Consider increasing the query buffer size in the pointer profile'
It is because there are too many buttons close to each other.
Q2: Where can I increase the buffer size? I don't see any 'Buffer size' field in the pointer profile.
You can do this in the PokePointer prefab, in the PokePointer script, look for "Scene Query Buffer Size" field.
Q3: Would it decrease performance? (increasing the buffer size)
Yes I anticipate it would, though unclear how much relative to other components in the scene. Note that the poke pointer does run queries every frame, at least one per hand.
来源:https://stackoverflow.com/questions/58074113/mrtk-maximum-number-of-64-colliders-found-in-pokepointer-overlap-query