libgdx API

com.badlogic.gdx.graphics.g3d.loaders.md5
Class MD5Renderer

java.lang.Object
  extended by com.badlogic.gdx.graphics.g3d.loaders.md5.MD5Renderer
All Implemented Interfaces:
Disposable

public class MD5Renderer
extends java.lang.Object
implements Disposable

The MD5Renderer draws the current frame of an animated MD5 model. It also calculates the bounding box using the resulting interpolated vertex data.

Author:
Mario Zechner , Nathan Sweet , Dave Clayton

Constructor Summary
MD5Renderer(MD5Model model, boolean useNormals, boolean useJni)
          Constructs an MD5Renderer.
 
Method Summary
 void calculateNormals(MD5Joints bindPoseSkeleton)
           
 void dispose()
          Releases all resources of this object.
 BoundingBox getBBox()
           
 short[] getIndices(int idx)
           
 Mesh getMesh()
           
 float[] getVertices(int idx)
           
 boolean isJniUsed()
           
 void render()
           
 void render(Material[] materials)
           
 void setSkeleton(MD5Joints skeleton)
           
 void setUseJni(boolean useJni)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MD5Renderer

public MD5Renderer(MD5Model model,
                   boolean useNormals,
                   boolean useJni)
Constructs an MD5Renderer. Normals are required for dynamic lighting. Note that there is currently no JNI implementation supporting normal animation, so if you require normals you must use the Java implementation. On >=2.2 phones JNI is not much faster anyway.

Parameters:
model - The MD5 model this renderer will draw.
useNormals - Whether to interpolate the model's normals as well as its vertices.
useJni - Whether to use the JNI implementation or not.
Method Detail

getBBox

public BoundingBox getBBox()

getVertices

public float[] getVertices(int idx)

getIndices

public short[] getIndices(int idx)

getMesh

public Mesh getMesh()

setSkeleton

public void setSkeleton(MD5Joints skeleton)

setUseJni

public void setUseJni(boolean useJni)

calculateNormals

public void calculateNormals(MD5Joints bindPoseSkeleton)

render

public void render()

render

public void render(Material[] materials)

dispose

public void dispose()
Description copied from interface: Disposable
Releases all resources of this object.

Specified by:
dispose in interface Disposable

isJniUsed

public boolean isJniUsed()

libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)