Class MeshWriterBinary

java.lang.Object
com.irurueta.geometry.io.MeshWriter
com.irurueta.geometry.io.MeshWriterBinary

public class MeshWriterBinary extends MeshWriter
Reads a 3D object and converts it into custom binary format.
  • Field Details

    • VERSION

      public static final byte VERSION
      Version of the binary file supported by this class.
      See Also:
    • BUFFER_SIZE

      public static final int BUFFER_SIZE
      Buffer size to write data into output stream.
      See Also:
    • dataStream

      private DataOutputStream dataStream
      Stream to write binary data to output.
  • Constructor Details

    • MeshWriterBinary

      public MeshWriterBinary(Loader loader, OutputStream stream)
      Constructor.
      Parameters:
      loader - loader to load a 3D file.
      stream - stream where trans-coded data will be written to.
    • MeshWriterBinary

      public MeshWriterBinary(Loader loader, OutputStream stream, MeshWriterListener listener)
      Constructor.
      Parameters:
      loader - loader to load a 3D file.
      stream - stream where trans-coded data will be written to.
      listener - listener to be notified of progress changes or when transcoding process starts or finishes.
  • Method Details

    • write

      Processes input file provided to loader and writes it trans-coded into output stream.
      Specified by:
      write in class MeshWriter
      Throws:
      LoaderException - if 3D file loading fails.
      IOException - if an I/O error occurs.
      NotReadyException - if mesh writer is not ready because either a loader has not been provided or an output stream has not been provided.
      LockedException - if this mesh writer is locked processing a file.
    • processTextureFile

      protected void processTextureFile(Texture texture, File textureFile) throws IOException
      Processes texture file. By reading provided texture file that has been created in a temporal location and embedding it into resulting output stream.
      Specified by:
      processTextureFile in class MeshWriter
      Parameters:
      texture - reference to texture that uses texture image.
      textureFile - file containing texture image. File will usually be created in a temporal location.
      Throws:
      IOException - if an I/O error occurs.