hmi.graphics.collada.scenegraph
Class InstanceGeometryTranslator

java.lang.Object
  extended by hmi.graphics.collada.scenegraph.InstanceGeometryTranslator

public final class InstanceGeometryTranslator
extends Object

translates (lists of Collada Instance_) Geometry into GShape lists

Author:
Job Zwiers

Field Summary
private static Map<String,String> attributeNameTranslation
           
private static List<GShape> EMPTY_GSHAPE_LIST
           
private static float EPSMIN
           
private static float EPSPLUS
           
 
Constructor Summary
private InstanceGeometryTranslator()
           
 
Method Summary
private static void addGMeshData(int morphTarget, GMesh gm, Input inp, int[] indices, String attributeName)
           
static void addGShapes(Collada collada, List<InstanceGeometry> instanceGeometries, GNode gnode)
          Adds GShapes to the specified gnode, extracted from the specified instance_geometries.
private static GMesh.MeshType convertType(Mesh.MeshType colladaType)
           
private static VertexWeights createVertexWeights(Skin skin)
           
static List<GShape> getGShapeList(Collada collada, Geometry geom, BindMaterial bindMaterial)
          Returns a list of GShape objects, each containing a GMesh plus GMaterial, extracted from the specified Collada mesh and bind_material.
static List<GShape> getSkinnedGShapeList(Collada collada, Skin skin, String[] skeletonIds, BindMaterial bindMaterial, List<GSkinnedMesh> skinnedMeshes)
          Returns a list of GShape objects, each containing a GSkinnedMesh plus GMaterial, extracted from the specified Collada Skin.
private static GMesh primitiveToGMesh(Collada collada, PrimitiveMeshElement prim, ArrayList<Input> verticesInputs, ArrayList<ArrayList<Input>> targetVerticesInputs, String[] targetIds, String geomName, Map<String,String> texCoordBindings)
          Returns a GMesh object, containing the data arrays and index arrays for a given Collada Primitive element, taking into account inputs like the Position data from a Vertices element.
private static GSkinnedMesh primitiveToGSkinnedMesh(Collada collada, PrimitiveMeshElement prim, ArrayList<Input> verticesInputs, ArrayList<ArrayList<Input>> targetVerticesInputs, String[] targetIds, Skin skin, String[] skeletonIds, String geomName, Map<String,String> texCoordBindings)
          Returns a GMesh object, containing the data arrays and index arrays for a given Collada Primitive element, taking into account inputs like the Position data from a Vertices element.
private static String translateAttributeName(String semantic, int set, Map<String,String> texCoordBindings)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_GSHAPE_LIST

private static final List<GShape> EMPTY_GSHAPE_LIST

EPSMIN

private static final float EPSMIN
See Also:
Constant Field Values

EPSPLUS

private static final float EPSPLUS
See Also:
Constant Field Values

attributeNameTranslation

private static Map<String,String> attributeNameTranslation
Constructor Detail

InstanceGeometryTranslator

private InstanceGeometryTranslator()
Method Detail

addGShapes

public static void addGShapes(Collada collada,
                              List<InstanceGeometry> instanceGeometries,
                              GNode gnode)
Adds GShapes to the specified gnode, extracted from the specified instance_geometries. The specified getCollada() argument determines the context, defining these geometries.


getGShapeList

public static List<GShape> getGShapeList(Collada collada,
                                         Geometry geom,
                                         BindMaterial bindMaterial)
Returns a list of GShape objects, each containing a GMesh plus GMaterial, extracted from the specified Collada mesh and bind_material. The getCollada() argument determines the context.


getSkinnedGShapeList

public static List<GShape> getSkinnedGShapeList(Collada collada,
                                                Skin skin,
                                                String[] skeletonIds,
                                                BindMaterial bindMaterial,
                                                List<GSkinnedMesh> skinnedMeshes)
Returns a list of GShape objects, each containing a GSkinnedMesh plus GMaterial, extracted from the specified Collada Skin. The getCollada() argument determines the context.


convertType

private static GMesh.MeshType convertType(Mesh.MeshType colladaType)

primitiveToGMesh

private static GMesh primitiveToGMesh(Collada collada,
                                      PrimitiveMeshElement prim,
                                      ArrayList<Input> verticesInputs,
                                      ArrayList<ArrayList<Input>> targetVerticesInputs,
                                      String[] targetIds,
                                      String geomName,
                                      Map<String,String> texCoordBindings)
Returns a GMesh object, containing the data arrays and index arrays for a given Collada Primitive element, taking into account inputs like the Position data from a Vertices element. These inputs are passed in by means of the vertexInputs parameter.


primitiveToGSkinnedMesh

private static GSkinnedMesh primitiveToGSkinnedMesh(Collada collada,
                                                    PrimitiveMeshElement prim,
                                                    ArrayList<Input> verticesInputs,
                                                    ArrayList<ArrayList<Input>> targetVerticesInputs,
                                                    String[] targetIds,
                                                    Skin skin,
                                                    String[] skeletonIds,
                                                    String geomName,
                                                    Map<String,String> texCoordBindings)
Returns a GMesh object, containing the data arrays and index arrays for a given Collada Primitive element, taking into account inputs like the Position data from a Vertices element. These inputs are passed in by means of the vertexInputs parameter.


createVertexWeights

private static VertexWeights createVertexWeights(Skin skin)

translateAttributeName

private static String translateAttributeName(String semantic,
                                             int set,
                                             Map<String,String> texCoordBindings)

addGMeshData

private static void addGMeshData(int morphTarget,
                                 GMesh gm,
                                 Input inp,
                                 int[] indices,
                                 String attributeName)