md3.md3model
Class MD3Mesh

java.lang.Object
  |
  +--md3.md3model.MD3Mesh
Direct Known Subclasses:
MD3GLMesh

public class MD3Mesh
extends java.lang.Object
implements java.io.Serializable

Represents data of an MD3 model mesh. This also includes the textures of the mesh.

If the containing MD3 model has bone animation frames, a version of the mesh for each of those animation key frames is provided.

Author:
Erwin Vervaet (erwin@cs.kuleuven.ac.be)
See Also:
Serialized Form

Field Summary
 java.lang.String id
           
 int meshFrameNum
          Number of animation frames of mesh, same as boneFrameNum in MD3Model.
 Vec3[][] meshFrames
          2d array of size meshFrameNum * vertexNum that stores mesh frame triangle vertices.
 int meshSize
           
 int[][][] meshVertexNormals
          3d array of size meshFrameNum * vertexNum * 2 with spherical coordinates giving the direction of the vertex normal.
 java.lang.String name
           
 float[][] textureCoord
          U/V texture coordinates of vertices.
 int textureNum
           
 MD3Texture[] textures
          Array of textures of size textureNum.
 int textureStart
           
 int texVecStart
           
 int triangleNum
           
 int[][] triangles
          Indices into meshFrames array of the triangle vertices.
 int triangleStart
           
 int vertexNum
           
 int vertexStart
           
 
Constructor Summary
protected MD3Mesh()
          Create empty new mesh object.
protected MD3Mesh(java.io.DataInput din)
          Create a mesh object with data coming from the specified input stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public java.lang.String id

name

public java.lang.String name

meshFrameNum

public int meshFrameNum

Number of animation frames of mesh, same as boneFrameNum in MD3Model.

See Also:
MD3Model

textureNum

public int textureNum

vertexNum

public int vertexNum

triangleNum

public int triangleNum

triangleStart

public int triangleStart

textureStart

public int textureStart

texVecStart

public int texVecStart

vertexStart

public int vertexStart

meshSize

public int meshSize

textures

public MD3Texture[] textures

Array of textures of size textureNum. In most cases, there's only 1 texture per mesh.


triangles

public int[][] triangles

Indices into meshFrames array of the triangle vertices. Size triangleNum * 3.


textureCoord

public float[][] textureCoord

U/V texture coordinates of vertices. Size vertexNum * 2.


meshFrames

public Vec3[][] meshFrames

2d array of size meshFrameNum * vertexNum that stores mesh frame triangle vertices.


meshVertexNormals

public int[][][] meshVertexNormals

3d array of size meshFrameNum * vertexNum * 2 with spherical coordinates giving the direction of the vertex normal. They are both unsigned byte values. The first one is the inclination, and the second the rotation in the horizontal plane. Both actually run 0..255 for full rotation.

Constructor Detail

MD3Mesh

protected MD3Mesh(java.io.DataInput din)
           throws java.io.IOException

Create a mesh object with data coming from the specified input stream.


MD3Mesh

protected MD3Mesh()

Create empty new mesh object.