void _UpperSolve_Transform( int origIndex, ref Matrix3x3 transformBasis )
{
var temp = _solverInternal;
Vector3 origPos = (origIndex == -1) ? temp.centerLegPos : temp.spinePos[origIndex];
for( int i = 0; i != 2; ++i ) {
SAFBIKMatMultVecPreSubAdd( out temp.armPos[i], ref transformBasis, ref temp.armPos[i], ref origPos, ref origPos );
if( _shoulderBones != null ) {
SAFBIKMatMultVecPreSubAdd( out temp.shoulderPos[i] , ref transformBasis , ref temp.shoulderPos[i] , ref origPos, ref origPos );
}
}
int spineLength = (_spineBones != null) ? (_spineBones.Length) : 0;
for( int spineIndex = origIndex + 1; spineIndex < spineLength; ++spineIndex ) {
SAFBIKMatMultVecPreSubAdd( out temp.spinePos[spineIndex], ref transformBasis, ref temp.spinePos[spineIndex], ref origPos, ref origPos );
}
if( _neckBone != null ) {
SAFBIKMatMultVecPreSubAdd( out temp.neckPos, ref transformBasis, ref temp.neckPos, ref origPos, ref origPos );
}
if( origIndex == -1 ) {
if( temp.legPos != null ) {
for( int i = 0; i < 2; ++i ) {
SAFBIKMatMultVecPreSubAdd( out temp.legPos[i], ref transformBasis, ref temp.legPos[i], ref origPos, ref origPos );
}
}
}
temp.SetDirtyVariables();
}