Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::scene::loader::Bezier< VertexType > Class Template Reference
+ Inheritance diagram for oe::scene::loader::Bezier< VertexType >:
+ Collaboration diagram for oe::scene::loader::Bezier< VertexType >:

Classes

struct  BuildMeshInfo
 

Public Types

using BezierMeshType = oe::scene::Mesh< VertexType >
 
- Public Types inherited from oe::scene::Mesh< VertexType, IndexType, MeshSettingsType >
using vertex_type = VertexType
 
using index_type = IndexType
 
using VertexContainerType = MeshSettingsType::VertexContainerType
 
using IndexContainerType = MeshSettingsType::IndexContainerType
 

Public Member Functions

 Bezier (const BezierPatchType type)
 
void addControlPoint (const Vertex &point)
 
void setControlPoints (const std::vector< Vertex > &points)
 
const std::vector< Vertex > & getControlPoints () const
 
void buildMesh (const BuildMeshInfo &params, BezierMeshType &result)
 Build a mesh Bezier surface (using De Casteljau's algorithm)
 
template<util::CurveValueConcept T>
calculateDerivateU (std::span< const T > control_points, const float u, const float v)
 Calculate derivative point of the bezier patch along the u coordinate.
 
template<util::CurveValueConcept T>
calculateDerivateV (std::span< const T > control_points, const float u, const float v)
 Calculate derivative point of the bezier patch along the u coordinate.
 
template<typename T >
calculatePatch (const std::vector< T > &control_points, const float u, const float v)
 Calculate point of the bezier patch along the u and v coordinates.
 
- Public Member Functions inherited from oe::scene::Mesh< VertexType, IndexType, MeshSettingsType >
constexpr AABB getPrimitiveBoundingBox (size_t primitive) const noexcept
 Generate bounding box for the specified primitive.
 
template<typename F >
constexpr AABB getPrimitiveBoundingBox (size_t primitive, F &&predicate) const noexcept
 Generate bounding box for the specified primitive containing vertices matching a predicate.
 
constexpr AABB getBoundingBox () const noexcept
 Generate englobing mesh bounding box.
 
constexpr void flipFaces ()
 
constexpr const std::vector< glm::uvec3 > getTriangles () const
 Get groups of 3 indices that form triangles.
 
constexpr void generateNormals ()
 Generate mesh normals from vertices positions.
 
constexpr void generateTangents ()
 Compute Tangents using mikkTSpace.
 

Additional Inherited Members

- Static Public Member Functions inherited from oe::scene::Mesh< VertexType, IndexType, MeshSettingsType >
template<typename PrimitiveType >
static Mesh generateFromPrimitives (std::span< const PrimitiveType > primitives)
 Generate a mesh from primitives.
 
- Public Attributes inherited from oe::scene::Mesh< VertexType, IndexType, MeshSettingsType >
VertexContainerType vertices
 
IndexContainerType indices
 
MeshSettingsType::PrimitivesContainerType primitives = {}
 

Member Function Documentation

◆ buildMesh()

template<typename VertexType = Vertex>
void oe::scene::loader::Bezier< VertexType >::buildMesh ( const BuildMeshInfo params,
BezierMeshType result 
)
inline

Build a mesh Bezier surface (using De Casteljau's algorithm)

Parameters
paramsParameters, see BuildMeshInfo
resultFinal mesh that will contains bezier surfaces

For example, lower lod values could be used to generate mesh for collision or simplified render

Returns
the mesh created

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