public static final class PolygonObjParser.Face extends Object
f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3 ...
where the v
elements are indices into the model vertices, the vt
elements are indices into the model texture coordinates, and the vn
elements
are indices into the model normal coordinates. Only the vertex indices are required.
All vertex attribute indices are normalized to be 0-based and positive and all faces are assumed to define geometrically valid convex polygons.
Modifier and Type | Method and Description |
---|---|
Vector3D |
computeNormalFromVertices(IntFunction<Vector3D> modelVertexFn)
Compute a normal for the face using its first three vertices.
|
Vector3D |
getDefinedCompositeNormal(IntFunction<Vector3D> modelNormalFn)
Get a composite normal for the face by computing the sum of all defined vertex
normals and normalizing the result.
|
int[] |
getNormalIndices()
Get the normal indices for the face.
|
int[] |
getTextureIndices()
Get the texture indices for the face.
|
List<PolygonObjParser.VertexAttributes> |
getVertexAttributes()
Get the list of vertex attributes for the instance.
|
List<PolygonObjParser.VertexAttributes> |
getVertexAttributesCounterClockwise(Vector3D normal,
IntFunction<Vector3D> modelVertexFn)
Get the vertex attributes for the face listed in the order that produces a counter-clockwise
winding of vertices when viewed looking down the given normal direction.
|
int[] |
getVertexIndices()
Get the vertex indices for the face.
|
List<Vector3D> |
getVertices(IntFunction<Vector3D> modelVertexFn)
Get the face vertices in the order defined in the face definition.
|
List<Vector3D> |
getVerticesCounterClockwise(Vector3D normal,
IntFunction<Vector3D> modelVertexFn)
Get the face vertices in the order that produces a counter-clockwise winding when viewed
looking down the given normal.
|
public List<PolygonObjParser.VertexAttributes> getVertexAttributes()
public Vector3D getDefinedCompositeNormal(IntFunction<Vector3D> modelNormalFn)
modelNormalFn
- function used to access normals parsed earlier in the model;
callers are responsible for storing these values as they are parsedpublic Vector3D computeNormalFromVertices(IntFunction<Vector3D> modelVertexFn)
modelVertexFn
- function used to access model vertices parsed earlier in the content;
callers are responsible for storing these values as they are passedpublic List<PolygonObjParser.VertexAttributes> getVertexAttributesCounterClockwise(Vector3D normal, IntFunction<Vector3D> modelVertexFn)
normal
is null, the original vertex sequence is used.normal
- requested face normal; may be nullmodelVertexFn
- function used to access model vertices parsed earlier in the content;
callers are responsible for storing these values as they are passedpublic List<Vector3D> getVertices(IntFunction<Vector3D> modelVertexFn)
modelVertexFn
- function used to access model vertices parsed earlier in the content;
callers are responsible for storing these values as they are passedpublic List<Vector3D> getVerticesCounterClockwise(Vector3D normal, IntFunction<Vector3D> modelVertexFn)
normal
- requested face normalmodelVertexFn
- function used to access model vertices parsed earlier in the content;
callers are responsible for storing these values as they are passedgetVertexAttributesCounterClockwise(Vector3D, IntFunction)
public int[] getVertexIndices()
public int[] getTextureIndices()
-1
is used if a texture index
is not set.public int[] getNormalIndices()
-1
is used if a texture index
is not set.Copyright © 2016–2021 The Apache Software Foundation. All rights reserved.