hmi.graphics.opengl.scenegraph
Class GLScene

java.lang.Object
  extended by hmi.graphics.opengl.scenegraph.GLScene
All Implemented Interfaces:
GLRenderObject

public class GLScene
extends Object
implements GLRenderObject

A GLScene is a top-level structure that combines various render lists, to be rendered by an OpenGL capable render engine. It includes: 1) a List of VJoints, each acting as a root node for a VJoint based scene graph. 2) a List of SkinnedMeshes, each to be linked to appropriate VJoint nodes. 3) a GLRenderList, containing GLShapes, to be rendered. Linked to appropriate VJoint nodes.

Author:
Job Zwiers

Field Summary
private  HashMap<String,Float> desiredMorphTargets
          The set of morph targets to be set by doMorph, maintained through addMorphTargets and removeMorphTargets
private static int GRID
           
private static float RADIUS
           
private  GLRenderList shapeList
          The GLRenderList shapeList specifies GLRenderObjects to be rendered.
private  ArrayList<GLSkinnedMesh> skinnedMeshList
           
private  ArrayList<VJoint> vjointRoots
          The VJoint list determines the root VJoints for the scene graph.
 
Constructor Summary
GLScene()
          Creates a GLScene with allocated root, with specified name, and with allocated shapeList, with specified capacity.
 
Method Summary
 void addGLShape(GLShape glShape)
          Adds some GLShape to this GLScene.
 void addGLShapes(GLRenderList glShapes)
          Adds some GLShapes to this GLScene.
 void addMorphTargets(String[] targetNames, float[] weights)
          Add given weights for given morph targets to the list of desired targets
 void addSkinnedMeshes(List<GLSkinnedMesh> skinnedMeshes)
          Adds some SkinnedMeshes
 void addSkinnedMeshJointMarkers()
           
 void addSkinnedMeshJointMarkers(float radius, int grid)
           
 void addVJointRoot(VJoint root)
          Adds a VJoint, as one of the scene graph roots
 void deform()
           
 void doMorph()
          Perform morph as specified in desiredMorphTargets
 GLRenderList getGLShapeList()
          Returns the list with all GLShapes for this GLScene
 GLSkinnedMesh getGLSkinnedMesh()
          returns the first GLSkinnedMesh, for testing purposes.
 VJoint getVJoint(String partId)
          Searches for a VJoint reachable from some of the VJoint root nodes.
 List<VJoint> getVJointRoots()
          Returns the list with all scene graph roots
 void glInit(GLRenderContext glc)
          OpenGL initialization.
 void glRender(GLRenderContext glc)
          OpenGL rendering.
 void morph(int[] targets, float[] weights)
          Morph all skinned meshes
 void morph(String[] targetNames, float[] weights)
          Morph all skinned meshes
 void morph(String targetName, float weight)
          Morph all skinned meshes
 void prependGLShape(GLShape glShape)
           
 void removeMorphTargets(String[] targetNames, float[] weights)
          Remove given weights for given morph targets from the list of desired targets
 void setMorphTargets(String[] targetNames, float[] weights)
          Overwrite current morph targets with given targets
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vjointRoots

private ArrayList<VJoint> vjointRoots
The VJoint list determines the root VJoints for the scene graph.


skinnedMeshList

private ArrayList<GLSkinnedMesh> skinnedMeshList

shapeList

private GLRenderList shapeList
The GLRenderList shapeList specifies GLRenderObjects to be rendered.


RADIUS

private static final float RADIUS
See Also:
Constant Field Values

GRID

private static final int GRID
See Also:
Constant Field Values

desiredMorphTargets

private HashMap<String,Float> desiredMorphTargets
The set of morph targets to be set by doMorph, maintained through addMorphTargets and removeMorphTargets

Constructor Detail

GLScene

public GLScene()
Creates a GLScene with allocated root, with specified name, and with allocated shapeList, with specified capacity.

Method Detail

addVJointRoot

public void addVJointRoot(VJoint root)
Adds a VJoint, as one of the scene graph roots


getVJointRoots

public List<VJoint> getVJointRoots()
Returns the list with all scene graph roots


getVJoint

public VJoint getVJoint(String partId)
Searches for a VJoint reachable from some of the VJoint root nodes.


getGLShapeList

public GLRenderList getGLShapeList()
Returns the list with all GLShapes for this GLScene


prependGLShape

public void prependGLShape(GLShape glShape)

addGLShapes

public void addGLShapes(GLRenderList glShapes)
Adds some GLShapes to this GLScene.


addGLShape

public void addGLShape(GLShape glShape)
Adds some GLShape to this GLScene.


addSkinnedMeshes

public void addSkinnedMeshes(List<GLSkinnedMesh> skinnedMeshes)
Adds some SkinnedMeshes


addSkinnedMeshJointMarkers

public void addSkinnedMeshJointMarkers()

addSkinnedMeshJointMarkers

public void addSkinnedMeshJointMarkers(float radius,
                                       int grid)

glInit

public void glInit(GLRenderContext glc)
OpenGL initialization.

Specified by:
glInit in interface GLRenderObject

deform

public void deform()

getGLSkinnedMesh

public GLSkinnedMesh getGLSkinnedMesh()
returns the first GLSkinnedMesh, for testing purposes.


morph

public void morph(String targetName,
                  float weight)
Morph all skinned meshes


morph

public void morph(String[] targetNames,
                  float[] weights)
Morph all skinned meshes


morph

public void morph(int[] targets,
                  float[] weights)
Morph all skinned meshes


doMorph

public void doMorph()
Perform morph as specified in desiredMorphTargets


addMorphTargets

public void addMorphTargets(String[] targetNames,
                            float[] weights)
Add given weights for given morph targets to the list of desired targets


removeMorphTargets

public void removeMorphTargets(String[] targetNames,
                               float[] weights)
Remove given weights for given morph targets from the list of desired targets


setMorphTargets

public void setMorphTargets(String[] targetNames,
                            float[] weights)
Overwrite current morph targets with given targets


glRender

public void glRender(GLRenderContext glc)
OpenGL rendering.

Specified by:
glRender in interface GLRenderObject

toString

public String toString()
Overrides:
toString in class Object