* @param motion The motion which is associated with this joint.
* @return A graphics matrix describing the transformation of this joint.
*/
public GraphicsMatrix getTransformation(int frame, Motion motion)
{
GraphicsMatrix g = new GraphicsMatrix();
if(channels != null)
{
for(int ch = channels.length-1; ch >= 0; ch--)
{
if(channels[ch].isRotation())
{
g.transform(motion.getChannel(frame, start + ch) * Math.PI / 180, channels[ch]);
}
else
{
g.transform(motion.getChannel(frame, ch), channels[ch]);
}
}
}
if(parent != null) g.transform(offsets, offsetchannels);
return g;
}