Class ModelCreator

java.lang.Object
gaiasky.util.gdx.ModelCreator
Direct Known Subclasses:
IcoSphereCreator, OctahedronSphereCreator, RingCreator, SphereCreator

public abstract class ModelCreator extends Object
  • Field Details

    • name

      public String name
    • vertices

      public List<com.badlogic.gdx.math.Vector3> vertices
    • normals

      public List<com.badlogic.gdx.math.Vector3> normals
    • binormals

      public List<com.badlogic.gdx.math.Vector3> binormals
    • tangents

      public List<com.badlogic.gdx.math.Vector3> tangents
    • uv

      public List<com.badlogic.gdx.math.Vector2> uv
    • faces

      public List<ModelCreator.IFace> faces
    • index

      protected int index
    • flipNormals

      protected boolean flipNormals
    • hardEdges

      protected boolean hardEdges
  • Constructor Details

    • ModelCreator

      protected ModelCreator()
  • Method Details

    • addFace

      protected void addFace(List<ModelCreator.IFace> faces, boolean flipNormals, int... v)
    • flip

      protected int[] flip(int[] v, int startIndex)
    • addVertex

      protected int addVertex(com.badlogic.gdx.math.Vector3 p)
      Adds a vertex.
      Parameters:
      p - The point.
      Returns:
      The index of this vertex.
    • dumpObj

      public void dumpObj(OutputStream os) throws IOException
      Exports the model to the .obj (Wavefront) format in the given output stream.
      Parameters:
      os - The output stream.
      Throws:
      IOException