hmi.graphics.util
Class SegmentedDaeHumanoidLoader

java.lang.Object
  extended by hmi.graphics.util.SegmentedDaeHumanoidLoader
All Implemented Interfaces:
DaeHumanoidLoader

public final class SegmentedDaeHumanoidLoader
extends Object
implements DaeHumanoidLoader

Helper class to load a seamless humanoid from a dae file. Useful when a fullfledged ElckerlycDemoEnvironment is not needed. On request, after loading, the "null pose" for the humanoid is the H-Anim null pose. Assumption about the collada file: - the mesh for the segments is directly inside the skeleton joint structure - after applying the joint renaming file, the animation root joint is called HumanoidRoot -

Author:
Herwin van Welbergen, Dennis Reidsma

Field Summary
private  VJoint avatarAnimationRootJoint
           
private  VGLNode avatarRenderNode
           
private  VJoint avatarRenderRootJoint
           
private  GLScene glScene
           
private  GNode gnode
           
 
Constructor Summary
private SegmentedDaeHumanoidLoader()
           
  SegmentedDaeHumanoidLoader(String id, Resources resources, String daeFile, String colladaRenamingFile, float colladaScalingFactor, String colladaIncludeDir, boolean setToHAnim)
           
 
Method Summary
private  void alignJoint(String jointName, String nextJoint, float[] dir)
           
private  void deformMesh(String name, GNode node, float[] q)
           
private  GNode findNode(GNode start, String name)
           
 VJoint getAvatarAnimationRootJoint()
           
 VGLNode getAvatarRenderNode()
           
 VJoint getAvatarRenderRootJoint()
           
 GLScene getGLScene()
           
 GNode getGnode()
           
private  void rotateMeshInNodes(GNode startNode, float[] q)
           
private  void rotateVJoint(VJoint v, float[] q)
           
private  void transJoint(VJoint v, float[] vPrev)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

avatarAnimationRootJoint

private VJoint avatarAnimationRootJoint

avatarRenderNode

private VGLNode avatarRenderNode

avatarRenderRootJoint

private VJoint avatarRenderRootJoint

glScene

private GLScene glScene

gnode

private GNode gnode
Constructor Detail

SegmentedDaeHumanoidLoader

private SegmentedDaeHumanoidLoader()

SegmentedDaeHumanoidLoader

public SegmentedDaeHumanoidLoader(String id,
                                  Resources resources,
                                  String daeFile,
                                  String colladaRenamingFile,
                                  float colladaScalingFactor,
                                  String colladaIncludeDir,
                                  boolean setToHAnim)
                           throws IOException
Throws:
IOException
Method Detail

getAvatarAnimationRootJoint

public VJoint getAvatarAnimationRootJoint()
Specified by:
getAvatarAnimationRootJoint in interface DaeHumanoidLoader
Returns:
the avatarAnimationRootJoint

getAvatarRenderNode

public VGLNode getAvatarRenderNode()
Specified by:
getAvatarRenderNode in interface DaeHumanoidLoader
Returns:
the avatarRenderNode

getAvatarRenderRootJoint

public VJoint getAvatarRenderRootJoint()
Specified by:
getAvatarRenderRootJoint in interface DaeHumanoidLoader
Returns:
the avatarRenderRootJoint

getGLScene

public GLScene getGLScene()
Specified by:
getGLScene in interface DaeHumanoidLoader
Returns:
the GLScene

getGnode

public GNode getGnode()

alignJoint

private void alignJoint(String jointName,
                        String nextJoint,
                        float[] dir)

deformMesh

private void deformMesh(String name,
                        GNode node,
                        float[] q)

rotateVJoint

private void rotateVJoint(VJoint v,
                          float[] q)

transJoint

private void transJoint(VJoint v,
                        float[] vPrev)

findNode

private GNode findNode(GNode start,
                       String name)

rotateMeshInNodes

private void rotateMeshInNodes(GNode startNode,
                               float[] q)