Class WingedEdge
A winged-edge data structure holds references to an edge, the previous and next edge in it's triangle, it's connected face, and the opposite edge (common).
Inheritance
Namespace: UnityEngine.ProBuilder
Syntax
public sealed class WingedEdge : IEquatable<WingedEdge>
Examples
. / (face) /
. prev / / next
. / edge /
. /_ _ _ _ _ _ _/
. |- - - - - - -|
. | opposite |
. | |
. | |
. | |
Properties
edge
Declaration
public EdgeLookup edge { get; }
Property Value
Type | Description |
---|---|
EdgeLookup | The local and shared edge that this edge belongs to. |
face
Declaration
public Face face { get; }
Property Value
Type | Description |
---|---|
Face | The connected face that this wing belongs to. |
next
Declaration
public WingedEdge next { get; }
Property Value
Type | Description |
---|---|
WingedEdge | The WingedEdge that is connected to the edge.y vertex. |
opposite
Declaration
public WingedEdge opposite { get; }
Property Value
Type | Description |
---|---|
WingedEdge | The WingedEdge that is on the opposite side of this edge. |
previous
Declaration
public WingedEdge previous { get; }
Property Value
Type | Description |
---|---|
WingedEdge | The WingedEdge that is connected to the edge.x vertex. |
Methods
Count()
How many edges are in this sequence.
Declaration
public int Count()
Returns
Type | Description |
---|---|
System.Int32 | The number of WingedEdges that are connected by walking the @"UnityEngine.ProBuilder.WingedEdge.next" property. |
Equals(Object)
Equality comparision tests for local edge equality, disregarding other values.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The WingedEdge to compare against. |
Returns
Type | Description |
---|---|
System.Boolean | True if the local edges are equal, false if not. |
Overrides
Equals(WingedEdge)
Equality comparision tests for local edge equality, disregarding other values.
Declaration
public bool Equals(WingedEdge other)
Parameters
Type | Name | Description |
---|---|---|
WingedEdge | other | The WingedEdge to compare against. |
Returns
Type | Description |
---|---|
System.Boolean | True if the local edges are equal, false if not. |
GetAdjacentEdgeWithCommonIndex(Int32)
Return the @"UnityEngine.ProBuilder.WingedEdge.previous" or @"UnityEngine.ProBuilder.WingedEdge.next" WingedEdge if it contains the passed common (shared) index.
Declaration
public WingedEdge GetAdjacentEdgeWithCommonIndex(int common)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | common | The common index to search next and previous for. |
Returns
Type | Description |
---|---|
WingedEdge | The next or previous WingedEdge that contains common, or null if not found. |
GetHashCode()
Get a hash code for this edge.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | WingedEdge comparison only considers the local edge. As such, this returns the local edge hashcode. |
Overrides
GetSpokes(List<WingedEdge>)
Get a dictionary of common indexes and all WingedEdge values touching the index.
Declaration
public static Dictionary<int, List<WingedEdge>> GetSpokes(List<WingedEdge> wings)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<WingedEdge> | wings | The wings to search for spokes. |
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Int32, System.Collections.Generic.List<WingedEdge>> | A dictionary where each key is a common index with a list of each winged edge touching it. |
GetWingedEdges(ProBuilderMesh, Boolean)
Create a new list of WingedEdge values for a ProBuilder mesh.
Declaration
public static List<WingedEdge> GetWingedEdges(ProBuilderMesh mesh, bool oneWingPerFace = false)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The mesh from which faces will read. |
System.Boolean | oneWingPerFace | Optionally restrict the list to only include one WingedEdge per-face. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<WingedEdge> | A new list of WingedEdge values gathered from @"UnityEngine.ProBuilder.ProBuilderMesh.faces". |
GetWingedEdges(ProBuilderMesh, IEnumerable<Face>, Boolean)
Create a new list of WingedEdge values for a ProBuilder mesh.
Declaration
public static List<WingedEdge> GetWingedEdges(ProBuilderMesh mesh, IEnumerable<Face> faces, bool oneWingPerFace = false)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | Target ProBuilderMesh. |
System.Collections.Generic.IEnumerable<Face> | faces | Which faces to include in the WingedEdge list. |
System.Boolean | oneWingPerFace | If |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<WingedEdge> | A new list of WingedEdge values gathered from faces. |
SortEdgesByAdjacency(List<Edge>)
Sort edges list by adjacency, such that each edge's common y value matches the next edge's common x.
Declaration
public static void SortEdgesByAdjacency(List<Edge> edges)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<Edge> | edges | The edges to sort in-place. |
SortEdgesByAdjacency(Face)
Order a face's edges in sequence. The first edge is used as a starting point.
Declaration
public static List<Edge> SortEdgesByAdjacency(Face face)
Parameters
Type | Name | Description |
---|---|---|
Face | face | The source face. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Edge> | A new set of edges where each edge y value matches the next edge x. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string representation of the properties contained within this object. |