public void _UpdateCenterLegBasis()
{
if( _isDirtyCenterLegBasis ) {
_isDirtyCenterLegBasis = false;
var legPos = this.legPos;
_centerLegBasis = Matrix3x3.identity;
if( this.spinePos != null && this.spinePos.Length > 0 && legPos != null ) {
Vector3 dirX = legPos[1] - legPos[0];
Vector3 dirY = this.spinePos[0] - this.centerLegPos;
Vector3 dirZ = Vector3.Cross( dirX, dirY );
dirX = Vector3.Cross( dirY, dirZ );
if( SAFBIKVecNormalize3( ref dirX, ref dirY, ref dirZ ) ) {
_centerLegBasis.SetColumn( ref dirX, ref dirY, ref dirZ );
SAFBIKMatMultRet0( ref _centerLegBasis, ref _centerLegBoneBasisInv );
}
}
}
}