Class HandleUtility
Static methods for working with ProBuilderMesh objects in an editor.
Namespace: UnityEngine.ProBuilder
Syntax
public static class HandleUtility
Methods
GetEdgeRotation(ProBuilderMesh, Edge)
Get 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 calculate rotation for. |
Returns
Type | Description |
---|---|
Quaternion | The rotation of edge in world space coordinates. |
GetEdgeRotation(ProBuilderMesh, HandleOrientation, IEnumerable<Edge>)
Get a rotation suitable for orienting a handle or gizmo relative to the element 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 | Edges to consider in the rotation calculations. Only used when HandleOrientation is ActiveElement. |
Returns
Type | Description |
---|---|
Quaternion | A rotation appropriate to the orientation and element selection. |
GetFaceRotation(ProBuilderMesh, Face)
Get 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 face belongs to. |
Face | face | The face calculate rotation for. |
Returns
Type | Description |
---|---|
Quaternion | The rotation of face in world space coordinates. |
GetFaceRotation(ProBuilderMesh, HandleOrientation, IEnumerable<Face>)
Get a rotation suitable for orienting a handle or gizmo relative to the element 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 | Faces to consider in the rotation calculations. Only used when HandleOrientation is ActiveElement. |
Returns
Type | Description |
---|---|
Quaternion | A rotation appropriate to the orientation and element selection. |
GetRotation(ProBuilderMesh, IEnumerable<Int32>)
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<Int32> | 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, Int32)
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 |
Int32 | vertex | The vertex to calculate rotation for. |
Returns
Type | Description |
---|---|
Quaternion | The rotation of a vertex normal in world space coordinates. |
GetVertexRotation(ProBuilderMesh, HandleOrientation, IEnumerable<Int32>)
Get a rotation suitable for orienting a handle or gizmo relative to the element 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<Int32> | vertices | Edges to consider in the rotation calculations. Only used when HandleOrientation is ActiveElement. |
Returns
Type | Description |
---|---|
Quaternion | A rotation appropriate to the orientation and element selection. |