docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method GenerateMesh

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

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

    Declaration
    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.

    In This Article
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Friday, September 22, 2023