public class OBJParser extends Object implements Model, LineBasedParser
| Modifier and Type | Field and Description |
|---|---|
static String |
COMMENT |
static String |
FACE |
static String |
GROUP |
protected boolean |
hasNormals |
protected boolean |
hasTexCoords |
protected ArrayList<OBJIndex> |
indices |
static org.slf4j.Logger |
LOGGER |
protected ArrayList<Vector3f> |
normal |
static String |
NORMAL |
protected ArrayList<Vector3f> |
positions |
protected boolean |
run |
protected ArrayList<Vector2f> |
texCoord |
static String |
UV |
static String |
VERTEX |
| Constructor and Description |
|---|
OBJParser() |
| Modifier and Type | Method and Description |
|---|---|
ArrayList<OBJIndex> |
getIndices() |
ArrayList<Vector3f> |
getNormal() |
ArrayList<Vector3f> |
getPositions() |
ArrayList<Vector2f> |
getTexCoord() |
boolean |
hasRun() |
String |
parse(String line)
Parses the line.
|
protected OBJIndex |
parseOBJIndex(String token)
An OBJIndex contains indicies to various types of data
|
void |
setIndices(ArrayList<OBJIndex> indices) |
void |
setNormal(ArrayList<Vector3f> normal) |
void |
setPositions(ArrayList<Vector3f> positions) |
void |
setTexCoord(ArrayList<Vector2f> texCoord) |
IndexedModel |
toIndexedModel() |
public static final org.slf4j.Logger LOGGER
public static final String COMMENT
public static final String VERTEX
public static final String NORMAL
public static final String UV
public static final String FACE
public static final String GROUP
protected boolean hasTexCoords
protected boolean hasNormals
protected boolean run
public String parse(String line) throws Exception
parse in interface LineBasedParserline - The line to loadException - if parsing failspublic IndexedModel toIndexedModel()
toIndexedModel in interface Modelprotected OBJIndex parseOBJIndex(String token) throws LoadingException
token - single input tokenLoadingException - if integer parsing failspublic boolean hasRun()
@Generated(value="lombok") public ArrayList<Vector3f> getPositions()
@Generated(value="lombok") public void setPositions(ArrayList<Vector3f> positions)
@Generated(value="lombok") public ArrayList<Vector2f> getTexCoord()
@Generated(value="lombok") public void setTexCoord(ArrayList<Vector2f> texCoord)
@Generated(value="lombok") public ArrayList<Vector3f> getNormal()
@Generated(value="lombok") public void setNormal(ArrayList<Vector3f> normal)
@Generated(value="lombok") public ArrayList<OBJIndex> getIndices()
@Generated(value="lombok") public void setIndices(ArrayList<OBJIndex> indices)
Copyright © 2015. All rights reserved.