Dungeon Architect  17.0.0
SharpNav.Geometry.Triangle3 Struct Reference

A 3d triangle. More...

Inheritance diagram for SharpNav.Geometry.Triangle3:

Public Member Functions

 Triangle3 (Vector3 a, Vector3 b, Vector3 c)
 Initializes a new instance of the Triangle3 struct. More...
 
bool Equals (Triangle3 other)
 Checks for equality with another Triangle3. More...
 
override bool Equals (object obj)
 Checks for equality with another object. More...
 
override int GetHashCode ()
 Gets a unique hash code for the triangle. More...
 
override string ToString ()
 Converts the triangle's data into a human-readable format. More...
 

Static Public Member Functions

static bool operator== (Triangle3 left, Triangle3 right)
 Compares two Triangle3's for equality. More...
 
static bool operator!= (Triangle3 left, Triangle3 right)
 Compares two Triangle3's for inequality. More...
 
static BBox3 GetBoundingBox (Triangle3 tri)
 Calculates the bounding box of a triangle. More...
 
static void GetBoundingBox (ref Triangle3 tri, out BBox3 bbox)
 Calculates the bounding box of a triangle. More...
 
static void GetBoundingBox (ref Vector3 a, ref Vector3 b, ref Vector3 c, out BBox3 bbox)
 Calculates the bounding box of a triangle from its vertices. More...
 
static void Area2D (ref Vector3 a, ref Vector3 b, ref Vector3 c, out float area)
 Gets the area of the triangle projected onto the XZ-plane. More...
 
static float Area2D (Vector3 a, Vector3 b, Vector3 c)
 Gets the area of the triangle projected onto the XZ-plane. More...
 

Public Attributes

Vector3 A
 The first point. More...
 
Vector3 B
 The second point. More...
 
Vector3 C
 The third point. More...
 

Properties

Vector3 AB [get]
 Gets the directed line segment from A to B. More...
 
Vector3 AC [get]
 Gets the directed line segment from A to C. More...
 
Vector3 BA [get]
 Gets the directed line segment from B to A. More...
 
Vector3 BC [get]
 Gets the directed line segment from B to C. More...
 
Vector3 CA [get]
 Gets the directed line segment from C to A. More...
 
Vector3 CB [get]
 Gets the directed line segment from C to B. More...
 
float Area [get]
 Gets the area of the triangle. More...
 
float Perimeter [get]
 Gets the perimeter of the triangle. More...
 
Vector3 Centroid [get]
 Gets the centroid of the triangle. More...
 
Vector3 Normal [get]
 Gets the Triangle3's surface normal. Assumes clockwise ordering of A, B, and C. More...
 

Detailed Description

A 3d triangle.

Definition at line 22 of file Triangle3.cs.

Constructor & Destructor Documentation

◆ Triangle3()

SharpNav.Geometry.Triangle3.Triangle3 ( Vector3  a,
Vector3  b,
Vector3  c 
)

Initializes a new instance of the Triangle3 struct.

Parameters
aThe second point.
bThe first point.
cThe third point.

Definition at line 51 of file Triangle3.cs.

Member Function Documentation

◆ Area2D() [1/2]

static void SharpNav.Geometry.Triangle3.Area2D ( ref Vector3  a,
ref Vector3  b,
ref Vector3  c,
out float  area 
)
static

Gets the area of the triangle projected onto the XZ-plane.

Parameters
aThe first point.
bThe second point.
cThe third point.
areaThe calculated area.

Definition at line 273 of file Triangle3.cs.

◆ Area2D() [2/2]

static float SharpNav.Geometry.Triangle3.Area2D ( Vector3  a,
Vector3  b,
Vector3  c 
)
static

Gets the area of the triangle projected onto the XZ-plane.

Parameters
aThe first point.
bThe second point.
cThe third point.
Returns
The calculated area.

Definition at line 289 of file Triangle3.cs.

◆ Equals() [1/2]

override bool SharpNav.Geometry.Triangle3.Equals ( object  obj)

Checks for equality with another object.

Parameters
objThe other object.
Returns
A value indicating whether other is equivalent to the triangle.

Definition at line 314 of file Triangle3.cs.

◆ Equals() [2/2]

bool SharpNav.Geometry.Triangle3.Equals ( Triangle3  other)

Checks for equality with another Triangle3.

Parameters
otherThe other triangle.
Returns
A value indicating whether other is equivalent to the triangle.

Definition at line 301 of file Triangle3.cs.

◆ GetBoundingBox() [1/3]

static void SharpNav.Geometry.Triangle3.GetBoundingBox ( ref Triangle3  tri,
out BBox3  bbox 
)
static

Calculates the bounding box of a triangle.

Parameters
triA triangle.
bboxThe triangle's bounding box.

Definition at line 232 of file Triangle3.cs.

◆ GetBoundingBox() [2/3]

static void SharpNav.Geometry.Triangle3.GetBoundingBox ( ref Vector3  a,
ref Vector3  b,
ref Vector3  c,
out BBox3  bbox 
)
static

Calculates the bounding box of a triangle from its vertices.

Parameters
aThe first vertex.
bThe second vertex.
cThe third vertex.
bboxThe bounding box between the points.

Definition at line 244 of file Triangle3.cs.

◆ GetBoundingBox() [3/3]

static BBox3 SharpNav.Geometry.Triangle3.GetBoundingBox ( Triangle3  tri)
static

Calculates the bounding box of a triangle.

Parameters
triA triangle.
Returns
The triangle's bounding box.

Definition at line 220 of file Triangle3.cs.

◆ GetHashCode()

override int SharpNav.Geometry.Triangle3.GetHashCode ( )

Gets a unique hash code for the triangle.

Returns
A hash code.

Definition at line 328 of file Triangle3.cs.

◆ operator!=()

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

Compares two Triangle3's for inequality.

Parameters
leftThe first triangle.
rightThe second triangle.
Returns
A value indicating whether the two triangles are not equal.

Definition at line 206 of file Triangle3.cs.

◆ operator==()

static bool SharpNav.Geometry.Triangle3.operator== ( Triangle3  left,
Triangle3  right 
)
static

Compares two Triangle3's for equality.

Parameters
leftThe first triangle.
rightThe second triangle.
Returns
A value indicating whether the two triangles are equal.

Definition at line 195 of file Triangle3.cs.

◆ ToString()

override string SharpNav.Geometry.Triangle3.ToString ( )

Converts the triangle's data into a human-readable format.

Returns
A string containing the triangle's data.

Definition at line 342 of file Triangle3.cs.

Member Data Documentation

◆ A

Vector3 SharpNav.Geometry.Triangle3.A

The first point.

Definition at line 29 of file Triangle3.cs.

◆ B

Vector3 SharpNav.Geometry.Triangle3.B

The second point.

Definition at line 34 of file Triangle3.cs.

◆ C

Vector3 SharpNav.Geometry.Triangle3.C

The third point.

Definition at line 39 of file Triangle3.cs.

Property Documentation

◆ AB

Vector3 SharpNav.Geometry.Triangle3.AB
get

Gets the directed line segment from A to B.

Definition at line 65 of file Triangle3.cs.

◆ AC

Vector3 SharpNav.Geometry.Triangle3.AC
get

Gets the directed line segment from A to C.

Definition at line 78 of file Triangle3.cs.

◆ Area

float SharpNav.Geometry.Triangle3.Area
get

Gets the area of the triangle.

Definition at line 143 of file Triangle3.cs.

◆ BA

Vector3 SharpNav.Geometry.Triangle3.BA
get

Gets the directed line segment from B to A.

Definition at line 91 of file Triangle3.cs.

◆ BC

Vector3 SharpNav.Geometry.Triangle3.BC
get

Gets the directed line segment from B to C.

Definition at line 104 of file Triangle3.cs.

◆ CA

Vector3 SharpNav.Geometry.Triangle3.CA
get

Gets the directed line segment from C to A.

Definition at line 117 of file Triangle3.cs.

◆ CB

Vector3 SharpNav.Geometry.Triangle3.CB
get

Gets the directed line segment from C to B.

Definition at line 130 of file Triangle3.cs.

◆ Centroid

Vector3 SharpNav.Geometry.Triangle3.Centroid
get

Gets the centroid of the triangle.

Definition at line 165 of file Triangle3.cs.

◆ Normal

Vector3 SharpNav.Geometry.Triangle3.Normal
get

Gets the Triangle3's surface normal. Assumes clockwise ordering of A, B, and C.

Definition at line 177 of file Triangle3.cs.

◆ Perimeter

float SharpNav.Geometry.Triangle3.Perimeter
get

Gets the perimeter of the triangle.

Definition at line 154 of file Triangle3.cs.


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