Pathfinder
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Pathfinder::Polygon Struct Reference

A struct that represents a single polygon. More...

#include <Polygon.h>

Collaboration diagram for Pathfinder::Polygon:

Public Member Functions

 Polygon (const Geometry::Vec3 &p1, const Geometry::Vec3 &p2, const Geometry::Vec3 &p3, MinSG::GeometryNode *geoNodePtr)
 A constructor that creates a poylgon out of three points. More...
 
 Polygon (const std::tuple< Geometry::Vec3, Geometry::Vec3, Geometry::Vec3 > &points, MinSG::GeometryNode *geoNodePtr)
 A constructor that creates a polyon out of a tuple of points. More...
 
Geometry::Vec3 getVertex (const short &idx)
 Return the vertex associated with the given index. More...
 

Static Public Member Functions

static Geometry::Vec3 polygonCenter (const Geometry::Vec3 &p1, const Geometry::Vec3 &p2, const Geometry::Vec3 &p3)
 Compute the center point of a polygon. More...
 
static Geometry::Vec3 polygonNormal (const Geometry::Vec3 &p1, const Geometry::Vec3 &p2, const Geometry::Vec3 &p3)
 Compute the normal vector of a polygon. More...
 

Public Attributes

Geometry::Vec3 p1
 The first vertex of the polygon. More...
 
Geometry::Vec3 p2
 The second vertex of the polygon. More...
 
Geometry::Vec3 p3
 The third vertex of the polygon. More...
 
Geometry::Vec3 center
 The center point of the polygon. More...
 
Geometry::Vec3 normal
 The normal vector of the polygon. More...
 
Geometry::Vec3 min
 The lower corner of this polygon's AABB. More...
 
Geometry::Vec3 max
 The upper corner of this polygon's AABB. More...
 
MinSG::GeometryNode * geoNodePtr
 A pointer to the GeometryNode from which this polygon originates. More...
 

Detailed Description

A struct that represents a single polygon.

Constructor & Destructor Documentation

◆ Polygon() [1/2]

Pathfinder::Polygon::Polygon ( const Geometry::Vec3 &  p1,
const Geometry::Vec3 &  p2,
const Geometry::Vec3 &  p3,
MinSG::GeometryNode *  geoNodePtr 
)

A constructor that creates a poylgon out of three points.

Parameters
p1The first vertex.
p2The second vertex.
p3The third vertex.
geoNodePtrA pointer to the GeometryNode containing the source mesh.

◆ Polygon() [2/2]

Pathfinder::Polygon::Polygon ( const std::tuple< Geometry::Vec3, Geometry::Vec3, Geometry::Vec3 > &  points,
MinSG::GeometryNode *  geoNodePtr 
)

A constructor that creates a polyon out of a tuple of points.

Parameters
pointsA tuple containing the three vertices.
geoNodePtrA pointer to the GeometryNode containing the source mesh.

Member Function Documentation

◆ getVertex()

Geometry::Vec3 Pathfinder::Polygon::getVertex ( const short &  idx)

Return the vertex associated with the given index.

0 = p1, 1 = p2, 2 = p3.

Parameters
idxThe index of the vertex.
Returns
The vertex associated to idx.

◆ polygonCenter()

Geometry::Vec3 Pathfinder::Polygon::polygonCenter ( const Geometry::Vec3 &  p1,
const Geometry::Vec3 &  p2,
const Geometry::Vec3 &  p3 
)
static

Compute the center point of a polygon.

Parameters
p1The first vertex of the polygon.
p2The second vertex of the polygon.
p3The third vertex of the polygon.
Returns
The center point of the polygon defined by p1, p2 and p3.

◆ polygonNormal()

Geometry::Vec3 Pathfinder::Polygon::polygonNormal ( const Geometry::Vec3 &  p1,
const Geometry::Vec3 &  p2,
const Geometry::Vec3 &  p3 
)
static

Compute the normal vector of a polygon.

Parameters
p1The first vertex of the polygon.
p2The second vertex of the polygon.
p3The third vertex of the polygon.
Returns
The normal vector of the polygon defined by p1, p2 and p3.

Member Data Documentation

◆ center

Geometry::Vec3 Pathfinder::Polygon::center

The center point of the polygon.

◆ geoNodePtr

MinSG::GeometryNode* Pathfinder::Polygon::geoNodePtr

A pointer to the GeometryNode from which this polygon originates.

◆ max

Geometry::Vec3 Pathfinder::Polygon::max

The upper corner of this polygon's AABB.

◆ min

Geometry::Vec3 Pathfinder::Polygon::min

The lower corner of this polygon's AABB.

◆ normal

Geometry::Vec3 Pathfinder::Polygon::normal

The normal vector of the polygon.

◆ p1

Geometry::Vec3 Pathfinder::Polygon::p1

The first vertex of the polygon.

◆ p2

Geometry::Vec3 Pathfinder::Polygon::p2

The second vertex of the polygon.

◆ p3

Geometry::Vec3 Pathfinder::Polygon::p3

The third vertex of the polygon.


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