This class is to implement the H-Anim proposed Joint. It's implementation for Java3D has been mimicked on the VRML97 field description.
We make a little amendment to H-Anim for uLimit and lLimit:
H-Anim states that "the default values for each of these fields is [], which means that the joint is assumed to be unconstrained."
However, this is problematic since we can't constrain Y axis (or Z axis) without setting a default value for the X axis
(unless we use a hashtable, which sounds absurd in this context).
Here, we propose that there should only be valid values between -2*PI and +2*PI.
Any other value should be treated as if the joint was unconstrained on this axis.
author: Silvere Martin-Michiellot version: 1.1
Adds a child to this Joint.
Parameters: joint - the Joint to be added to the hierarchy as a child of this Joint exception: IllegalArgumentException - if this joint is an official Joint and the Joint to be added is a non standard Joint or if both Joints are official but joint is not an official child of this Joint. See Also:com.db.hanim.Joint.addJoint(Joint)
Adds joint to the children list of this Joint. Identical to com.db.hanim.Joint#addChild(Joint)
Parameters: joint - the Joint to be added from the children list of this Joint. exception: IllegalArgumentException - if this joint is an official Joint and the Joint to be added is a non standard Joint or if both Joints are official but joint is not an official child of this Joint.
Gets the Point3d that defines the overall center offset postion of the Joint
Parameters: point3D - the Point3D to put the center into for this Joint See Also:com.db.hanim.Joint.setCenter(Point3d)
Builds up a new Segment using the official Segment that corresponds to that Joint. Does not assign the Segment to this Joint.
the Segment that corresponds to that Joint.
getCorrespondingSegmentIdentifier
public int getCorrespondingSegmentIdentifier()(Code)
Gets the static identifier of the Segment that corresponds to this Joint. If no Segmemt is found matching the argument (the Joint isnot an official Joint) then the identifier Segment.NonStandard is returned
the static identifier for the Segment that corresponds.
Gets the official Segment name of the Segment that corresponds to this Joint. If no Segmemt is found matching the argument (the Joint is not an official Joint) then an empty String is returned
the name for the Segment that corresponds.
getDefaultCenter
public void getDefaultCenter(Point3d point3d)(Code)
Gets the Point3d that defines the overall center offset default value proposed by H-Anim for this Joint.
Parameters: point3D - the Point3D to put the center into for this Joint See Also:com.db.hanim.Joint.useDefaultCenter
getJointIdentifierName
public static String getJointIdentifierName(int value)(Code)
Gets the official Joint name for the static identifier passed as argument. If no Joint is found matching the argument then a new empty String is returned.
Parameters: the - static identifier for the Joint named jointName String the name of the Joint to get the identifier from See Also:com.db.hanim.Joint.getJointIdentifierNumber(String)
getJointIdentifierNumber
public static int getJointIdentifierNumber(String jointName)(Code)
Gets the static identifier for the String name passed as argument. If no Joint is found matching the argument then the identifier Joint.NonStandard is returned
Parameters: String - the name of the Joint to get the identifier from the static identifier for the Joint named jointName See Also:com.db.hanim.Joint.getJointIdentifierName(int)
Removes a child from this Joint.
Parameters: joint - the Joint to be removed from the children list of this Joint See Also:com.db.hanim.Joint.removeJoint(String)
Removes the Joint from the children list of this Joint. Identical to com.db.hanim.Joint#removeChild()
Parameters: joint - the Joint to be removed from the children list of this Joint.
Sets the offset center for the Joint.
According to VRML97 spec,
Given a 3-dimensional point P and Transform node,
P is transformed into point P' in its parent's coordinate system
by a series of intermediate transformations.
In matrix transformation notation, where C (center), SR (scaleOrientation),
T (translation), R (rotation), and S (scale) are the equivalent transformation matrices,
then P' = T × C × R × SR × S × -SR × -C × P
unfortunately, Java3D doesn't defines all these fields and works "only" with 4x4 matrix
a 4x4 matrix allows to perform translations, rotations, and scaling and shear effects.
but no offset centering that we have to simulate
Parameters: point3d - the Point3d to put the offset center into for this Joint See Also:com.db.hanim.Joint.setTransform(Transform3D)
Sets the corresponding Segment of this Joint.
Parameters: segment - the Segment to be associated with this Joint exception: IllegalArgumentException - if joint is an official Joint and segment is not the corresponding Segment.
setStiffness
public void setStiffness(Double[] stiffness)(Code)
Sets the array of Double used as stiffness
the 3 element array of Double that is the stiffness for this Joint
Sets the translation used for this Joint to the default value OF THE CENTER proposed by H-Anim. This is to smooth up transition to Java3D. Note that only the translation component of the Transform3D that is set.