docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ARPlaneMeshGenerators

    Generator methods for ARPlane mesh geometery.

    Inheritance
    object
    ARPlaneMeshGenerators
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.ARFoundation
    Assembly: Unity.XR.ARFoundation.dll
    Syntax
    [Obsolete("ARPlaneMeshGenerators has been deprecated in AR Foundation version 6.0. Use ARPlaneMeshGenerator instead.", false)]
    public static class ARPlaneMeshGenerators
    Remarks

    These static class provides ways to generate different parts of plane geometry, such as vertices, indices, normals, and UVs. You can use these methods to build an ARPlane Mesh object.

    Methods

    GenerateIndices(List<int>, List<Vector3>, float)

    Generates a List of indices from the given parameters, forming a triangle fan. The convexPolygon is assumed to be convex.

    Declaration
    [Obsolete("GenerateIndices has been deprecated in AR Foundation version 6.0.", false)]
    public static bool GenerateIndices(List<int> indices, List<Vector3> convexPolygon, float areaTolerance = 1E-06)
    Parameters
    Type Name Description
    List<int> indices

    The List to write results to.

    List<Vector3> convexPolygon

    The vertices of the plane's boundary, in plane-space.

    float areaTolerance

    If any triangle in the generated mesh is less than this, then the entire mesh is ignored.

    Returns
    Type Description
    bool

    True if the indices were generated, False if a triangle whose area is less than areaTolerance is found.

    Remarks

    convexPolygon is not checked for its convexness. Concave polygons will produce incorrect results.

    GenerateMesh(Mesh, Pose, NativeArray<Vector2>, float)

    Generates a Mesh from the given parameters. The convexPolygon is assumed to be convex.

    Declaration
    [Obsolete("GenerateMesh has been deprecated in AR Foundation version 6.0. Use ARPlaneMeshGenerator.TryGenerateMesh instead.", false)]
    public static bool GenerateMesh(Mesh mesh, Pose pose, NativeArray<Vector2> convexPolygon, float areaTolerance = 1E-06)
    Parameters
    Type Name Description
    Mesh mesh

    The Mesh to write results to.

    Pose pose

    The session-space pose of the mesh.

    NativeArray<Vector2> convexPolygon

    The vertices of the plane's boundary, in plane-space.

    float areaTolerance

    If any triangle in the generated mesh is less than this, then the entire mesh is ignored. This handles an edge case which prevents degenerate or very small triangles. Units are meters-squared.

    Returns
    Type Description
    bool

    True if the mesh was generated, False otherwise. The mesh might fail to generate if it is not a valid polygon (too few vertices) or if it contains degenerate triangles (area smaller than areaTolerance).

    Remarks

    convexPolygon is not checked for its convexness. Concave polygons will produce incorrect results.

    GenerateUvs(List<Vector2>, Pose, List<Vector3>)

    Generates a List of UVs from the given parameters.

    Declaration
    [Obsolete("GenerateUvs has been deprecated in AR Foundation version 6.0.", false)]
    public static void GenerateUvs(List<Vector2> Uvs, Pose pose, List<Vector3> vertices)
    Parameters
    Type Name Description
    List<Vector2> Uvs

    The List to write results to.

    Pose pose

    The session-space pose of the mesh.

    List<Vector3> vertices

    The vertices of the plane's boundary, in plane-space.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)