Jump to content

[SOLVED] Load mesh without file


photo

Recommended Posts

Hi,

 

I have some mesh inside zip, and i want create Mesh using the data (unsigned char*) i have with the zip->readFile method, but apparently GLMesh can load only from file.

There is a way to do this without write the file on the HDD passing directly the data to my GLMesh.

Thanks

Link to comment

Engine overrides a base File class. You have to create same class substitution.

Or much simple solution is to use buffered files [script]:

 

string name = "temp.mesh";
engine.filesystem.addBufferFile(name);
 
  File file = new File();
  if(file.open(name,"wb")) {
    // write data into file
    file.close();
  }
  delete file;
 
  // load mesh from file
  ObjectMesh mesh = new ObjectMesh(name);
 
engine.filesystem.removeBufferFile(name);
Link to comment
×
×
  • Create New...