Search Unity

Question How to access plane data

Discussion in 'Unity MARS' started by ikdd88, Jul 16, 2020.

  1. ikdd88

    ikdd88

    Joined:
    Apr 6, 2020
    Posts:
    6
    Hi,
    Is there a way to access data about the size of a plane, let's say I want to know the size of the floor plane? I couldn't find out how to do this.
    Thank you.
     
  2. unity_andrewm

    unity_andrewm

    Unity Technologies

    Joined:
    Jun 25, 2015
    Posts:
    73
    Check out this thread:
    https://forum.unity.com/threads/understanding-underlying-data-in-the-scene.921050/

    MARS scripts you would be interested in examining further would be:

    The particular data you are com.unity.mars/Runtime/Scripts/Actions/StretchToExtentsAction.cs and com.unity.mars/Runtime/Scripts/Actions/ShowChildrenInBoundsAction.cs

    StretchToExtents is an example of reading the general purpose 'bounds' data for proxies(the general size value you want). This data is available for planes and image markers, and is accessed the same way.

    ShowChildrenInBounds is a more specific example of reading the underlying plane data directly to retrieve the actual vertices that make up extents the of the plane. We use this to test which objects are within a plane to include/exclude them.