docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MeshTransform

    Functions for manipulating the transform of a mesh.

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

    Methods

    CenterPivot(ProBuilderMesh, int[])

    Centers the mesh pivot at the average of a set of vertex positions.

    This is the equivalent of the Center Pivot action.

    Declaration
    public static void CenterPivot(this ProBuilderMesh mesh, int[] indexes)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The target mesh.

    int[] indexes

    The array of indices representing the positions to average in order to find the new pivot.

    FreezeScaleTransform(ProBuilderMesh)

    Scales vertices and sets transform.localScale to Vector3.one.

    This is the equivalent of the Freeze Transform action.

    Declaration
    public static void FreezeScaleTransform(this ProBuilderMesh mesh)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The target mesh.

    SetPivot(ProBuilderMesh, Vector3)

    Sets the pivot point of a mesh in world space. The Transform component position property is set to worldPosition, while the mesh geometry does not move.

    This is the equivalent of the Set Pivot (Vertices) action.

    Declaration
    public static void SetPivot(this ProBuilderMesh mesh, Vector3 worldPosition)
    Parameters
    Type Name Description
    ProBuilderMesh mesh

    The target mesh.

    Vector3 worldPosition

    The new pivot position in world 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)