Castor3D 0.16.0
Multiplatform 3D engine
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
castor3d::TriFaceMapping Class Reference

#include <TriFaceMapping.hpp>

Inheritance diagram for castor3d::TriFaceMapping:
Inheritance graph
[legend]
Collaboration diagram for castor3d::TriFaceMapping:
Collaboration graph
[legend]

Classes

struct  ComponentData
 
class  Plugin
 

Public Member Functions

C3D_API TriFaceMapping (Submesh &submesh, VkBufferUsageFlags bufferUsageFlags={})
 Constructor.
 
C3D_API void computeFacesFromPolygonVertex ()
 Creates faces from the points.
 
C3D_API void computeNormals (castor::Point3fArray const &positions, castor::Point3fArray &normals, bool reverted=false) const
 Computes normal for each vertex of the given face.
 
C3D_API void computeTangentsFromNormals (castor::Point3fArray const &positions, castor::Point3fArray const &texcoords, castor::Point3fArray const &normals, castor::Point4fArray &tangents) const
 Computes tangent for each vertex of the submesh.
 
C3D_API uint32_t getCount () const override
 
C3D_API uint32_t getComponentsCount () const override
 
C3D_API void computeNormals (bool reverted=false) override
 Generates normals.
 
C3D_API void computeTangents () override
 Generates tangents.
 
C3D_API SubmeshComponentUPtr clone (Submesh &submesh) const override
 Clones this component into given submesh.
 
ComponentDatagetData () const noexcept
 
- Public Member Functions inherited from castor3d::IndexMapping
C3D_API IndexMapping (Submesh &submesh, castor::String const &type, SubmeshComponentDataUPtr data)
 Constructor.
 
- Public Member Functions inherited from castor3d::SubmeshComponent
C3D_API SubmeshComponent (Submesh &submesh, castor::String const &type, SubmeshComponentDataUPtr data={}, castor::StringArray deps={})
 Constructor.
 
virtual C3D_API ~SubmeshComponent () noexcept=default
 Destructor.
 
virtual C3D_API bool writeText (castor::String const &tabs, castor::Path const &folder, castor::String const &subfolder, castor::StringStream &file) const
 Writes the component content to text.
 
virtual C3D_API void accept (ConfigurationVisitorBase &vis)
 ConfigurationVisitorBase acceptance function.
 
virtual C3D_API SubmeshComponentFlag getSubmeshFlags () const noexcept
 
virtual C3D_API ProgramFlags getProgramFlags (Pass const &pass) const noexcept
 
C3D_API void initialiseRenderData ()
 Initialises the render data specific for this component's submesh.
 
castor::String const & getType () const noexcept
 
castor::StringArray const & getDependencies () const noexcept
 
SubmeshComponentPlugin const & getPlugin () const noexcept
 
SubmeshComponentID getId () const noexcept
 
SubmeshComponentDataRPtr getBaseData () const noexcept
 
SubmeshRenderDatagetRenderData () const noexcept
 
template<typename DataT >
DataT * getDataT () const noexcept
 
template<typename DataT >
DataT * getRenderDataT () const noexcept
 
- Public Member Functions inherited from castor::OwnedBy< Submesh >
Submesh * getOwner () const
 

Static Public Member Functions

static SubmeshComponentPluginUPtr createPlugin (SubmeshComponentRegister const &submeshComponents)
 

Static Public Attributes

static C3D_API castor::String const TypeName
 

Additional Inherited Members

- Protected Member Functions inherited from castor::OwnedBy< Submesh >
 OwnedBy (Submesh &owner)
 Constructor.
 
- Protected Attributes inherited from castor3d::SubmeshComponent
SubmeshComponentDataUPtr m_data
 
SubmeshRenderDataPtr m_renderData
 

Constructor & Destructor Documentation

◆ TriFaceMapping()

C3D_API castor3d::TriFaceMapping::TriFaceMapping ( Submesh & submesh,
VkBufferUsageFlags bufferUsageFlags = {} )
explicit

Constructor.

Parameters
[in]submeshThe parent submesh.
[in]bufferUsageFlagsThe buffer usage flags.

Member Function Documentation

◆ clone()

C3D_API SubmeshComponentUPtr castor3d::TriFaceMapping::clone ( Submesh & submesh) const
overridevirtual

Clones this component into given submesh.

Parameters
[in,out]submeshReceives the cloned component.

Implements castor3d::SubmeshComponent.

◆ computeFacesFromPolygonVertex()

C3D_API void castor3d::TriFaceMapping::computeFacesFromPolygonVertex ( )

Creates faces from the points.

Remarks
This function assumes the points are sorted like triangles fan.

◆ computeNormals() [1/2]

C3D_API void castor3d::TriFaceMapping::computeNormals ( bool reverted = false)
overridevirtual

Generates normals.

Parameters
[in]revertedTells if normals are inverted.

Implements castor3d::IndexMapping.

◆ computeNormals() [2/2]

C3D_API void castor3d::TriFaceMapping::computeNormals ( castor::Point3fArray const & positions,
castor::Point3fArray & normals,
bool reverted = false ) const

Computes normal for each vertex of the given face.

Parameters
[in]positionsThe vertices positions.
[out]normalsThe vertices normals.
[in]revertedtrue to invert normals.

◆ computeTangents()

C3D_API void castor3d::TriFaceMapping::computeTangents ( )
overridevirtual

Generates tangents.

Remarks
This function supposes the normals are defined.

Implements castor3d::IndexMapping.

◆ computeTangentsFromNormals()

C3D_API void castor3d::TriFaceMapping::computeTangentsFromNormals ( castor::Point3fArray const & positions,
castor::Point3fArray const & texcoords,
castor::Point3fArray const & normals,
castor::Point4fArray & tangents ) const

Computes tangent for each vertex of the submesh.

Remarks
This function supposes the normals are defined.
Parameters
[in]positionsThe vertices positions.
[in]texcoordsThe vertices texture coordinates.
[in]normalsThe vertices normals.
[out]tangentsThe vertices tangents.

◆ createPlugin()

static SubmeshComponentPluginUPtr castor3d::TriFaceMapping::createPlugin ( SubmeshComponentRegister const & submeshComponents)
inlinestatic

◆ getComponentsCount()

C3D_API uint32_t castor3d::TriFaceMapping::getComponentsCount ( ) const
overridevirtual

Returns
The components count in an element.

Implements castor3d::IndexMapping.

◆ getCount()

C3D_API uint32_t castor3d::TriFaceMapping::getCount ( ) const
overridevirtual

Returns
The elements count.

Implements castor3d::IndexMapping.

◆ getData()

ComponentData & castor3d::TriFaceMapping::getData ( ) const
inlinenoexcept

Member Data Documentation

◆ TypeName

C3D_API castor::String const castor3d::TriFaceMapping::TypeName
static

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