Castor3D 0.12.0
Multiplatform 3D engine
Public Member Functions | Static Public Attributes | List of all members
castor3d::LinesMapping Class Reference

#include <LinesMapping.hpp>

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

Public Member Functions

C3D_API LinesMapping (Submesh &submesh, VkBufferUsageFlags bufferUsageFlags={})
 Constructor. More...
 
C3D_API void clearLines ()
 Clears the lines array. More...
 
C3D_API Line addLine (uint32_t a, uint32_t b)
 Creates and adds a line to the submesh. More...
 
C3D_API void addLineGroup (LineIndices const *const begin, LineIndices const *const end)
 Creates and adds lines to the submesh. More...
 
C3D_API uint32_t getCount () const override
 
C3D_API uint32_t getComponentsCount () const override
 
C3D_API void sortByDistance (castor::Point3f const &cameraPosition) override
 Sorts the face from farthest to nearest from the camera. More...
 
C3D_API void computeNormals (bool reverted=false) override
 Generates normals and tangents. More...
 
C3D_API SubmeshComponentSPtr clone (Submesh &submesh) const override
 
void addLineGroup (std::vector< LineIndices > const &lines)
 Creates and adds lines to the submesh. More...
 
template<size_t Count>
void addLineGroup (std::array< LineIndices, Count > const &lines)
 Creates and adds lines to the submesh. More...
 
template<uint32_t Count>
void addLineGroup (LineIndices(&lines)[Count])
 Creates and adds lines to the submesh. More...
 
Line const & operator[] (uint32_t index) const
 Retrieves the line at given index. More...
 
LineArray const & getFaces () const
 
LineArraygetFaces ()
 
- Public Member Functions inherited from castor3d::IndexMapping
C3D_API IndexMapping (Submesh &submesh, castor::String const &type, VkBufferUsageFlags bufferUsageFlags)
 Constructor. More...
 
virtual C3D_API uint32_t getCount () const =0
 
virtual C3D_API uint32_t getComponentsCount () const =0
 
virtual C3D_API void sortByDistance (castor::Point3f const &cameraPosition)=0
 Sorts the face from farthest to nearest from the camera. More...
 
virtual C3D_API void computeNormals (bool reverted=false)=0
 Generates normals and tangents. More...
 
void gather (ShaderFlags const &shaderFlags, ProgramFlags const &programFlags, MaterialRPtr material, ashes::BufferCRefArray &buffers, std::vector< uint64_t > &offsets, ashes::PipelineVertexInputStateCreateInfoCRefArray &layouts, TextureFlagsArray const &mask, uint32_t &currentLocation) override
 Gathers buffers that need to go in a vertex layout. More...
 
ProgramFlags getProgramFlags (MaterialRPtr material) const override
 
VkBufferUsageFlags getUsageFlags () const override
 
- Public Member Functions inherited from castor3d::SubmeshComponent
C3D_API SubmeshComponent (Submesh &submesh, castor::String const &type, uint32_t id)
 Constructor. More...
 
virtual C3D_API ~SubmeshComponent () noexcept=default
 Destructor. More...
 
C3D_API bool initialise (RenderDevice const &device)
 Initialises the submesh. More...
 
C3D_API void cleanup (RenderDevice const &device)
 Cleans the submesh. More...
 
C3D_API void upload ()
 Uploads data on VRAM. More...
 
virtual C3D_API void gather (ShaderFlags const &shaderFlags, ProgramFlags const &programFlags, MaterialRPtr material, ashes::BufferCRefArray &buffers, std::vector< uint64_t > &offsets, ashes::PipelineVertexInputStateCreateInfoCRefArray &layouts, TextureFlagsArray const &mask, uint32_t &currentLocation)=0
 Gathers buffers that need to go in a vertex layout. More...
 
virtual C3D_API ProgramFlags getProgramFlags (MaterialRPtr material) const =0
 
virtual C3D_API VkBufferUsageFlags getUsageFlags () const
 
virtual C3D_API SubmeshComponentSPtr clone (Submesh &submesh) const =0
 
castor::String const & getType () const
 
void needsUpdate ()
 Sets the component to be updated. More...
 
uint32_t getID ()
 

Static Public Attributes

static C3D_API castor::String const Name
 

Additional Inherited Members

- Protected Attributes inherited from castor3d::IndexMapping
StagingDataUPtr m_staging
 

Constructor & Destructor Documentation

◆ LinesMapping()

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

Constructor.

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

Member Function Documentation

◆ addLine()

C3D_API Line castor3d::LinesMapping::addLine ( uint32_t  a,
uint32_t  b 
)

Creates and adds a line to the submesh.

Parameters
[in]aThe first vertex index.
[in]bThe second vertex index.
Returns
The created face.

◆ addLineGroup() [1/4]

C3D_API void castor3d::LinesMapping::addLineGroup ( LineIndices const *const  begin,
LineIndices const *const  end 
)

Creates and adds lines to the submesh.

Parameters
[in]beginThe faces data begin.
[in]endThe faces data end.

Referenced by addLineGroup().

Here is the caller graph for this function:

◆ addLineGroup() [2/4]

template<uint32_t Count>
void castor3d::LinesMapping::addLineGroup ( LineIndices(&)  lines[Count])
inline

Creates and adds lines to the submesh.

Parameters
[in]linesThe lines.

References addLineGroup().

Here is the call graph for this function:

◆ addLineGroup() [3/4]

template<size_t Count>
void castor3d::LinesMapping::addLineGroup ( std::array< LineIndices, Count > const &  lines)
inline

Creates and adds lines to the submesh.

Parameters
[in]linesThe lines.

References addLineGroup().

Here is the call graph for this function:

◆ addLineGroup() [4/4]

void castor3d::LinesMapping::addLineGroup ( std::vector< LineIndices > const &  lines)
inline

Creates and adds lines to the submesh.

Parameters
[in]linesThe lines.

References addLineGroup().

Here is the call graph for this function:

◆ clearLines()

C3D_API void castor3d::LinesMapping::clearLines ( )

Clears the lines array.

◆ clone()

C3D_API SubmeshComponentSPtr castor3d::LinesMapping::clone ( Submesh submesh) const
overridevirtual

Returns
Clones this component into given submesh.
Parameters
[in,out]submeshReceives the cloned component.

Implements castor3d::SubmeshComponent.

◆ computeNormals()

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

Generates normals and tangents.

Parameters
[in]revertedTells if normals are inverted.

Implements castor3d::IndexMapping.

◆ getComponentsCount()

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

Returns
The components count in an element.

Implements castor3d::IndexMapping.

◆ getCount()

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

Returns
The elements count.

Implements castor3d::IndexMapping.

◆ getFaces() [1/2]

LineArray & castor3d::LinesMapping::getFaces ( )
inline
Returns
The lines array.

◆ getFaces() [2/2]

LineArray const & castor3d::LinesMapping::getFaces ( ) const
inline
Returns
The lines array.

◆ operator[]()

Line const & castor3d::LinesMapping::operator[] ( uint32_t  index) const
inline

Retrieves the line at given index.

Parameters
[in]indexThe index.
Returns
The value.

◆ sortByDistance()

C3D_API void castor3d::LinesMapping::sortByDistance ( castor::Point3f const &  cameraPosition)
overridevirtual

Sorts the face from farthest to nearest from the camera.

Parameters
[in]cameraPositionThe camera position, relative to submesh

Implements castor3d::IndexMapping.

Member Data Documentation

◆ Name

C3D_API castor::String const castor3d::LinesMapping::Name
static

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