hmi.graphics.opengl.scenegraph
Class ScenegraphTranslator

java.lang.Object
  extended by hmi.graphics.opengl.scenegraph.ScenegraphTranslator

public final class ScenegraphTranslator
extends Object

Translates hmi.graphics.scenegraph components into hmi.graphics.opengl counterparts.

Author:
Job Zwiers

Field Summary
private static boolean addVertexWeightColors
           
 
Constructor Summary
private ScenegraphTranslator()
           
 
Method Summary
private static void addGLBasicMeshAttributes(GMesh gmesh, GLBasicMesh glmesh)
           
static GLBasicMesh fromGMeshToGLBasicMesh(GMesh gmesh)
          Creates a new GLBasicMesh, from data obtained from the specified GMesh.
static VJoint fromGNodeToVJoint(GNode gnode, GLRenderList glShapeList, List<GLSkinnedMesh> glSkinnedMeshes)
          Translates a GNode base scenegraph into a VJoint based scenegraph plus a list of GLShape RenderObjects.
static GLScene fromGSceneToGLScene(GScene gscene)
          Translates a GScene into a GLScene
static GLShape fromGShapeToGLShape(GShape gshape, List<GLSkinnedMesh> glSkinnedMeshes)
          Translates a scenegraph GShape into an opengl GLShape
static GLSkinnedMesh fromGSkinnedMeshToGLSkinnedMesh(GSkinnedMesh gmesh)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

addVertexWeightColors

private static boolean addVertexWeightColors
Constructor Detail

ScenegraphTranslator

private ScenegraphTranslator()
Method Detail

fromGSceneToGLScene

public static GLScene fromGSceneToGLScene(GScene gscene)
Translates a GScene into a GLScene


fromGMeshToGLBasicMesh

public static GLBasicMesh fromGMeshToGLBasicMesh(GMesh gmesh)
Creates a new GLBasicMesh, from data obtained from the specified GMesh. The GMesh type should be either Triangles or PolyList. In the latter case, the GMesh will be triangulated first. The GMesh should include indices; they will be unified into a shared index for all attributes, if necessary. Note that triangulation and index unification have side effects on the GMesh parameter.


fromGSkinnedMeshToGLSkinnedMesh

public static GLSkinnedMesh fromGSkinnedMeshToGLSkinnedMesh(GSkinnedMesh gmesh)

addGLBasicMeshAttributes

private static void addGLBasicMeshAttributes(GMesh gmesh,
                                             GLBasicMesh glmesh)

fromGShapeToGLShape

public static GLShape fromGShapeToGLShape(GShape gshape,
                                          List<GLSkinnedMesh> glSkinnedMeshes)
Translates a scenegraph GShape into an opengl GLShape


fromGNodeToVJoint

public static VJoint fromGNodeToVJoint(GNode gnode,
                                       GLRenderList glShapeList,
                                       List<GLSkinnedMesh> glSkinnedMeshes)
Translates a GNode base scenegraph into a VJoint based scenegraph plus a list of GLShape RenderObjects. The latter are linked to the VJoints, via their transform matrices. The root VJoint is returned. The GLRenderObjects are added to a shapeList.