Search Unity

Resolved ARPointCloud properties

Discussion in 'AR' started by wsc34, Apr 12, 2021.

  1. wsc34

    wsc34

    Joined:
    Dec 26, 2020
    Posts:
    18
    From the API, ARPointCloudChangedEventArgs events log the change of ARPointCloud that is recorded by the ARPointCloudManager, and in the event, we can call added to access a List<ARPointCloud> that is the list of ARPointClouds added since the last event. So it seems to me that we can acquire such a list through ARPointCloudManager.pointCloudsChanged.added. But it does not seem to work as the error message suggests that pointCloudsChanged can only appear on the LHS of += or -=, so how can I access the list stated above?

    Another question is that ARPointCloud seems to be a list of many points, so why is the accessed list not ARPointCloud but List<ARPointCloud>? Does the ARPointCloudManager perform the clustering of point clouds internally?
     
    Last edited: Apr 13, 2021
  2. eugeneloza

    eugeneloza

    Joined:
    Dec 3, 2019
    Posts:
    24
    Code (CSharp):
    1. OnPointCloudsChanged(ARPointCloudChangedEventArgs eventArgs) {}
    2.  
    3. ...
    4.  
    5. void OnEnable()
    6. {
    7.   ARPointCloudManager.pointCloudsChanged += OnPointCloudsChanged;
    8. }
    It should do so. But in my tests so far there is always exactly one Point Coud which gets rebuilt every frame.
     
    wsc34 likes this.
  3. wsc34

    wsc34

    Joined:
    Dec 26, 2020
    Posts:
    18
    Thank you.