Class PolygonObjParser.VertexAttributes

  • Enclosing class:
    PolygonObjParser

    public static final class PolygonObjParser.VertexAttributes
    extends java.lang.Object
    Class representing a set of attributes for a face vertex. All index values are 0-based and positive, in contrast with OBJ indices which are 1-based and support negative values. If an index value is not given in the OBJ content, it is set to -1.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int normalIndex
      Vertex normal index.
      private int textureIndex
      Texture coordinate index.
      private int vertexIndex
      Vertex index.
    • Constructor Summary

      Constructors 
      Constructor Description
      VertexAttributes​(int vertexIndex, int textureIndex, int normalIndex)
      Construct a new instance with the given vertices.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getNormalIndex()
      Get the normal index for this instance or -1 if not specified in the OBJ content.
      int getTextureIndex()
      Get the texture index for this instance or -1 if not specified in the OBJ content.
      int getVertexIndex()
      Get the vertex position index for this instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • vertexIndex

        private final int vertexIndex
        Vertex index.
      • textureIndex

        private final int textureIndex
        Texture coordinate index.
      • normalIndex

        private final int normalIndex
        Vertex normal index.
    • Constructor Detail

      • VertexAttributes

        VertexAttributes​(int vertexIndex,
                         int textureIndex,
                         int normalIndex)
        Construct a new instance with the given vertices.
        Parameters:
        vertexIndex - vertex index
        textureIndex - texture index
        normalIndex - vertex normal index
    • Method Detail

      • getVertexIndex

        public int getVertexIndex()
        Get the vertex position index for this instance. This value is required and is guaranteed to be a valid index into the list of vertex positions parsed so far in the OBJ content.
        Returns:
        vertex index
      • getTextureIndex

        public int getTextureIndex()
        Get the texture index for this instance or -1 if not specified in the OBJ content.
        Returns:
        texture index or -1 if not specified in the OBJ content.
      • getNormalIndex

        public int getNormalIndex()
        Get the normal index for this instance or -1 if not specified in the OBJ content.
        Returns:
        normal index or -1 if not specified in the OBJ content.