Class Smoothing | Package Manager UI website
docs.unity.cn
    Show / Hide Table of Contents

    Class Smoothing

    Utilities for working with smoothing groups. Smoothing groups are how ProBuilder defines hard and soft edges. ProBuilder calculates vertex normals by first calculating the normal for every face, which in turn is applied to each vertex that makes up the face. Afterwards, each vertex normal is averaged with coincident vertices belonging to the same smoothing group.

    Inheritance
    System.Object
    Smoothing
    Namespace: UnityEngine.ProBuilder
    Syntax
    public static class Smoothing

    Methods

    ApplySmoothingGroups(ProBuilderMesh, IEnumerable<Face>, Single)

    Generate smoothing groups for a set of faces by comparing adjacent faces with normal differences less than angleThreshold (in degrees).

    Declaration
    public static void ApplySmoothingGroups(ProBuilderMesh mesh, IEnumerable<Face> faces, float angleThreshold)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The source mesh.

    System.Collections.Generic.IEnumerable<Face> faces

    Faces to be considered for smoothing.

    System.Single angleThreshold

    The maximum angle difference in degrees between adjacent face normals for the shared edge to be considered smooth.

    GetUnusedSmoothingGroup(ProBuilderMesh)

    Get the first available unused smoothing group.

    Declaration
    public static int GetUnusedSmoothingGroup(ProBuilderMesh mesh)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The target mesh.

    Returns
    Type Description
    System.Int32

    An unused smoothing group.

    IsSmooth(Int32)

    Is the smooth group value considered smooth?

    Declaration
    public static bool IsSmooth(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The smoothing group to test.

    Returns
    Type Description
    System.Boolean

    True if the smoothing group value is smoothed, false if not.

    Back to top Copyright © 2019 Unity Technologies
    Generated by DocFX