Diligent Engine
 
Loading...
Searching...
No Matches
Diligent::Polygon3DTriangulator< IndexType, ComponentType > Class Template Reference

3D polygon triangulator. More...

#include <AdvancedMath.hpp>

Inheritance diagram for Diligent::Polygon3DTriangulator< IndexType, ComponentType >:
Diligent::Polygon2DTriangulator< std::enable_if< std::is_floating_point< ComponentType >::value, IndexType >::type >

Public Member Functions

const std::vector< IndexType > & Triangulate (const std::vector< Vector3< ComponentType > > &Polygon)
 Triangulates a simple polygon in 3D.
 
- Public Member Functions inherited from Diligent::Polygon2DTriangulator< std::enable_if< std::is_floating_point< ComponentType >::value, IndexType >::type >
const std::vector< IndexType > & Triangulate (const std::vector< Vector2< ComponentType > > &Polygon)
 Triangulates a simple polygon using the ear-clipping algorithm.
 

Detailed Description

template<typename IndexType, typename ComponentType>
class Diligent::Polygon3DTriangulator< IndexType, ComponentType >

3D polygon triangulator.

The class extends the Polygon2DTriangulator class to handle simple 3D polygons. It first projects the polygon onto a plane and then triangulates the resulting 2D polygon.

Template Parameters
IndexType- Index type (e.g. Uint32 or Uint16).
ComponentType- Vertex component type, must be a floating point type (e.g. float or double).

Member Function Documentation

◆ Triangulate()

template<typename IndexType, typename ComponentType>
const std::vector< IndexType > & Diligent::Polygon3DTriangulator< IndexType, ComponentType >::Triangulate ( const std::vector< Vector3< ComponentType > > & Polygon)
inline

Triangulates a simple polygon in 3D.

The function first projects the polygon onto a plane and then triangulates the resulting 2D polygon.

If vertices are not coplanar, the result is undefined.