C# Class EdgeGraph.Edge

Show file Open project: famerij/EdgeGraph Class Usage Examples

Public Methods

Method Description
Edge ( ) : UnityEngine
Edge ( Edge edge ) : UnityEngine
Edge ( string _node1, string _node2 ) : UnityEngine
Edge ( string _node1, string _node2, float _width ) : UnityEngine
GetAdjacentNode ( Node current ) : string
GetAdjacentNode ( string current ) : string
GetClosestPointOnEdge ( Vector3 point, Vector3 _v1, Vector3 _v2 ) : Vector2

Returns closest point to an edge (v1,v2) in X-Z space.

GetLeftPerpendicular ( Vector3 v1, Vector3 v2 ) : Vector3
GetPerpendicularComparedToDirection ( Vector3 v1, Vector3 v2, Vector3 dir ) : Vector3
GetPerpendicularTowardsPoint ( Vector3 v1, Vector3 v2, Vector3 point ) : Vector3

Return left or right normal for edge, depending on which normal points towards the given point.

GetRightPerpendicular ( Vector3 v1, Vector3 v2 ) : Vector3
SplitEdge ( Edge edge, Vector3 point, List nodes, List edges, Node node = null ) : Node

Splits given edge into two edges at given point If a node is given, it will be used to split the edges Otherwise make a new node

Method Details

Edge() public method

public Edge ( ) : UnityEngine
return UnityEngine

Edge() public method

public Edge ( Edge edge ) : UnityEngine
edge Edge
return UnityEngine

Edge() public method

public Edge ( string _node1, string _node2 ) : UnityEngine
_node1 string
_node2 string
return UnityEngine

Edge() public method

public Edge ( string _node1, string _node2, float _width ) : UnityEngine
_node1 string
_node2 string
_width float
return UnityEngine

GetAdjacentNode() public method

public GetAdjacentNode ( Node current ) : string
current Node
return string

GetAdjacentNode() public method

public GetAdjacentNode ( string current ) : string
current string
return string

GetClosestPointOnEdge() public static method

Returns closest point to an edge (v1,v2) in X-Z space.
public static GetClosestPointOnEdge ( Vector3 point, Vector3 _v1, Vector3 _v2 ) : Vector2
point Vector3
_v1 Vector3
_v2 Vector3
return Vector2

GetLeftPerpendicular() public static method

public static GetLeftPerpendicular ( Vector3 v1, Vector3 v2 ) : Vector3
v1 Vector3
v2 Vector3
return Vector3

GetPerpendicularComparedToDirection() public static method

public static GetPerpendicularComparedToDirection ( Vector3 v1, Vector3 v2, Vector3 dir ) : Vector3
v1 Vector3
v2 Vector3
dir Vector3
return Vector3

GetPerpendicularTowardsPoint() public static method

Return left or right normal for edge, depending on which normal points towards the given point.
public static GetPerpendicularTowardsPoint ( Vector3 v1, Vector3 v2, Vector3 point ) : Vector3
v1 Vector3
v2 Vector3
point Vector3
return Vector3

GetRightPerpendicular() public static method

public static GetRightPerpendicular ( Vector3 v1, Vector3 v2 ) : Vector3
v1 Vector3
v2 Vector3
return Vector3

SplitEdge() public static method

Splits given edge into two edges at given point If a node is given, it will be used to split the edges Otherwise make a new node
public static SplitEdge ( Edge edge, Vector3 point, List nodes, List edges, Node node = null ) : Node
edge Edge
point Vector3
nodes List
edges List
node Node
return Node