public class Bone
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static double |
DEGS_TO_RADS |
static int |
LLRA_4CC |
static int |
LUPA_4CC |
static double |
RADS_TO_DEGS |
static int |
RLRA_4CC |
static int |
RUPA_4CC |
Constructor and Description |
---|
Bone()
Default constructor.
|
Bone(JAInputStream jins) |
Bone(JAInputStream jins,
boolean useint4cc)
Constructs this Bone from the given stream.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(Bone cb)
Adds the given bone to this bone's dynamic children list.
|
void |
assignNewTRData(CASTRSet newtrs)
Update this bone's TR-Set data (relative to its parent)
-- ignoring the translation, i.e.
|
void |
assignNewTRData(CASTRSet newtrs,
float scale)
Update this bone's TR-Set data (relative to its parent),
applying the given scale factor to its translation.
|
void |
computeGlobalTransforms()
Computes this bone's (gobal) transformation matrix from
its parent's transform and its own current PR-set, and then
does the same recursively for its descendants in the hierarchy.
|
void |
computeGlobalTransforms(float rootOffset)
Throws an exception if this is not the root bone; otherwise,
computes this root bone's (gobal) transformation matrix from
the given offset and its own current TR-set, and then
does the same recursively for its descendants in the hierarchy.
|
boolean |
doesSliding()
Indicate if this bone does sliding.
|
boolean |
doSelfSliding()
Returns this bone's self-sliding flag value.
|
boolean |
doSkinSliding()
Returns this bone's skin-sliding flag value.
|
void |
fixChildren()
Sets up the child-bones array for this bone
(on the assumption that its dynamic children list is now frozen).
|
int |
get4CC()
Returns this bone's Four-CC name.
|
Bone[] |
getChildBones()
Returns this bone's child-bones array.
|
Vector3f |
getGlobalPosition()
Returns the global position vector for this bone.
|
void |
getGlobalPosition(Vector3f result)
Sets the given result vector to the global position vector
for this bone.
|
float |
getLength()
Returns this bone's length.
|
Bone |
getParent()
Returns this bone's parent bone.
|
int |
getParent4CC()
Returns the Four-CC name of this bone's parent.
|
java.lang.String |
getPRString()
Returns the string describing this bone's current PR-Set.
|
float[] |
getRotation()
Returns this bone's current (relative) rotation data.
|
float[] |
getRotationInDegrees()
Returns "Euler" angles (in degrees) for this bone's rotation,
derived from its current TR-set (that is, relative rotation).
|
void |
getRotationInX(Quaternion q)
Sets the given quaternion to represent the
"rotation-round-X-axis" factor in this bone's rotation.
|
TRTransform |
getTransform()
Returns this bone's current (global) transform.
|
float[] |
getTranslation()
Returns this bone's current (relative) translation data.
|
boolean |
isRoot()
Determines whether or not this bone is at the root of its
hierarchy (by testing whether or not it has a parent).
|
void |
lookAt(float camx,
float camy,
float camz,
float lookatx,
float lookaty,
float lookatz)
Adjusts this bone for viewing by camera with given parameters.
|
boolean |
parentDoesSkinSliding()
Indicate if this bone's parent (if any) does skin-sliding.
|
void |
save(JAOutputStream jouts)
Saves basic data for this Bone, and recursively for its
child-bones to the given output stream.
|
void |
save(JAOutputStream jouts,
boolean useint4cc) |
void |
setParent(Bone prnt)
Sets this bone's parent.
|
void |
setRotation(float[] rot)
Sets our rotation to be the given one (that is, the reference,
not the data, is copied).
|
public static double RADS_TO_DEGS
public static double DEGS_TO_RADS
public static int LUPA_4CC
public static int RUPA_4CC
public static int LLRA_4CC
public static int RLRA_4CC
public Bone()
public Bone(JAInputStream jins) throws java.io.IOException
java.io.IOException
public Bone(JAInputStream jins, boolean useint4cc) throws java.io.IOException
java.io.IOException
public void setParent(Bone prnt)
public TRTransform getTransform()
public Bone getParent()
public boolean isRoot()
public float[] getRotation()
public float[] getTranslation()
public Bone[] getChildBones()
public int get4CC()
public int getParent4CC()
public float getLength()
public boolean doesSliding()
public boolean parentDoesSkinSliding()
public boolean doSelfSliding()
public boolean doSkinSliding()
public java.lang.String getPRString()
public void setRotation(float[] rot)
public void addChild(Bone cb)
public void fixChildren()
public void save(JAOutputStream jouts) throws java.io.IOException
java.io.IOException
public void save(JAOutputStream jouts, boolean useint4cc) throws java.io.IOException
java.io.IOException
public Vector3f getGlobalPosition()
public void getGlobalPosition(Vector3f result)
public void assignNewTRData(CASTRSet newtrs, float scale)
public void assignNewTRData(CASTRSet newtrs)
public void computeGlobalTransforms(float rootOffset) throws JAException
JAException
public void computeGlobalTransforms()
public void getRotationInX(Quaternion q)
public float[] getRotationInDegrees()
public void lookAt(float camx, float camy, float camz, float lookatx, float lookaty, float lookatz)