Class PolygonObjParser.VertexAttributes
java.lang.Object
org.apache.commons.geometry.io.euclidean.threed.obj.PolygonObjParser.VertexAttributes
- Enclosing class:
PolygonObjParser
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
FieldsModifier and TypeFieldDescriptionprivate final intVertex normal index.private final intTexture coordinate index.private final intVertex index. -
Constructor Summary
ConstructorsConstructorDescriptionVertexAttributes(int vertexIndex, int textureIndex, int normalIndex) Construct a new instance with the given vertices. -
Method Summary
Modifier and TypeMethodDescriptionintGet the normal index for this instance or-1if not specified in the OBJ content.intGet the texture index for this instance or-1if not specified in the OBJ content.intGet the vertex position index for this instance.
-
Field Details
-
vertexIndex
private final int vertexIndexVertex index. -
textureIndex
private final int textureIndexTexture coordinate index. -
normalIndex
private final int normalIndexVertex normal index.
-
-
Constructor Details
-
VertexAttributes
VertexAttributes(int vertexIndex, int textureIndex, int normalIndex) Construct a new instance with the given vertices.- Parameters:
vertexIndex- vertex indextextureIndex- texture indexnormalIndex- vertex normal index
-
-
Method Details
-
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-1if not specified in the OBJ content.- Returns:
- texture index or
-1if not specified in the OBJ content.
-
getNormalIndex
public int getNormalIndex()Get the normal index for this instance or-1if not specified in the OBJ content.- Returns:
- normal index or
-1if not specified in the OBJ content.
-