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