PolyVox  0.3.0-dev
Open source voxel management library
Public Member Functions | Public Attributes | List of all members
PolyVox::SurfaceMesh< VertexType > Class Template Reference

#include <SurfaceMesh.h>

+ Inheritance diagram for PolyVox::SurfaceMesh< VertexType >:
+ Collaboration diagram for PolyVox::SurfaceMesh< VertexType >:

Public Member Functions

 SurfaceMesh ()
 
 ~SurfaceMesh ()
 
const std::vector< uint32_t > & getIndices (void) const
 
uint32_t getNoOfIndices (void) const
 
uint32_t getNoOfNonUniformTrianges (void) const
 
uint32_t getNoOfUniformTrianges (void) const
 
uint32_t getNoOfVertices (void) const
 
std::vector< VertexType > & getRawVertexData (void)
 
const std::vector< VertexType > & getVertices (void) const
 
void addTriangle (uint32_t index0, uint32_t index1, uint32_t index2)
 
void addTriangleCubic (uint32_t index0, uint32_t index1, uint32_t index2)
 
uint32_t addVertex (const VertexType &vertex)
 
void clear (void)
 
bool isEmpty (void) const
 
void scaleVertices (float amount)
 
void translateVertices (const Vector3DFloat &amount)
 
int noOfDegenerateTris (void)
 This function can help improve the visual appearance of a surface patch by smoothing normals with other nearby normals.
 
void removeDegenerateTris (void)
 
void removeUnusedVertices (void)
 

Public Attributes

Region m_Region
 
int32_t m_iTimeStamp
 
int32_t m_iNoOfLod0Tris
 
std::vector< uint32_tm_vecTriangleIndices
 
std::vector< VertexType > m_vecVertices
 
std::vector< LodRecordm_vecLodRecords
 

Detailed Description

template<typename VertexType>
class PolyVox::SurfaceMesh< VertexType >

Definition at line 49 of file SurfaceMesh.h.

Constructor & Destructor Documentation

template<typename VertexType >
SurfaceMesh< VertexType >::SurfaceMesh ( )

Definition at line 27 of file SurfaceMesh.inl.

template<typename VertexType >
SurfaceMesh< VertexType >::~SurfaceMesh ( )

Definition at line 33 of file SurfaceMesh.inl.

Member Function Documentation

template<typename VertexType >
void SurfaceMesh< VertexType >::addTriangle ( uint32_t  index0,
uint32_t  index1,
uint32_t  index2 
)

Definition at line 101 of file SurfaceMesh.inl.

template<typename VertexType >
void SurfaceMesh< VertexType >::addTriangleCubic ( uint32_t  index0,
uint32_t  index1,
uint32_t  index2 
)

Definition at line 114 of file SurfaceMesh.inl.

template<typename VertexType>
uint32_t SurfaceMesh< VertexType >::addVertex ( const VertexType &  vertex)

Definition at line 127 of file SurfaceMesh.inl.

template<typename VertexType >
void SurfaceMesh< VertexType >::clear ( void  )

Definition at line 134 of file SurfaceMesh.inl.

template<typename VertexType >
const std::vector< uint32_t > & SurfaceMesh< VertexType >::getIndices ( void  ) const

Definition at line 38 of file SurfaceMesh.inl.

template<typename VertexType >
uint32_t SurfaceMesh< VertexType >::getNoOfIndices ( void  ) const

Definition at line 44 of file SurfaceMesh.inl.

template<typename VertexType >
uint32_t SurfaceMesh< VertexType >::getNoOfNonUniformTrianges ( void  ) const

Definition at line 50 of file SurfaceMesh.inl.

template<typename VertexType >
uint32_t SurfaceMesh< VertexType >::getNoOfUniformTrianges ( void  ) const

Definition at line 68 of file SurfaceMesh.inl.

template<typename VertexType >
uint32_t SurfaceMesh< VertexType >::getNoOfVertices ( void  ) const

Definition at line 83 of file SurfaceMesh.inl.

template<typename VertexType >
std::vector< VertexType > & SurfaceMesh< VertexType >::getRawVertexData ( void  )

Definition at line 89 of file SurfaceMesh.inl.

template<typename VertexType >
const std::vector< VertexType > & SurfaceMesh< VertexType >::getVertices ( void  ) const

Definition at line 95 of file SurfaceMesh.inl.

template<typename VertexType >
bool SurfaceMesh< VertexType >::isEmpty ( void  ) const

Definition at line 142 of file SurfaceMesh.inl.

template<typename VertexType >
int SurfaceMesh< VertexType >::noOfDegenerateTris ( void  )

This function can help improve the visual appearance of a surface patch by smoothing normals with other nearby normals.

It iterates over each triangle in the surface patch and determines the sum of its corners normals. For any given vertex, these sums are in turn summed for any triangles which use the vertex. Usually, the resulting normals should be renormalised afterwards. Note: This function can cause lighting discontinuities accross region boundaries.

Definition at line 314 of file SurfaceMesh.inl.

template<typename VertexType >
void SurfaceMesh< VertexType >::removeDegenerateTris ( void  )

Definition at line 335 of file SurfaceMesh.inl.

template<typename VertexType >
void SurfaceMesh< VertexType >::removeUnusedVertices ( void  )

Definition at line 365 of file SurfaceMesh.inl.

template<typename VertexType >
void SurfaceMesh< VertexType >::scaleVertices ( float  amount)

Definition at line 466 of file SurfaceMesh.inl.

template<typename VertexType >
void SurfaceMesh< VertexType >::translateVertices ( const Vector3DFloat amount)

Definition at line 478 of file SurfaceMesh.inl.

Member Data Documentation

template<typename VertexType>
int32_t PolyVox::SurfaceMesh< VertexType >::m_iNoOfLod0Tris

Definition at line 89 of file SurfaceMesh.h.

template<typename VertexType>
int32_t PolyVox::SurfaceMesh< VertexType >::m_iTimeStamp

Definition at line 87 of file SurfaceMesh.h.

template<typename VertexType>
Region PolyVox::SurfaceMesh< VertexType >::m_Region

Definition at line 85 of file SurfaceMesh.h.

Referenced by PolyVox::extractSubset().

template<typename VertexType>
std::vector<LodRecord> PolyVox::SurfaceMesh< VertexType >::m_vecLodRecords

Definition at line 95 of file SurfaceMesh.h.

Referenced by PolyVox::extractSubset().

template<typename VertexType>
std::vector<uint32_t> PolyVox::SurfaceMesh< VertexType >::m_vecTriangleIndices

Definition at line 92 of file SurfaceMesh.h.

Referenced by PolyVox::extractSubset().

template<typename VertexType>
std::vector<VertexType> PolyVox::SurfaceMesh< VertexType >::m_vecVertices

Definition at line 93 of file SurfaceMesh.h.

Referenced by PolyVox::extractSubset().


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