SA.FullBodyIK.BodyIK._ResetShoulderTransform C# (CSharp) Method

_ResetShoulderTransform() private method

private _ResetShoulderTransform ( ) : void
return void
			void _ResetShoulderTransform()
			{
				var temp = _solverInternal;
				Assert( temp != null );
				Assert( _limbIK != null );

				if( _armBones == null || _shoulderBones == null ) {
					return;
				}

				if( _spineUBone == null || !_spineUBone.transformIsAlive ||
					_neckBone == null || !_neckBone.transformIsAlive ) {
				}

				if( !_limbIK[(int)LimbIKLocation.LeftArm].IsSolverEnabled() &&
					!_limbIK[(int)LimbIKLocation.RightArm].IsSolverEnabled() ) {
					return;
				}

				Vector3 dirY = temp.neckPos - temp.spineUPos;
				Vector3 dirX = temp.nearArmPos[1] - temp.nearArmPos[0];

				Matrix3x3 boneBasis;
				if( SAFBIKVecNormalize( ref dirY ) && SAFBIKComputeBasisFromXYLockY( out boneBasis, ref dirX, ref dirY ) ) {
					Matrix3x3 tempBasis;
					SAFBIKMatMult( out tempBasis, ref boneBasis, ref _spineUBone._localAxisBasisInv );

					Vector3 tempPos = temp.spineUPos;
					for( int i = 0; i != 2; ++i ) {
						int limbIKIndex = (i == 0) ? (int)LimbIKLocation.LeftArm : (int)LimbIKLocation.RightArm;
						if( _limbIK[limbIKIndex].IsSolverEnabled() ) {
							SAFBIKMatMultVecPreSubAdd( out temp.armPos[i], ref tempBasis, ref _armBones[i]._defaultPosition, ref _spineUBone._defaultPosition, ref tempPos );
                        }
                    }
				}
			}