Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.geom.hanim
Class SoftwareHumanoid

java.lang.Object
  extended by org.j3d.geom.hanim.HAnimObject
      extended by org.j3d.geom.hanim.HAnimHumanoid
          extended by org.j3d.renderer.aviatrix3d.geom.hanim.AVHumanoid
              extended by org.j3d.renderer.aviatrix3d.geom.hanim.SoftwareHumanoid
All Implemented Interfaces:
NodeUpdateListener, org.j3d.geom.hanim.HAnimObjectParent

public abstract class SoftwareHumanoid
extends AVHumanoid
implements NodeUpdateListener

Common AV3D implementation of the Humanoid object that uses software to implement the mesh skinning algorithm.

Version:
$Revision: 1.6 $
Author:
Justin Couch

Field Summary
protected  java.util.ArrayList<Geometry> bufferGeometry
          Geometry instances that implement BufferGeometry
protected  float[] coordsArray
          An array for coordinates to be splatted to if the contained geometry is an instance of VertexGeometry.
protected  java.nio.FloatBuffer coordsBuffer
          An array for coordinates to be splatted to if the contained geometry is an instance of VertexGeometry.
protected  boolean[] dirtyCoordinates
          A list of per-vertex flags to indicate which ones have changed since the last update.
protected  float[] normalsArray
          An array for coordinates to be splatted to if the contained geometry is an instance of VertexGeometry.
protected  java.nio.FloatBuffer normalsBuffer
          An array for coordinates to be splatted to if the contained geometry is an instance of VertexGeometry.
protected  int numSkin
          The number of valid items in the skin list
protected  Node[] skin
          Collection of nodes that is the skin
protected  Group skinGroup
          Group for containing the skin Shape nodes
protected  java.util.ArrayList<Geometry> vertexGeometry
          Geometry instances that implement VertexGeometry
 
Fields inherited from class org.j3d.geom.hanim.HAnimHumanoid
bboxCenter, bboxSize, hasChildUpdates, localMatrix, matrixChanged, numSkeleton, numSkinCoords, numSkinNormals, numViewpoints, objectCount, outputCoords, outputNormals, rootJoint, skeleton, skeletonChanged, skinCoords, skinNormals, viewpoints
 
Fields inherited from class org.j3d.geom.hanim.HAnimObject
errorReporter, name
 
Method Summary
abstract  java.lang.Object getUpdatedSkinCoords()
          Get the internal representation of the updated mesh skin coordinates.
abstract  java.lang.Object getUpdatedSkinNormals()
          Get the internal representation of the updated mesh skin normals.
 void setSkeleton(org.j3d.geom.hanim.HAnimObject[] kids, int numValid)
          Replace the existing viewpoints with the new set of viewpoints.
 void setSkin(Node[] skins, int numSkins)
          Set the list of geometry that should be used by this humanoid.
 void setSkinCoord(float[] val, int numElements)
          Set a new value for the skinCoord of this joint.
 void setSkinNormal(float[] val, int numElements)
          Set a new value for the skinNormal of this joint.
 void updateNodeBoundsChanges(java.lang.Object src)
          Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.
 void updateNodeDataChanges(java.lang.Object src)
          Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.
 void updateSkeleton()
          All the skeletal changes are in for this frame, so update the matrix values now.
 
Methods inherited from class org.j3d.renderer.aviatrix3d.geom.hanim.AVHumanoid
createBuffer, getSceneGraphObject, setBboxCenter, setBboxSize, setViewpoints
 
Methods inherited from class org.j3d.geom.hanim.HAnimHumanoid
childUpdateRequired, getBboxCenter, getBboxSize, getCenter, getInfo, getJoints, getRotation, getScale, getScaleOrientation, getSegments, getSites, getSkeleton, getSkinCoord, getSkinNormal, getTranslation, getVersion, getViewpoints, numInfo, numJoints, numSegments, numSites, numSkeleton, numSkinCoord, numSkinNormal, numViewpoints, requestNextObjectIndex, setCenter, setErrorReporter, setInfo, setJoints, setRotation, setScale, setScaleOrientation, setSegments, setSites, setTranslation, setVersion
 
Methods inherited from class org.j3d.geom.hanim.HAnimObject
getName, setName, updateMatrix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

skinGroup

protected Group skinGroup
Group for containing the skin Shape nodes


bufferGeometry

protected java.util.ArrayList<Geometry> bufferGeometry
Geometry instances that implement BufferGeometry


vertexGeometry

protected java.util.ArrayList<Geometry> vertexGeometry
Geometry instances that implement VertexGeometry


skin

protected Node[] skin
Collection of nodes that is the skin


numSkin

protected int numSkin
The number of valid items in the skin list


coordsArray

protected float[] coordsArray
An array for coordinates to be splatted to if the contained geometry is an instance of VertexGeometry.


normalsArray

protected float[] normalsArray
An array for coordinates to be splatted to if the contained geometry is an instance of VertexGeometry.


coordsBuffer

protected java.nio.FloatBuffer coordsBuffer
An array for coordinates to be splatted to if the contained geometry is an instance of VertexGeometry.


normalsBuffer

protected java.nio.FloatBuffer normalsBuffer
An array for coordinates to be splatted to if the contained geometry is an instance of VertexGeometry.


dirtyCoordinates

protected boolean[] dirtyCoordinates
A list of per-vertex flags to indicate which ones have changed since the last update. This is so that we don't unneccesarily modify the coordinates of the system that haven't changed due to the skeleton not changing in that area. When we clear the output coordinate/normal array, we only clear those that have marked their flag here.

Method Detail

updateNodeBoundsChanges

public void updateNodeBoundsChanges(java.lang.Object src)
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.

Specified by:
updateNodeBoundsChanges in interface NodeUpdateListener
Overrides:
updateNodeBoundsChanges in class AVHumanoid
Parameters:
src - The node or Node Component that is to be updated.

updateNodeDataChanges

public void updateNodeDataChanges(java.lang.Object src)
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.

Specified by:
updateNodeDataChanges in interface NodeUpdateListener
Overrides:
updateNodeDataChanges in class AVHumanoid
Parameters:
src - The node or Node Component that is to be updated.

setSkinCoord

public void setSkinCoord(float[] val,
                         int numElements)
Set a new value for the skinCoord of this joint. If the array is null or not long enough an exception is generated. The array must be at least a multiple of 3 units long.

Overrides:
setSkinCoord in class org.j3d.geom.hanim.HAnimHumanoid
Parameters:
val - The new skinCoord value to use
numElements - The number of 3d-vectors in the array
Throws:
java.lang.IllegalArgumentException - The array is null or not long enough.

setSkinNormal

public void setSkinNormal(float[] val,
                          int numElements)
Set a new value for the skinNormal of this joint. If the array is null or not long enough an exception is generated. The array must be at least a multiple of 3 units long.

Overrides:
setSkinNormal in class org.j3d.geom.hanim.HAnimHumanoid
Parameters:
val - The new skinNormal value to use
numElements - The number of 3d-vectors in the array
Throws:
java.lang.IllegalArgumentException - The array is null or not long enough.

setSkeleton

public void setSkeleton(org.j3d.geom.hanim.HAnimObject[] kids,
                        int numValid)
Replace the existing viewpoints with the new set of viewpoints.

Overrides:
setSkeleton in class AVHumanoid
Parameters:
kids - The collection of child objects to now use
numValid - The number kids to copy from the given array

updateSkeleton

public void updateSkeleton()
All the skeletal changes are in for this frame, so update the matrix values now. If nothing has changed, don't bother doing any calculations and return immediately.

Overrides:
updateSkeleton in class AVHumanoid

setSkin

public void setSkin(Node[] skins,
                    int numSkins)
Set the list of geometry that should be used by this humanoid. These are not directly inserted into the scene graph, but are used for reference to generate our own internal model. When skinned mesh animation takes place, the coordinates are automatically fed from this humanoid to the appropriate geometry. For best performance, the geometry should make use of BufferGeometry class.

Specified by:
setSkin in class AVHumanoid
Parameters:
skins - List of representative shapes to use
numSkins - The number of valid items to use from the skins array

getUpdatedSkinCoords

public abstract java.lang.Object getUpdatedSkinCoords()
Get the internal representation of the updated mesh skin coordinates.

Returns:
An object that is either a float[] or FloatBuffer, depending on the internal implementation used.

getUpdatedSkinNormals

public abstract java.lang.Object getUpdatedSkinNormals()
Get the internal representation of the updated mesh skin normals.

Returns:
An object that is either a float[] or FloatBuffer, depending on the internal implementation used.

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org