Search Unity

TestPlanesAABB broke with new build on HoloLens

Discussion in 'VR' started by JeffGull, Dec 20, 2017.

  1. JeffGull

    JeffGull

    Joined:
    Nov 20, 2017
    Posts:
    9
    I was using a piece of code to control a text box tag along in HoloLens, identical to that found here, https://docs.unity3d.com/ScriptReference/GeometryUtility.TestPlanesAABB.html

    It was working in 2017.2

    I upgraded to 2017.3 and it stopped working. TestPlanesAABB is always returning false.

    The only thing I can think of is the Holokit AR camera is messed up in some way, (because of the upgrade?).

    I am using a box collider. There is no physic material set, as I using it only to test containment within the frustrum planes. The ARCamera is tagged as the main camera.

    Has something changed with the ARCamera.
     
  2. JeffGull

    JeffGull

    Joined:
    Nov 20, 2017
    Posts:
    9
    I forgot to mention. After I upgraded I deleted the old build entirely. I also tried reimporting the HoloToolKit, but that did nothing as well.
     
  3. JeffGull

    JeffGull

    Joined:
    Nov 20, 2017
    Posts:
    9
    The code I am using is SimpleTagAlong. It is part of the HoloToolKit. I misspoke above, TestPlanesAABB is always returning true. I know that is not caused by the bounds of the collider being too big as the cursor hits the collider and it shows that the box is small, well within the confines of the frustrum. Are we not supposed to use 2017.3 with HoloLens? I am very confused as this very simple code was working just fine before. Other parts of HoloToolKit, like the sharing service seems to be working just fine.
     
  4. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    We don't support the Windows HoloLens tool kit so we can't answer how the project works. You could try the git hub project forum or the Microsoft Windows MR forum
     
  5. Christop

    Christop

    Joined:
    Aug 21, 2012
    Posts:
    60
    JeffGull is right, i am facing the same problem with Unity 2107.3.1p2
    the GeometryUtility.TestPlanesAABB is not working correctly when you deploy to device Hololens.
    It works in the Editor, and when the Unity Holographic Emulation window (for both modes), but once you build for WSA to be deployed on device this function always returns true irrespective of the inputs you give into it.

    This is debugged and verified using the SimpleTagalong.cs script from MRTK
    https://github.com/Microsoft/MixedR...loToolkit/Utilities/Scripts/SimpleTagalong.cs,
    I replaced the Unity TestPlanesAABB function with my own and it worked fine.
    I used the MathUtils.TestPlanesAABB from MRTK.

    This is a bug than manifestatets once you deploy on device, please fix.
     
  6. JeffGull

    JeffGull

    Joined:
    Nov 20, 2017
    Posts:
    9
    This bug does not show up on 2017.2.0f3 or 2017.2.1p2
     
  7. Christop

    Christop

    Joined:
    Aug 21, 2012
    Posts:
    60
    JeffGull use the workaround i metioned. I think it works even better now since the MathUtils.TestPlanesAABB takes also into account partial entries in the frustum.
     
    JeffGull likes this.
  8. ChristiaanV

    ChristiaanV

    Joined:
    Jan 24, 2018
    Posts:
    1
    Christop how exactly did u fix it with MathUtils.TestPlanesAABB, just replacing the original function with this one doesn't fix it for me. Do I have to do something else.?
     
  9. Christop

    Christop

    Joined:
    Aug 21, 2012
    Posts:
    60
    Yeah the MathUtils fuction is not as easy to use. Here you go....

    bool needsToMove;// = !GeometryUtility.TestPlanesAABB(frustumPlanes, tagalongCollider.bounds);
    //HACK fix for 2017.3.1. Unity Hololens bug for TestPlanesAABB
    MathUtils.TestPlanesAABB(frustumPlanes, 1 | 2 | 4 | 8 | 16 | 32, tagalongCollider.bounds, out needsToMove);
    needsToMove = !needsToMove;