Dungeon Architect  17.0.0
SharpNav.PolyVertex Struct Reference

A vertex inside a PolyMesh. More...

Inheritance diagram for SharpNav.PolyVertex:

Classes

class  RoughYEqualityComparer
 An implementation of IEqualityComparer<T> of PolyVertex that allows for the Y coordinates of two vertices to be within a specified range and still be considered equal.
 

Public Member Functions

 PolyVertex (int x, int y, int z)
 Initializes a new instance of the PolyVertex struct. More...
 
bool Equals (PolyVertex other)
 Compares another PolyVertex with this instance for equality. More...
 
override bool Equals (object obj)
 Compares an object with this instance for equality. More...
 
override int GetHashCode ()
 Gets a hash code unique to the contents of this instance. More...
 
override string ToString ()
 Gets a human-readable version of the vertex. More...
 

Static Public Member Functions

static PolyVertex ComponentMin (PolyVertex a, PolyVertex b)
 Calculates the component-wise minimum of two vertices. More...
 
static void ComponentMin (ref PolyVertex a, ref PolyVertex b, out PolyVertex result)
 Calculates the component-wise minimum of two vertices. More...
 
static PolyVertex ComponentMax (PolyVertex a, PolyVertex b)
 Calculates the component-wise maximum of two vertices. More...
 
static void ComponentMax (ref PolyVertex a, ref PolyVertex b, out PolyVertex result)
 Calculates the component-wise maximum of two vertices. More...
 
static bool IsLeft (ref PolyVertex a, ref PolyVertex b, ref PolyVertex c)
 Gets the leftness of a triangle formed from 3 contour vertices. More...
 
static bool IsLeftOn (ref PolyVertex a, ref PolyVertex b, ref PolyVertex c)
 Gets the leftness (left or on) of a triangle formed from 3 contour vertices. More...
 
static bool Equal2D (ref PolyVertex a, ref PolyVertex b)
 Compares vertex equality in 2D. More...
 
static bool Intersect (ref PolyVertex a, ref PolyVertex b, ref PolyVertex c, ref PolyVertex d)
 True if and only if segments AB and CD intersect, properly or improperly. More...
 
static bool IntersectProp (ref PolyVertex a, ref PolyVertex b, ref PolyVertex c, ref PolyVertex d)
 True if and only if segments AB and CD intersect properly. More...
 
static bool IsBetween (ref PolyVertex a, ref PolyVertex b, ref PolyVertex c)
 True if and only if A, B, and C are collinear and point C lies on closed segment AB More...
 
static bool IsCollinear (ref PolyVertex a, ref PolyVertex b, ref PolyVertex c)
 True if and only if points A, B, and C are collinear. More...
 
static void Area2D (ref PolyVertex a, ref PolyVertex b, ref PolyVertex c, out int area)
 Gets the 2D area of the triangle ABC. More...
 
static void Area2D (ref ContourVertex a, ref ContourVertex b, ref ContourVertex c, out int area)
 Gets the 2D area of the triangle ABC. More...
 
static bool operator== (PolyVertex left, PolyVertex right)
 Compares two vertices for equality. More...
 
static bool operator!= (PolyVertex left, PolyVertex right)
 Compares two vertices for inequality. More...
 

Public Attributes

int X
 The X coordinate. More...
 
int Y
 The Y coordinate. More...
 
int Z
 The Z coordinate. More...
 

Detailed Description

A vertex inside a PolyMesh.

Definition at line 14 of file PolyVertex.cs.

Constructor & Destructor Documentation

◆ PolyVertex()

SharpNav.PolyVertex.PolyVertex ( int  x,
int  y,
int  z 
)

Initializes a new instance of the PolyVertex struct.

Parameters
xThe X coordinate.
yThe Y coordinate.
zThe Z coordinate.

Definition at line 37 of file PolyVertex.cs.

Member Function Documentation

◆ Area2D() [1/2]

static void SharpNav.PolyVertex.Area2D ( ref ContourVertex  a,
ref ContourVertex  b,
ref ContourVertex  c,
out int  area 
)
static

Gets the 2D area of the triangle ABC.

Parameters
aPoint A of triangle ABC.
bPoint B of triangle ABC.
cPoint C of triangle ABC.
areaThe 2D area of the triangle.

Definition at line 231 of file PolyVertex.cs.

◆ Area2D() [2/2]

static void SharpNav.PolyVertex.Area2D ( ref PolyVertex  a,
ref PolyVertex  b,
ref PolyVertex  c,
out int  area 
)
static

Gets the 2D area of the triangle ABC.

Parameters
aPoint A of triangle ABC.
bPoint B of triangle ABC.
cPoint C of triangle ABC.
areaThe 2D area of the triangle.

Definition at line 219 of file PolyVertex.cs.

◆ ComponentMax() [1/2]

static PolyVertex SharpNav.PolyVertex.ComponentMax ( PolyVertex  a,
PolyVertex  b 
)
static

Calculates the component-wise maximum of two vertices.

Parameters
aA vertex.
bAnother vertex.
Returns
The component-wise maximum of the two vertices.

Definition at line 76 of file PolyVertex.cs.

◆ ComponentMax() [2/2]

static void SharpNav.PolyVertex.ComponentMax ( ref PolyVertex  a,
ref PolyVertex  b,
out PolyVertex  result 
)
static

Calculates the component-wise maximum of two vertices.

Parameters
aA vertex.
bAnother vertex.
resultThe component-wise maximum of the two vertices.

Definition at line 89 of file PolyVertex.cs.

◆ ComponentMin() [1/2]

static PolyVertex SharpNav.PolyVertex.ComponentMin ( PolyVertex  a,
PolyVertex  b 
)
static

Calculates the component-wise minimum of two vertices.

Parameters
aA vertex.
bAnother vertex.
Returns
The component-wise minimum of the two vertices.

Definition at line 50 of file PolyVertex.cs.

◆ ComponentMin() [2/2]

static void SharpNav.PolyVertex.ComponentMin ( ref PolyVertex  a,
ref PolyVertex  b,
out PolyVertex  result 
)
static

Calculates the component-wise minimum of two vertices.

Parameters
aA vertex.
bAnother vertex.
resultThe component-wise minimum of the two vertices.

Definition at line 63 of file PolyVertex.cs.

◆ Equal2D()

static bool SharpNav.PolyVertex.Equal2D ( ref PolyVertex  a,
ref PolyVertex  b 
)
static

Compares vertex equality in 2D.

Parameters
aA vertex.
bAnother vertex.
Returns
A value indicating whether the X and Z components of both vertices are equal.

Definition at line 130 of file PolyVertex.cs.

◆ Equals() [1/2]

override bool SharpNav.PolyVertex.Equals ( object  obj)

Compares an object with this instance for equality.

Parameters
objAn object.
Returns
A value indicating whether the object is equal to this instance.

Definition at line 273 of file PolyVertex.cs.

◆ Equals() [2/2]

bool SharpNav.PolyVertex.Equals ( PolyVertex  other)

Compares another PolyVertex with this instance for equality.

Parameters
otherThe other instance.
Returns
A value indicating whether the two vertices are equal.

Definition at line 263 of file PolyVertex.cs.

◆ GetHashCode()

override int SharpNav.PolyVertex.GetHashCode ( )

Gets a hash code unique to the contents of this instance.

Returns
A hash code.

Definition at line 286 of file PolyVertex.cs.

◆ Intersect()

static bool SharpNav.PolyVertex.Intersect ( ref PolyVertex  a,
ref PolyVertex  b,
ref PolyVertex  c,
ref PolyVertex  d 
)
static

True if and only if segments AB and CD intersect, properly or improperly.

Parameters
aPoint A of segment AB.
bPoint B of segment AB.
cPoint C of segment CD.
dPoint D of segment CD.
Returns
A value indicating whether segments AB and CD intersect.

Definition at line 143 of file PolyVertex.cs.

◆ IntersectProp()

static bool SharpNav.PolyVertex.IntersectProp ( ref PolyVertex  a,
ref PolyVertex  b,
ref PolyVertex  c,
ref PolyVertex  d 
)
static

True if and only if segments AB and CD intersect properly.

Proper intersection: A point interior to both segments is shared. Properness determined by strict leftness.

Parameters
aPoint A of segment AB.
bPoint B of segment AB.
cPoint C of segment CD.
dPoint D of segment CD.
Returns
A value indicating whether segements AB and CD are intersecting properly.

Definition at line 167 of file PolyVertex.cs.

◆ IsBetween()

static bool SharpNav.PolyVertex.IsBetween ( ref PolyVertex  a,
ref PolyVertex  b,
ref PolyVertex  c 
)
static

True if and only if A, B, and C are collinear and point C lies on closed segment AB

Parameters
aPoint A of segment AB.
bPoint B of segment AB.
cPoint C.
Returns
A value indicating whether the three points are collinear with C in the middle.

Definition at line 187 of file PolyVertex.cs.

◆ IsCollinear()

static bool SharpNav.PolyVertex.IsCollinear ( ref PolyVertex  a,
ref PolyVertex  b,
ref PolyVertex  c 
)
static

True if and only if points A, B, and C are collinear.

Parameters
aPoint A.
bPoint B.
cPoint C.
Returns
A value indicating whether the points are collinear.

Definition at line 205 of file PolyVertex.cs.

◆ IsLeft()

static bool SharpNav.PolyVertex.IsLeft ( ref PolyVertex  a,
ref PolyVertex  b,
ref PolyVertex  c 
)
static

Gets the leftness of a triangle formed from 3 contour vertices.

Parameters
aThe first vertex.
bThe second vertex.
cThe third vertex.
Returns
A value indicating the leftness of the triangle.

Definition at line 103 of file PolyVertex.cs.

◆ IsLeftOn()

static bool SharpNav.PolyVertex.IsLeftOn ( ref PolyVertex  a,
ref PolyVertex  b,
ref PolyVertex  c 
)
static

Gets the leftness (left or on) of a triangle formed from 3 contour vertices.

Parameters
aThe first vertex.
bThe second vertex.
cThe third vertex.
Returns
A value indicating whether the triangle is left or on.

Definition at line 117 of file PolyVertex.cs.

◆ operator!=()

static bool SharpNav.PolyVertex.operator!= ( PolyVertex  left,
PolyVertex  right 
)
static

Compares two vertices for inequality.

Parameters
leftA vertex.
rightAnother vertex.
Returns
A value indicating whether the two vertices are not equal.

Definition at line 253 of file PolyVertex.cs.

◆ operator==()

static bool SharpNav.PolyVertex.operator== ( PolyVertex  left,
PolyVertex  right 
)
static

Compares two vertices for equality.

Parameters
leftA vertex.
rightAnother vertex.
Returns
A value indicating whether the two vertices are equal.

Definition at line 242 of file PolyVertex.cs.

◆ ToString()

override string SharpNav.PolyVertex.ToString ( )

Gets a human-readable version of the vertex.

Returns
A string.

Definition at line 296 of file PolyVertex.cs.

Member Data Documentation

◆ X

int SharpNav.PolyVertex.X

The X coordinate.

Definition at line 19 of file PolyVertex.cs.

◆ Y

int SharpNav.PolyVertex.Y

The Y coordinate.

Definition at line 24 of file PolyVertex.cs.

◆ Z

int SharpNav.PolyVertex.Z

The Z coordinate.

Definition at line 29 of file PolyVertex.cs.


The documentation for this struct was generated from the following file: