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.
Inherited Members
Namespace: UnityEngine.ProBuilder
Syntax
public struct EdgeLookup : IEquatable<EdgeLookup>
Constructors
EdgeLookup(Int32, Int32, Int32, Int32)
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 |
|---|---|---|
| Int32 | cx | Common edge x. |
| Int32 | cy | Common edge y. |
| Int32 | x | Local edge x. |
| Int32 | y | Local edge y. |
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 GetVertices(IList<Int32>)). |
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 |
local
Gets or sets the local edges.
Local edges point to an index in the GetVertices(IList<Int32>) array.
Declaration
public Edge local { get; set; }
Property Value
| Type | Description |
|---|---|
| Edge |
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 |
|---|---|
| Boolean | True if the common edges are equal; false if not. |
Overrides
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 |
|---|---|
| Boolean | True if the common edges are equal, false if not. |
Implements
GetEdgeLookup(IEnumerable<Edge>, Dictionary<Int32, Int32>)
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 |
|---|---|---|
| System.Collections.Generic.IEnumerable<Edge> | edges | A collection of local edges. |
| Dictionary<Int32, Int32> | lookup | A shared index lookup dictionary (see sharedVertices). |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<EdgeLookup> | A set of EdgeLookup edges that you can iterate over. |
GetEdgeLookupHashSet(IEnumerable<Edge>, Dictionary<Int32, Int32>)
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 |
|---|---|---|
| System.Collections.Generic.IEnumerable<Edge> | edges | A collection of local edges. |
| Dictionary<Int32, Int32> | 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. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 | An integer that is the hash code for this instance. |
Overrides
ToString()
Returns a string representation of the common edge property.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String | String formatted as: "Common: ( |
Overrides
Operators
Equality(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 |
|---|---|
| Boolean | True if the objects are equal; false if not. |
Inequality(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 |
|---|---|
| Boolean | True if the objects are not equal; false if they are equal. |