docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class HandleUtility

    Provides static methods for working with ProBuilderMesh objects in the Editor.

    Inheritance
    object
    HandleUtility
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.ProBuilder
    Assembly: Unity.ProBuilder.dll
    Syntax
    public static class HandleUtility

    Methods

    GetEdgeRotation(ProBuilderMesh, Edge)

    Returns the rotation of an Edge in world space.

    Declaration
    public static Quaternion GetEdgeRotation(ProBuilderMesh mesh, Edge edge)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh that edge belongs to.

    Edge edge

    The edge you want to calculate the rotation for.

    Returns
    Type Description
    Quaternion

    The rotation of the edge in world space coordinates.

    GetEdgeRotation(ProBuilderMesh, HandleOrientation, IEnumerable<Edge>)

    Returns a rotation suitable for orienting a handle or gizmo relative to the Edge selection.

    Declaration
    public static Quaternion GetEdgeRotation(ProBuilderMesh mesh, HandleOrientation orientation, IEnumerable<Edge> edges)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The target mesh.

    HandleOrientation orientation

    The type of HandleOrientation to calculate.

    IEnumerable<Edge> edges

    Which edges to consider in the rotation calculations. This is only used when the HandleOrientation is set to ActiveElement.

    Returns
    Type Description
    Quaternion

    A rotation appropriate to the orientation and element selection.

    GetFaceRotation(ProBuilderMesh, Face)

    Returns the rotation of a Face in world space.

    Declaration
    public static Quaternion GetFaceRotation(ProBuilderMesh mesh, Face face)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh that the face belongs to.

    Face face

    The face you want to calculate the rotation for.

    Returns
    Type Description
    Quaternion

    The rotation of the face in world space coordinates.

    GetFaceRotation(ProBuilderMesh, HandleOrientation, IEnumerable<Face>)

    Returns a rotation suitable for orienting a handle or gizmo relative to the Face selection.

    Declaration
    public static Quaternion GetFaceRotation(ProBuilderMesh mesh, HandleOrientation orientation, IEnumerable<Face> faces)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The target mesh.

    HandleOrientation orientation

    The type of HandleOrientation to calculate.

    IEnumerable<Face> faces

    Which faces to consider in the rotation calculations. This is only used when the HandleOrientation is set to ActiveElement.

    Returns
    Type Description
    Quaternion

    A rotation appropriate to the orientation and element selection.

    GetRotation(ProBuilderMesh, IEnumerable<int>)

    Collects coincident vertices and returns a rotation calculated from the average normal and bitangent.

    Declaration
    public static Quaternion GetRotation(ProBuilderMesh mesh, IEnumerable<int> indices)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The target mesh.

    IEnumerable<int> indices

    Vertex indices to consider in the rotation calculations.

    Returns
    Type Description
    Quaternion

    A rotation calculated from the average normal of each vertex.

    GetVertexRotation(ProBuilderMesh, int)

    Get the rotation of a vertex in world space.

    Declaration
    public static Quaternion GetVertexRotation(ProBuilderMesh mesh, int vertex)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The mesh that the vertex belongs to.

    int vertex

    The index that points to the vertex to calculate the rotation for.

    Returns
    Type Description
    Quaternion

    The rotation of a vertex normal in world space coordinates.

    GetVertexRotation(ProBuilderMesh, HandleOrientation, IEnumerable<int>)

    Returns a rotation suitable for orienting a handle or gizmo relative to the Vertex selection.

    Declaration
    public static Quaternion GetVertexRotation(ProBuilderMesh mesh, HandleOrientation orientation, IEnumerable<int> vertices)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The target mesh.

    HandleOrientation orientation

    The type of HandleOrientation to calculate.

    IEnumerable<int> vertices

    Array of Vertex indices pointing to the vertices to consider in the rotation calculations. This is only used when the HandleOrientation is set to ActiveElement.

    Returns
    Type Description
    Quaternion

    A rotation appropriate to the orientation and element selection.

    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)