Method GetVertexRotation
GetVertexRotation(ProBuilderMesh, HandleOrientation, IEnumerable<int>)
Returns a rotation suitable for orienting a handle or gizmo relative to the Vertex 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<int> | vertices | Array of Vertex indices pointing to the vertices to consider in the rotation calculations. This is only used when the HandleOrientation is set to ActiveElement. |
Returns
Type | Description |
---|---|
Quaternion | A rotation appropriate to the orientation and element selection. |
GetVertexRotation(ProBuilderMesh, int)
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 the vertex belongs to. |
int | vertex | The index that points to the vertex to calculate the rotation for. |
Returns
Type | Description |
---|---|
Quaternion | The rotation of a vertex normal in world space coordinates. |