docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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
    IEquatable<EdgeLookup>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    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
    sharedVertices
    Edge

    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
    sharedVertices
    Edge

    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
    sharedVertices
    Edge

    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
    sharedVertices
    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
    bool

    True if the common edges are equal; false if not.

    Overrides
    ValueType.Equals(object)
    See Also
    sharedVertices
    Edge

    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
    sharedVertices
    Edge

    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
    sharedVertices
    Edge

    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
    sharedVertices
    Edge

    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
    ValueType.GetHashCode()
    See Also
    sharedVertices
    Edge

    ToString()

    Returns a string representation of the common edge property.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    String formatted as: "Common: (common.a, common.b), local: (local.a, local.b)"

    Overrides
    ValueType.ToString()
    See Also
    sharedVertices
    Edge

    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
    sharedVertices
    Edge

    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.

    See Also
    sharedVertices
    Edge

    Implements

    IEquatable<T>

    See Also

    sharedVertices
    Edge
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)