39 std::cerr<<
"problems Opening File "<<_fname<<std::endl;
44 file.read(header,8*
sizeof(
char));
48 if(strcmp(header,
"ngl::bin"))
52 std::cout<<
"this is not an ngl::bin file "<<std::endl;
57 file.read(reinterpret_cast <char *> (&m_nVerts),
sizeof(
unsigned long int));
59 file.read(reinterpret_cast <char *>(&m_nNorm),
sizeof(
unsigned long int));
61 file.read(reinterpret_cast <char *>(&m_nTex),
sizeof(
unsigned long int));
63 file.read(reinterpret_cast <char *>(&m_nFaces),
sizeof(
unsigned long int));
65 file.read(reinterpret_cast <char *>(&m_center.m_x),
sizeof(
Real));
66 file.read(reinterpret_cast <char *>(&m_center.m_y),
sizeof(
Real));
67 file.read(reinterpret_cast <char *>(&m_center.m_z),
sizeof(
Real));
69 file.read(reinterpret_cast <char *>(&m_texture),
sizeof(
bool));
71 file.read(reinterpret_cast <char *>(&m_maxX),
sizeof(
Real));
72 file.read(reinterpret_cast <char *>(&m_maxY),
sizeof(
Real));
73 file.read(reinterpret_cast <char *>(&m_maxZ),
sizeof(
Real));
74 file.read(reinterpret_cast <char *>(&m_minX),
sizeof(
Real));
75 file.read(reinterpret_cast <char *>(&m_minY),
sizeof(
Real));
76 file.read(reinterpret_cast <char *>(&m_minZ),
sizeof(
Real));
78 file.read(reinterpret_cast <char *>(& m_dataPackType),
sizeof(
GLuint));
79 file.read(reinterpret_cast <char *>(& m_indexSize),
sizeof(
unsigned int));
80 file.read(reinterpret_cast <char *>(& m_bufferPackSize),
sizeof(
unsigned int));
83 file.read(reinterpret_cast <char *>(&size),
sizeof(
unsigned int));
85 std::unique_ptr <Real>vboMem(
new Real[size]);
87 file.read(reinterpret_cast<char *>(vboMem.get()),size);
89 file.read(reinterpret_cast <char *>(&size),
sizeof(
unsigned int));
91 m_outIndices.resize(size);
93 for(
unsigned int i=0; i<
size; ++i)
95 file.read(reinterpret_cast <char *>(&m_outIndices[i]),
sizeof(
unsigned int));
110 m_ext.reset(
new BBox(m_minX,m_maxX,m_minY,m_maxY,m_minZ,m_maxZ) );
132 loadTexture(_texName);
inherited from AbstractMesh export and load binary data in our own format
NCCABinMesh() noexcept
default constructor
void save(const std::string &_fname) noexcept
method to save the obj
implementation files for RibExport class
PRECISION Real
create a variable called Real which is the main data type we use (GLfloat for most cases) ...
an abstract base mesh used to build specific meshes such as Obj
const GLuint GLenum const void * binary
void saveNCCABinaryMesh(const std::string &_fname) noexcept
save the mesh as NCCA Binary VBO format basically this format is the processed binary vbo mesh data a...
bool load(const std::string &_fname, bool _calcBB=true) noexcept
Method to load the file in.
Simple Bounding box class used in various parts of ngl and other example programs.
GLsizei const GLchar *const * string