jjdh API

jjdh.java.resource.loader
Class MD2Mesh

java.lang.Object
  extended by jjdh.opengl.meshes.core.AbstractMesh
      extended by jjdh.opengl.meshes.core.VertexArrayMesh
          extended by jjdh.java.resource.loader.MD2Mesh
All Implemented Interfaces:
Renderable, Mesh

public class MD2Mesh
extends VertexArrayMesh


Field Summary
protected static float DEFAULT_SCALE_FACTOR
          All loaded md2-meshes will be scaled by this factor.
protected  Map<String,List<Vector3D>> keyframeMap
          Contains all keyframes with the respective name as key.
protected  List<String> keyframeNames
          Contains the names of all keyframes.
private  short[][] triangleVertices
          Indices needed to fill the vertexBuffer with the data from the vertices.
private  VertexBuffer vertexBuffer
          Internal used by the inherited VertexArrayJob.
protected  List<Vector3D> vertices
          The current positions of the vertices of this mesh.
 
Fields inherited from class jjdh.opengl.meshes.core.VertexArrayMesh
job
 
Fields inherited from class jjdh.opengl.meshes.core.AbstractMesh
material, position, rotation, scale
 
Constructor Summary
MD2Mesh(InputStream in, com.sun.opengl.util.texture.Texture texture)
          Creates a new Mesh by reading a valid MD2-InputStream.
 
Method Summary
protected  void consumeStream(InputStream in)
           
static List<Vector3D> deepCopy(List<Vector3D> data)
           
 List<Vector3D> getKeyframe(String name)
           
 List<String> getKeyframeNames()
           
 List<Vector3D> getVertices()
           
protected  void initJob(com.sun.opengl.util.texture.Texture texture)
           
 void setVertices(List<Vector3D> newVertices)
           
 void updateVertexBuffer()
          Updates the internal Job with the data of the current vertex list.
 
Methods inherited from class jjdh.opengl.meshes.core.VertexArrayMesh
bind, dispose, privateRender
 
Methods inherited from class jjdh.opengl.meshes.core.AbstractMesh
applyMaterial, applyPosition, applyRotation, applyScaling, getMaterial, getPosition, move, render, rotate, setMaterial, setPosition, setRotation, setScale, toString, unApplyMaterial
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_SCALE_FACTOR

protected static final float DEFAULT_SCALE_FACTOR
All loaded md2-meshes will be scaled by this factor.

See Also:
Constant Field Values

keyframeNames

protected List<String> keyframeNames
Contains the names of all keyframes.


keyframeMap

protected Map<String,List<Vector3D>> keyframeMap
Contains all keyframes with the respective name as key.


vertices

protected List<Vector3D> vertices
The current positions of the vertices of this mesh.


triangleVertices

private short[][] triangleVertices
Indices needed to fill the vertexBuffer with the data from the vertices.


vertexBuffer

private VertexBuffer vertexBuffer
Internal used by the inherited VertexArrayJob.

Constructor Detail

MD2Mesh

public MD2Mesh(InputStream in,
               com.sun.opengl.util.texture.Texture texture)
        throws Throwable
Creates a new Mesh by reading a valid MD2-InputStream.

Parameters:
in - the stream to read from
texture - the skin to use
Throws:
Throwable
Method Detail

deepCopy

public static List<Vector3D> deepCopy(List<Vector3D> data)

getKeyframeNames

public List<String> getKeyframeNames()

getKeyframe

public List<Vector3D> getKeyframe(String name)

getVertices

public List<Vector3D> getVertices()

setVertices

public void setVertices(List<Vector3D> newVertices)

updateVertexBuffer

public void updateVertexBuffer()
Updates the internal Job with the data of the current vertex list.


consumeStream

protected void consumeStream(InputStream in)
                      throws Throwable
Throws:
Throwable

initJob

protected void initJob(com.sun.opengl.util.texture.Texture texture)

jjdh API

Copyright © 2006 Jonas Jacobi and Dennis Heidsiek. All Rights Reserved.