com.jme3.scene.plugins
Class OBJLoader
java.lang.Object
com.jme3.scene.plugins.OBJLoader
- All Implemented Interfaces:
- AssetLoader
public final class OBJLoader
- extends java.lang.Object
- implements AssetLoader
Reads OBJ format models.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
verts
protected final java.util.ArrayList<Vector3f> verts
texCoords
protected final java.util.ArrayList<Vector2f> texCoords
norms
protected final java.util.ArrayList<Vector3f> norms
faces
protected final java.util.ArrayList<OBJLoader.Face> faces
matFaces
protected final java.util.HashMap<java.lang.String,java.util.ArrayList<OBJLoader.Face>> matFaces
currentMatName
protected java.lang.String currentMatName
currentObjectName
protected java.lang.String currentObjectName
vertIndexMap
protected final java.util.HashMap<OBJLoader.Vertex,java.lang.Integer> vertIndexMap
indexVertMap
protected final IntMap<OBJLoader.Vertex> indexVertMap
curIndex
protected int curIndex
objectIndex
protected int objectIndex
geomIndex
protected int geomIndex
scan
protected java.util.Scanner scan
key
protected ModelKey key
assetManager
protected AssetManager assetManager
matList
protected MaterialList matList
objName
protected java.lang.String objName
objNode
protected Node objNode
OBJLoader
public OBJLoader()
reset
public void reset()
findVertexIndex
protected void findVertexIndex(OBJLoader.Vertex vert)
quadToTriangle
protected OBJLoader.Face[] quadToTriangle(OBJLoader.Face f)
readFace
protected void readFace()
readVector3
protected Vector3f readVector3()
readVector2
protected Vector2f readVector2()
loadMtlLib
protected void loadMtlLib(java.lang.String name)
throws java.io.IOException
- Throws:
java.io.IOException
nextStatement
protected boolean nextStatement()
readLine
protected boolean readLine()
throws java.io.IOException
- Throws:
java.io.IOException
createGeometry
protected Geometry createGeometry(java.util.ArrayList<OBJLoader.Face> faceList,
java.lang.String matName)
throws java.io.IOException
- Throws:
java.io.IOException
constructMesh
protected Mesh constructMesh(java.util.ArrayList<OBJLoader.Face> faceList)
load
public java.lang.Object load(AssetInfo info)
throws java.io.IOException
- Description copied from interface:
AssetLoader
- Loads asset from the given input stream, parsing it into
an application-usable object.
- Specified by:
load
in interface AssetLoader
- Returns:
- An object representing the resource.
- Throws:
java.io.IOException
- If an I/O error occurs while loading