Search Unity

ARPlane planeUpdated Event clarification

Discussion in 'AR' started by KrikeyAdmin, Jan 24, 2019.

  1. KrikeyAdmin

    KrikeyAdmin

    Joined:
    Feb 5, 2018
    Posts:
    29
    I'm hoping someone can help me understand if this event is called when new points on the plane have actually been discovered / created or if it's anytime the plane position is altered as computer vision does its thing?

    I only want to know when the plane has actually grown in size, but this event seems to be firing a TON even when visually I don't see the plane growing or changing shape....

    I also noticed the "VertexChangeThreshold" property on ARPlane component. Is this tied to the OnPlaneUpdate event?
     
  2. tdmowrer

    tdmowrer

    Joined:
    Apr 21, 2017
    Posts:
    605
    A plane is "updated" when ARCore/ARKit tells us it has been. This often just means a minor adjustment in position, not necessarily that the boundary vertices have grown.

    ARCore does seem to update each plane that it is currently tracking nearly every frame, so that sounds like the expected behavior on Android at least. ARKit seems to be less frequent (or have a higher threshold for what "updated" means).

    This is the threshold at which the ARPlane will retessellate the plane's mesh and fire the boundaryChanged event. This sounds like the event you are interested in.
     
    KrikeyAdmin likes this.
  3. KrikeyAdmin

    KrikeyAdmin

    Joined:
    Feb 5, 2018
    Posts:
    29
    @tdmowrer ahhh, yes the boundaryChanged event is what I'm wanting. Thank you :D