j3d.org Code

org.j3d.geom.hanim
Class HAnimSite

java.lang.Object
  extended by org.j3d.geom.hanim.HAnimObject
      extended by org.j3d.geom.hanim.HAnimSite

public class HAnimSite
extends HAnimObject

Representation of a H-Anim Site object.

The site object is defined by 6.5 Site. Internationalisation Resource Names

Version:
$Revision: 1.5 $
Author:
Justin Couch

Field Summary
protected  java.lang.Object[] children
          The current collection of children nodes registered to this object.
protected  javax.vecmath.Matrix4f globalMatrix
          Matrix that contains the global transformation down to this site
protected  javax.vecmath.Matrix4f localMatrix
          Local matrix value that combines all the fields together
protected  boolean matrixChanged
          Flag to indicate the root matrix values have changed, thus needing to regenerate the entire skeleton and vertices.
protected  int numChildren
          The number of valid children of this object
 
Fields inherited from class org.j3d.geom.hanim.HAnimObject
errorReporter, name
 
Constructor Summary
HAnimSite()
          Create a new, default instance of the site.
 
Method Summary
 void addChild(java.lang.Object kid)
          Add a child node to the existing collection.
 void getCenter(float[] val)
          Get the current value of the center.
 void getChildren(java.lang.Object[] vals)
          Get the current collection of children.
 void getRotation(float[] val)
          Get the current value of the rotation.
 void getScale(float[] val)
          Get the current value of the scale.
 void getScaleOrientation(float[] val)
          Get the current value of the scaleOrientation.
 void getTranslation(float[] val)
          Get the current value of the translation.
 int numChildren()
          Get the number of currently valid children.
 void removeChild(java.lang.Object kid)
          Remove a child node from the existing collection.
 void setCenter(float[] val)
          Set a new value for the center of this site.
 void setChildren(java.lang.Object[] kids, int numValid)
          Replace the existing children with the new set of children.
protected  void setParent(HAnimObjectParent parent)
          Set the parent of this node to the given reference.
 void setRotation(float[] val)
          Set a new value for the rotation of this site.
 void setScale(float[] val)
          Set a new value for the scale of this site.
 void setScaleOrientation(float[] val)
          Set a new value for the scaleOrientation of this site.
 void setTranslation(float[] val)
          Set a new value for the translation of this site.
protected  void updateLocation(javax.vecmath.Matrix4f parentTransform, boolean parentChanged)
          All the skeletal changes are in for this frame, so update the matrix values now.
 
Methods inherited from class org.j3d.geom.hanim.HAnimObject
getName, setErrorReporter, setName, updateMatrix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

children

protected java.lang.Object[] children
The current collection of children nodes registered to this object.


numChildren

protected int numChildren
The number of valid children of this object


localMatrix

protected javax.vecmath.Matrix4f localMatrix
Local matrix value that combines all the fields together


globalMatrix

protected javax.vecmath.Matrix4f globalMatrix
Matrix that contains the global transformation down to this site


matrixChanged

protected boolean matrixChanged
Flag to indicate the root matrix values have changed, thus needing to regenerate the entire skeleton and vertices.

Constructor Detail

HAnimSite

public HAnimSite()
Create a new, default instance of the site.

Method Detail

getCenter

public void getCenter(float[] val)
Get the current value of the center.

Parameters:
val - An array of at least length 3 to copy the value to

setCenter

public void setCenter(float[] val)
Set a new value for the center of this site. If the array is null or not long enough an exception is generated. The array must be at least 3 units long, and the center is taken from the 1st three values.

Parameters:
val - The new center value to use
Throws:
java.lang.IllegalArgumentException - The array is null or not long enough.

getScale

public void getScale(float[] val)
Get the current value of the scale.

Parameters:
val - An array of at least length 3 to copy the value to

setScale

public void setScale(float[] val)
Set a new value for the scale of this site. If the array is null or not long enough an exception is generated. The array must be at least 3 units long, and the scale is taken from the 1st three values.

Parameters:
val - The new scale value to use
Throws:
java.lang.IllegalArgumentException - The array is null or not long enough.

getTranslation

public void getTranslation(float[] val)
Get the current value of the translation.

Parameters:
val - An array of at least length 3 to copy the value to

setTranslation

public void setTranslation(float[] val)
Set a new value for the translation of this site. If the array is null or not long enough an exception is generated. The array must be at least 3 units long, and the translation is taken from the 1st three values.

Parameters:
val - The new translation value to use
Throws:
java.lang.IllegalArgumentException - The array is null or not long enough.

getScaleOrientation

public void getScaleOrientation(float[] val)
Get the current value of the scaleOrientation.

Parameters:
val - An array of at least length 4 to copy the value to

setScaleOrientation

public void setScaleOrientation(float[] val)
Set a new value for the scaleOrientation of this site. If the array is null or not long enough an exception is generated. The array must be at least 3 units long, and the scaleOrientation is taken from the 1st three values.

Parameters:
val - The new scaleOrientation value to use
Throws:
java.lang.IllegalArgumentException - The array is null or not long enough.

getRotation

public void getRotation(float[] val)
Get the current value of the rotation.

Parameters:
val - An array of at least length 4 to copy the value to

setRotation

public void setRotation(float[] val)
Set a new value for the rotation of this site. If the array is null or not long enough an exception is generated. The array must be at least 3 units long, and the rotation is taken from the 1st three values.

Parameters:
val - The new rotation value to use
Throws:
java.lang.IllegalArgumentException - The array is null or not long enough.

numChildren

public int numChildren()
Get the number of currently valid children.

Returns:
The number of values kept in the info list

getChildren

public void getChildren(java.lang.Object[] vals)
Get the current collection of children. If none are set, the array is unchanged.

Parameters:
vals - An array of at least length numChildren() to copy the values to

setChildren

public void setChildren(java.lang.Object[] kids,
                        int numValid)
Replace the existing children with the new set of children.

Parameters:
kids - The collection of child objects to now use
numValid - The number kids to copy from the given array

addChild

public void addChild(java.lang.Object kid)
Add a child node to the existing collection. Duplicates and null values are allowed.

Parameters:
kid - The new child instance to add

removeChild

public void removeChild(java.lang.Object kid)
Remove a child node from the existing collection. If there are duplicates, only the first instance is removed. Only reference comparisons are used.

Parameters:
kid - The child instance to remove

setParent

protected void setParent(HAnimObjectParent parent)
Set the parent of this node to the given reference. Any previous reference is removed.

Parameters:
parent - The new parent instance to use

updateLocation

protected void updateLocation(javax.vecmath.Matrix4f parentTransform,
                              boolean parentChanged)
All the skeletal changes are in for this frame, so update the matrix values now. This should not be callable by the general public. Derived classes may override this method, but should call it as well to ensure the internal matrices are correctly updated.

Parameters:
parentTransform - The transformation into global coordinates of the parent of this joint
parentChanged - Flag to indicate that the parent transformation matrix has changed or is still the same as last call

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org