org.jagatoo.loaders.models.ase
Class AseMesh

java.lang.Object
  extended by org.jagatoo.loaders.models.ase.AseNode
      extended by org.jagatoo.loaders.models.ase.AseMesh

public class AseMesh
extends AseNode

The ASE mesh object holds the information for a single mesh. It is parsed a little differently from other ASE nodes because I don't want to create seperate nodes for every vertex and UV mapping. So to be a little more efficient the geometry will be stored in big arrays. Arrays which can be used to populate a geometry array. An unfortunate storage difference makes ASE indexed format different than Java3d indexed format. The normals are stored separate from the vertex list. This means that for the same vertex, there could be several sets of normals, depending on what face they belong to.


Field Summary
 boolean convertMeshCoordinates
           
 int[] faceMat
           
 float[] faceNormals
           
 int[] faceNormalsIndices
           
 int[] faces
           
 float[] normals
           
 int[] normalsIndices
           
 int numFaces
           
 int numTexFaces
           
 int numTexVertices
           
 int numVertices
           
 int[] texFaces
           
 float[] texVertices
           
 int[] totals
           
 float[] vertices
           
 
Fields inherited from class org.jagatoo.loaders.models.ase.AseNode
debug, properties
 
Constructor Summary
AseMesh()
           
 
Method Summary
 void parse(AseReader in)
          Override the default parse method because we are going to parse the entire mesh in thos node, rather than recusing into further node types.
 void parseFaceList(AseReader in)
          Parses a mesh face list.
 void parseNormal(AseReader in, int n)
          Reads in a single normal and its face and put their into the normals and normalIndices arrays
 void parseNormalsList(AseReader in)
          Parses a mesh normal list.
 void parseTexFaceList(AseReader in)
          Parses a mesh tex face list.
 void parseTexVertexList(AseReader in)
          Parses a texture vertex list.
 void parseVertexList(AseReader in)
          Parses a mesh vertex list.
 
Methods inherited from class org.jagatoo.loaders.models.ase.AseNode
parseProperty, trashBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numVertices

public int numVertices

numFaces

public int numFaces

numTexVertices

public int numTexVertices

numTexFaces

public int numTexFaces

vertices

public float[] vertices

faces

public int[] faces

texVertices

public float[] texVertices

texFaces

public int[] texFaces

normals

public float[] normals

normalsIndices

public int[] normalsIndices

faceNormals

public float[] faceNormals

faceNormalsIndices

public int[] faceNormalsIndices

faceMat

public int[] faceMat

totals

public int[] totals

convertMeshCoordinates

public boolean convertMeshCoordinates
Constructor Detail

AseMesh

public AseMesh()
Method Detail

parseVertexList

public void parseVertexList(AseReader in)
Parses a mesh vertex list. There should be numVertices lines to define this


parseFaceList

public void parseFaceList(AseReader in)
Parses a mesh face list. There should be numFaces lines to define this


parseTexVertexList

public void parseTexVertexList(AseReader in)
Parses a texture vertex list. There should be numTexVertices lines to define this


parseTexFaceList

public void parseTexFaceList(AseReader in)
Parses a mesh tex face list. There should be numFaces lines to define this


parseNormal

public void parseNormal(AseReader in,
                        int n)
Reads in a single normal and its face and put their into the normals and normalIndices arrays


parseNormalsList

public void parseNormalsList(AseReader in)
Parses a mesh normal list. There is one normal per vertex in each face. This equates to 9 floats per vertex for the normals. Also determines faceNormals and faceNormalsIndices values. There is one faceNormal per face.


parse

public void parse(AseReader in)
Override the default parse method because we are going to parse the entire mesh in thos node, rather than recusing into further node types.

Overrides:
parse in class AseNode