public class OBJFile extends Object
Modifier and Type | Class and Description |
---|---|
class |
OBJFile.IdxSet |
static class |
OBJFile.PrimType
Enumeration of primitive types
|
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoNormal
Will calculate normals if they are missing
|
protected IntBuffer |
indices_ |
protected List<Integer> |
nIndex_ |
protected int |
nOffset_ |
protected List<Float> |
normals_ |
static int |
NumPrimTypes |
protected int |
openEdges_ |
protected List<Integer> |
pIndex_ |
protected int |
pOffset_ |
protected List<Float> |
positions_ |
protected int |
posSize_ |
protected FloatBuffer |
vertices_ |
protected int |
vtxSize_ |
Constructor and Description |
---|
OBJFile() |
Modifier and Type | Method and Description |
---|---|
void |
clearNormals() |
void |
compileModel()
This function takes the raw model data in the internal structures, and
attempts to bring it to a format directly accepted for vertex array style
rendering.
|
BoundingBox3d |
computeBoundingBox()
Returns the points defining the axis-aligned bounding box containing the
model.
|
IntBuffer |
getCompiledIndices() |
int |
getCompiledNormalOffset() |
int |
getCompiledPositionOffset() |
int |
getCompiledVertexCount() |
int |
getCompiledVertexSize() |
FloatBuffer |
getCompiledVertices() |
int |
getIndexCount() |
int |
getNormalCount() |
List<Integer> |
getNormalIndices() |
List<Float> |
getNormals() |
int |
getNormalSize() |
int |
getOpenEdgeCount() |
int |
getPositionCount() |
List<Integer> |
getPositionIndices() |
List<Float> |
getPositions() |
int |
getPositionSize() |
boolean |
hasNormals() |
boolean |
loadModelFromFilename(String file) |
boolean |
loadModelFromURL(URL fileURL)
This function attempts to determine the type of the filename passed as a
parameter.
|
boolean |
parseObjFace(String line,
int[][] idx,
boolean hasNormals)
Face Format
f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3
t : texture
n : normal
|
void |
parseObjVertex(String line,
float[] val)
Vertex/Normal Format
v 1.0 0.0 0.0
vn 0.0 1.0 0.0
n : normal
|
String |
toString() |
public static final int NumPrimTypes
protected boolean autoNormal
protected int posSize_
protected IntBuffer indices_
protected FloatBuffer vertices_
protected int pOffset_
protected int nOffset_
protected int vtxSize_
protected int openEdges_
public boolean loadModelFromFilename(String file)
public boolean loadModelFromURL(URL fileURL)
public void parseObjVertex(String line, float[] val)
v 1.0 0.0 0.0 vn 0.0 1.0 0.0 n : normal
https://fr.wikipedia.org/wiki/Objet_3D_%28format_de_fichier%29
public boolean parseObjFace(String line, int[][] idx, boolean hasNormals)
f v1/vt1/vn1 v2/vt2/vn2 v3/vt3/vn3 t : texture n : normal
public void compileModel()
public BoundingBox3d computeBoundingBox()
public void clearNormals()
public boolean hasNormals()
public int getPositionSize()
public int getNormalSize()
public int getPositionCount()
public int getNormalCount()
public int getIndexCount()
public FloatBuffer getCompiledVertices()
public IntBuffer getCompiledIndices()
public int getCompiledPositionOffset()
public int getCompiledNormalOffset()
public int getCompiledVertexSize()
public int getCompiledVertexCount()
public int getOpenEdgeCount()
Copyright © 2018. All rights reserved.