public final class OBJLoader extends java.lang.Object implements AssetLoader
Modifier and Type | Class and Description |
---|---|
protected static class |
OBJLoader.Face |
protected class |
OBJLoader.ObjectGroup |
protected static class |
OBJLoader.Vertex |
Modifier and Type | Field and Description |
---|---|
protected AssetManager |
assetManager |
protected int |
curIndex |
protected java.lang.String |
currentMatName |
protected java.lang.String |
currentObjectName |
protected java.util.ArrayList<OBJLoader.Face> |
faces |
protected int |
geomIndex |
protected IntMap<OBJLoader.Vertex> |
indexVertMap |
protected ModelKey |
key |
protected java.util.HashMap<java.lang.String,java.util.ArrayList<OBJLoader.Face>> |
matFaces |
protected MaterialList |
matList |
protected java.util.ArrayList<Vector3f> |
norms |
protected int |
objectIndex |
protected java.lang.String |
objName |
protected Node |
objNode |
protected java.util.Scanner |
scan |
protected java.util.ArrayList<Vector2f> |
texCoords |
protected java.util.HashMap<OBJLoader.Vertex,java.lang.Integer> |
vertIndexMap |
protected java.util.ArrayList<Vector3f> |
verts |
Constructor and Description |
---|
OBJLoader() |
Modifier and Type | Method and Description |
---|---|
protected Mesh |
constructMesh(java.util.ArrayList<OBJLoader.Face> faceList) |
protected Geometry |
createGeometry(java.util.ArrayList<OBJLoader.Face> faceList,
java.lang.String matName) |
protected void |
findVertexIndex(OBJLoader.Vertex vert) |
java.lang.Object |
load(AssetInfo info)
Loads asset from the given input stream, parsing it into
an application-usable object.
|
protected void |
loadMtlLib(java.lang.String name) |
protected boolean |
nextStatement() |
protected OBJLoader.Face[] |
quadToTriangle(OBJLoader.Face f) |
protected void |
readFace() |
protected boolean |
readLine() |
protected Vector2f |
readVector2() |
protected Vector3f |
readVector3() |
void |
reset() |
protected final java.util.ArrayList<Vector3f> verts
protected final java.util.ArrayList<Vector2f> texCoords
protected final java.util.ArrayList<Vector3f> norms
protected final java.util.ArrayList<OBJLoader.Face> faces
protected final java.util.HashMap<java.lang.String,java.util.ArrayList<OBJLoader.Face>> matFaces
protected java.lang.String currentMatName
protected java.lang.String currentObjectName
protected final java.util.HashMap<OBJLoader.Vertex,java.lang.Integer> vertIndexMap
protected final IntMap<OBJLoader.Vertex> indexVertMap
protected int curIndex
protected int objectIndex
protected int geomIndex
protected java.util.Scanner scan
protected ModelKey key
protected AssetManager assetManager
protected MaterialList matList
protected java.lang.String objName
protected Node objNode
public void reset()
protected void findVertexIndex(OBJLoader.Vertex vert)
protected OBJLoader.Face[] quadToTriangle(OBJLoader.Face f)
protected void readFace()
protected Vector3f readVector3()
protected Vector2f readVector2()
protected void loadMtlLib(java.lang.String name) throws java.io.IOException
java.io.IOException
protected boolean nextStatement()
protected boolean readLine() throws java.io.IOException
java.io.IOException
protected Geometry createGeometry(java.util.ArrayList<OBJLoader.Face> faceList, java.lang.String matName) throws java.io.IOException
java.io.IOException
protected Mesh constructMesh(java.util.ArrayList<OBJLoader.Face> faceList)
public java.lang.Object load(AssetInfo info) throws java.io.IOException
AssetLoader
load
in interface AssetLoader
java.io.IOException
- If an I/O error occurs while loading