Struct EdgeLookup
Represents an edge composed of both the local index and the common index.
Use this to compare vertex indices that are coincident. Coincident vertices share the same coordinate space, but are separate values in the vertex array. ProBuilder tracks these coincident values in the sharedVertices array. A "common" (also called "shared") index is the index of a vertex in the sharedVertices array.
Implements
Inherited Members
Namespace: UnityEngine.ProBuilder
Assembly: Unity.ProBuilder.dll
Syntax
public struct EdgeLookup : IEquatable<EdgeLookup>
Constructors
EdgeLookup(int, int, int, int)
Creates an edge lookup from two set of vertices that represent the common and local edges.
Declaration
public EdgeLookup(int cx, int cy, int x, int y)
Parameters
Type | Name | Description |
---|---|---|
int | cx | Common edge x. |
int | cy | Common edge y. |
int | x | Local edge x. |
int | y | Local edge y. |
See Also
EdgeLookup(Edge, Edge)
Creates an edge lookup from common and local Edge instances.
Declaration
public EdgeLookup(Edge common, Edge local)
Parameters
Type | Name | Description |
---|---|---|
Edge | common | An edge composed of common indexes (corresponds to sharedVertices). |
Edge | local | An edge composed of vertex indexes (corresponds to mesh vertex arrays). |
See Also
Properties
common
Gets or sets the common edges.
Commmon edges point to the vertex index in the sharedVertices array.
Declaration
public Edge common { get; set; }
Property Value
Type | Description |
---|---|
Edge |
See Also
local
Gets or sets the local edges.
Local edges point to an index in the vertices array.
Declaration
public Edge local { get; set; }
Property Value
Type | Description |
---|---|
Edge |
See Also
Methods
Equals(object)
Compares each EdgeLookup common edge (does not take into account local edge differences).
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The EdgeLookup to compare against. False if obj is not an EdgeLookup type. |
Returns
Type | Description |
---|---|
bool | True if the common edges are equal; false if not. |
Overrides
See Also
Equals(EdgeLookup)
Compares each EdgeLookup common edge (does not take into account local edge differences).
Declaration
public bool Equals(EdgeLookup other)
Parameters
Type | Name | Description |
---|---|---|
EdgeLookup | other | The EdgeLookup to compare against. |
Returns
Type | Description |
---|---|
bool | True if the common edges are equal, false if not. |
See Also
GetEdgeLookup(IEnumerable<Edge>, Dictionary<int, int>)
Creates a list of EdgeLookup edges from a set of local edges and a sharedVertices dictionary.
Declaration
public static IEnumerable<EdgeLookup> GetEdgeLookup(IEnumerable<Edge> edges, Dictionary<int, int> lookup)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Edge> | edges | A collection of local edges. |
Dictionary<int, int> | lookup | A shared index lookup dictionary (see sharedVertices). |
Returns
Type | Description |
---|---|
IEnumerable<EdgeLookup> | A set of EdgeLookup edges that you can iterate over. |
See Also
GetEdgeLookupHashSet(IEnumerable<Edge>, Dictionary<int, int>)
Creates a hashset of edge lookup values from a collection of local edges and a shared indexes lookup.
Declaration
public static HashSet<EdgeLookup> GetEdgeLookupHashSet(IEnumerable<Edge> edges, Dictionary<int, int> lookup)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Edge> | edges | A collection of local edges. |
Dictionary<int, int> | lookup | A shared index lookup dictionary (see sharedVertices). |
Returns
Type | Description |
---|---|
HashSet<EdgeLookup> | A HashSet of EdgeLookup edges. EdgeLookup values are compared by their common property only: local edges are not compared. |
See Also
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | An integer that is the hash code for this instance. |
Overrides
See Also
ToString()
Returns a string representation of the common edge property.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | String formatted as: "Common: ( |
Overrides
See Also
Operators
operator ==(EdgeLookup, EdgeLookup)
Compares two objects for equality.
Declaration
public static bool operator ==(EdgeLookup a, EdgeLookup b)
Parameters
Type | Name | Description |
---|---|---|
EdgeLookup | a | The first EdgeLookup instance. |
EdgeLookup | b | The second EdgeLookup instance. |
Returns
Type | Description |
---|---|
bool | True if the objects are equal; false if not. |
See Also
operator !=(EdgeLookup, EdgeLookup)
Returns true if the two objects are not equal.
Declaration
public static bool operator !=(EdgeLookup a, EdgeLookup b)
Parameters
Type | Name | Description |
---|---|---|
EdgeLookup | a | The first EdgeLookup instance. |
EdgeLookup | b | The second EdgeLookup instance. |
Returns
Type | Description |
---|---|
bool | True if the objects are not equal; false if they are equal. |