unc.cdva.graphics.models
Class Object3DFactory

java.lang.Object
  extended by unc.cdva.graphics.models.Object3DFactory

public class Object3DFactory
extends java.lang.Object

Factory allowing you to easily instantiate our three main types of 3D objects: StaticListObject, AnimatedObject and TextureAnimatedObject

Author:
Guillaume Conte

Constructor Summary
Object3DFactory()
           
 
Method Summary
 AnimatedObject createAnimatedObject(java.lang.String modelFile, java.lang.String textureFile, java.util.Hashtable<java.lang.String,Animation> animations, ShaderProgram shader, javax.media.opengl.GL gl)
          Instantiate an AnimatedObject
 StaticListObject createStaticListObject(java.lang.String modelFile, java.lang.String textureFile, ShaderProgram shader, javax.media.opengl.GL gl)
          Instantiate a StaticListObject
 TextureAnimatedObject createTextureAnimatedObject(java.lang.String modelFile, TextureAnimation animation, ShaderProgram shader, javax.media.opengl.GL gl)
          Instantiate an TextureAnimatedObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Object3DFactory

public Object3DFactory()
Method Detail

createStaticListObject

public StaticListObject createStaticListObject(java.lang.String modelFile,
                                               java.lang.String textureFile,
                                               ShaderProgram shader,
                                               javax.media.opengl.GL gl)
                                        throws java.io.IOException
Instantiate a StaticListObject

Parameters:
modelFile - path of the model file
textureFile - path of the texture file
shader - shader program
gl - OpenGL context
Returns:
new StaticListObject
Throws:
java.io.IOException - one of the files is missing

createAnimatedObject

public AnimatedObject createAnimatedObject(java.lang.String modelFile,
                                           java.lang.String textureFile,
                                           java.util.Hashtable<java.lang.String,Animation> animations,
                                           ShaderProgram shader,
                                           javax.media.opengl.GL gl)
                                    throws java.io.IOException
Instantiate an AnimatedObject

Parameters:
modelFile - path of the base model object
textureFile - path of the texture file
animations - list of the animations
shader - shader program
gl - OpenGL context
Returns:
new AnimatedObject
Throws:
java.io.IOException - file not found

createTextureAnimatedObject

public TextureAnimatedObject createTextureAnimatedObject(java.lang.String modelFile,
                                                         TextureAnimation animation,
                                                         ShaderProgram shader,
                                                         javax.media.opengl.GL gl)
                                                  throws java.io.IOException
Instantiate an TextureAnimatedObject

Parameters:
modelFile - path of the base model
animation - texture animation
shader - shader program
gl - OpenGL context
Returns:
new TextureAnimatedObject
Throws:
java.io.IOException - file not found