Fermat
Public Types | Public Methods | Static Public Methods | Public Members | Static Public Members | List of all members
MeshStorage Class Reference

Detailed description

This class provides basic Mesh storage for either the host or device

#include <MeshStorage.h>

Public Types

typedef MeshView::vertex_triangle vertex_triangle
 
typedef MeshView::normal_triangle normal_triangle
 
typedef MeshView::texture_triangle texture_triangle
 
typedef MeshView::lightmap_triangle lightmap_triangle
 

Public Methods

void alloc (const int num_triangles, const int num_vertices, const int num_normals, const int num_texture_coordinates, const int num_groups)
 
void alloc_lightmap (const int num_lightmap_coordinates)
 
void compress_normals ()
 
void compress_tex ()
 
SUTILAPI MeshMaterialalloc_materials (const size_t n)
 
SUTILAPI char * alloc_material_names (const size_t n_chars)
 
SUTILAPI int getNumVertices () const
 
SUTILAPI int getNumNormals () const
 
SUTILAPI int getNumTextureCoordinates () const
 
SUTILAPI int getNumTriangles () const
 
SUTILAPI int getNumGroups () const
 
SUTILAPI int getNumMaterials () const
 
SUTILAPI int getNumTextures () const
 
SUTILAPI int getVertexStride () const
 
SUTILAPI int getNormalStride () const
 
SUTILAPI int getTextureCoordinateStride () const
 
SUTILAPI int * getVertexIndices ()
 
SUTILAPI const int * getVertexIndices () const
 
SUTILAPI int * getNormalIndices ()
 
SUTILAPI const int * getNormalIndices () const
 
SUTILAPI int * getMaterialIndices ()
 
SUTILAPI const int * getMaterialIndices () const
 
SUTILAPI int * getTextureCoordinateIndices ()
 
SUTILAPI const int * getTextureCoordinateIndices () const
 
SUTILAPI int * getLightmapIndices ()
 
SUTILAPI const int * getLightmapIndices () const
 
SUTILAPI int * getGroupOffsets ()
 
SUTILAPI const int * getGroupOffsets () const
 
SUTILAPI float * getVertexData ()
 
SUTILAPI const float * getVertexData () const
 
SUTILAPI float * getNormalData ()
 
SUTILAPI const float * getNormalData () const
 
SUTILAPI float * getTextureCoordinateData ()
 
SUTILAPI const float * getTextureCoordinateData () const
 
SUTILAPI std::string & getGroupName (const uint32 i)
 
SUTILAPI const std::string & getGroupName (const uint32 i) const
 
SUTILAPI const char * getMaterialName (const uint32 i) const
 
SUTILAPI uint32 insert_texture (const std::string &tex_name)
 
SUTILAPI MeshView view ()
 
void reorder_triangles (const int *index)
 
void reset_groups (const int num_groups, const int *group_offsets)
 

Static Public Methods

static normal_triangle make_normal_triangle (const int32 x, const int32 y, const int32 z)
 
static texture_triangle make_texture_triangle (const int32 x, const int32 y, const int32 z)
 
static lightmap_triangle make_lightmap_triangle (const int32 x, const int32 y, const int32 z)
 

Public Members

int m_num_vertices
 
int m_num_normals
 
int m_num_texture_coordinates
 
int m_num_lightmap_coordinates
 
int m_num_triangles
 
int m_num_groups
 
int m_vertex_stride
 
int m_normal_stride
 
int m_texture_stride
 
float2 m_tex_bias
 
float2 m_tex_scale
 
float2 m_lm_bias
 
float2 m_lm_scale
 
std::map< std::string, uint32 > m_textures_map
 
std::vector< std::string > m_textures
 
std::vector< std::string > m_group_names
 
Buffer< int > m_vertex_indices
 
Buffer< int > m_normal_indices
 
Buffer< int > m_normal_indices_comp
 
Buffer< int > m_material_indices
 
Buffer< int > m_texture_indices
 
Buffer< int > m_texture_indices_comp
 
Buffer< int > m_lightmap_indices
 
Buffer< int > m_lightmap_indices_comp
 
Buffer< int > m_group_offsets
 
Buffer< float > m_vertex_data
 
Buffer< float > m_normal_data
 
Buffer< uint32 > m_normal_data_comp
 
Buffer< float > m_texture_data
 
Buffer< float > m_lightmap_data
 
Buffer< MeshMaterialm_materials
 
Buffer< char > m_material_names
 
Buffer< int > m_material_name_offsets
 

Static Public Members

static const uint32 VERTEX_TRIANGLE_SIZE = MeshView::VERTEX_TRIANGLE_SIZE
 
static const uint32 NORMAL_TRIANGLE_SIZE = MeshView::NORMAL_TRIANGLE_SIZE
 
static const uint32 TEXTURE_TRIANGLE_SIZE = MeshView::TEXTURE_TRIANGLE_SIZE
 
static const uint32 LIGHTMAP_TRIANGLE_SIZE = MeshView::LIGHTMAP_TRIANGLE_SIZE
 

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