Class MeshTransform
Functions for manipulating the transform of a mesh.
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. |
| 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. |