Package com.jme3.scene.plugins
Class OBJLoader
java.lang.Object
com.jme3.scene.plugins.OBJLoader
- All Implemented Interfaces:
AssetLoader
Reads OBJ format models.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
protected class
protected static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected AssetManager
protected int
protected String
protected String
protected int
protected final IntMap<OBJLoader.Vertex>
protected ModelKey
protected MaterialList
protected int
protected String
protected Node
protected Scanner
protected final HashMap<OBJLoader.Vertex,
Integer> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Mesh
constructMesh
(ArrayList<OBJLoader.Face> faceList) protected Geometry
createGeometry
(ArrayList<OBJLoader.Face> faceList, String matName) protected void
Loads asset from the given input stream, parsing it into an application-usable object.protected void
loadMtlLib
(String name) protected boolean
protected OBJLoader.Face[]
protected void
readFace()
protected boolean
readLine()
protected Vector2f
protected Vector3f
void
reset()
-
Field Details
-
verts
-
texCoords
-
norms
-
currentMatName
-
currentObjectName
-
vertIndexMap
-
indexVertMap
-
curIndex
protected int curIndex -
objectIndex
protected int objectIndex -
geomIndex
protected int geomIndex -
scan
-
key
-
assetManager
-
matList
-
objName
-
objNode
-
-
Constructor Details
-
OBJLoader
public OBJLoader()
-
-
Method Details
-
reset
public void reset() -
findVertexIndex
-
quadToTriangle
-
readFace
protected void readFace() -
readVector3
-
readVector2
-
loadMtlLib
- Throws:
IOException
-
nextStatement
protected boolean nextStatement() -
readLine
- Throws:
IOException
-
createGeometry
protected Geometry createGeometry(ArrayList<OBJLoader.Face> faceList, String matName) throws IOException - Throws:
IOException
-
constructMesh
-
load
Description copied from interface:AssetLoader
Loads asset from the given input stream, parsing it into an application-usable object.- Specified by:
load
in interfaceAssetLoader
- Parameters:
info
- the located asset- Returns:
- An object representing the resource.
- Throws:
IOException
- If an I/O error occurs while loading
-