protected void calcLocal ( Bone bone , int parentId ) { if ( parentId < 0 ) { bone . LocalMatrix . set ( bone . WorldMatrix ) ; return ; } /* * WorldMatrix = WorldMatrix(parent) * LocalMatrix * LocalMatrix = INVERSE[ WorldMatrix(parent) ] * WorldMatrix */ getWorldMatrix ( parentId , mTempMtxA ) ; // WorldMatrix(par) mTempMtxA . invert ( ) ; // INVERSE[ WorldMatrix(parent) ] mTempMtxA . mul ( bone . WorldMatrix , bone . LocalMatrix ) ; // LocalMatrix = INVERSE[ WorldMatrix(parent) ] * WorldMatrix }
Calculates the local translation and rotation for a bone . Assumes WorldRot and WorldPos have been calculated for the bone .