Struct EdgeLookup
An edge composed of both the local index and common index.
This is useful when comparing vertex indexes that are coincident. Coincident vertices are defined as vertices that are share the same coordinate space, but are separate values in the vertex array. ProBuilder tracks these coincident values in the @"UnityEngine.ProBuilder.ProBuilderMesh.sharedIndexes" array. A "common" (also called "shared") index is the index of a vertex in the sharedIndexes array.
Namespace: UnityEngine.ProBuilder
Syntax
public struct EdgeLookup : IEquatable<EdgeLookup>
Constructors
EdgeLookup(Int32, Int32, Int32, Int32)
Create an edge lookup from 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)
Create an edge lookup from a common and local edge.
Declaration
public EdgeLookup(Edge common, Edge local)
Parameters
Type | Name | Description |
---|---|---|
Edge | common | An edge composed of common indexes (corresponds to @"UnityEngine.ProBuilder.ProBuilderMesh.sharedIndexes"). |
Edge | local | An edge composed of vertex indexes (corresponds to mesh vertex arrays). |
Properties
common
Declaration
public Edge common { get; set; }
Property Value
Type | Description |
---|---|
Edge | Commmon edges point to the vertex index in the sharedIndexes array. |
local
Declaration
public Edge local { get; set; }
Property Value
Type | Description |
---|---|
Edge | Local edges point to an index in the vertices array. |
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. |
GetEdgeLookup(IEnumerable<Edge>, Dictionary<Int32, Int32>)
Create a list of EdgeLookup edges from a set of local edges and a sharedIndexes 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<Int32, Int32> | lookup | A shared index lookup dictionary (see ProBuilderMesh.sharedIndexes). |
Returns
Type | Description |
---|---|
IEnumerable<EdgeLookup> | A set of EdgeLookup edges. |
GetEdgeLookupHashSet(IEnumerable<Edge>, Dictionary<Int32, Int32>)
Create 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<Int32, Int32> | lookup | A shared index lookup dictionary (see ProBuilderMesh.sharedIndexes). |
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()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
ToString()
Returns a string representation of the common edge property.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
Operators
Equality(EdgeLookup, EdgeLookup)
Declaration
public static bool operator ==(EdgeLookup a, EdgeLookup b)
Parameters
Type | Name | Description |
---|---|---|
EdgeLookup | a | |
EdgeLookup | b |
Returns
Type | Description |
---|---|
Boolean |
Inequality(EdgeLookup, EdgeLookup)
Declaration
public static bool operator !=(EdgeLookup a, EdgeLookup b)
Parameters
Type | Name | Description |
---|---|---|
EdgeLookup | a | |
EdgeLookup | b |
Returns
Type | Description |
---|---|
Boolean |