Class MeshTransform | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class MeshTransform

    Functions for manipulating the transform of a mesh.

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

    Methods

    CenterPivot(ProBuilderMesh, Int32[])

    Center the mesh pivot at the average of a set of vertices.

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

    The target mesh.

    System.Int32[] indexes

    The indexes of the positions to average to find the new pivot.

    FreezeScaleTransform(ProBuilderMesh)

    Scale vertices and set transform.localScale to Vector3.one.

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

    The target mesh.

    SetPivot(ProBuilderMesh, Vector3)

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

    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.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023