SA.FullBodyIK.BodyIK.SolverInternal.LowerRotation C# (CSharp) Method

LowerRotation() public method

public LowerRotation ( int origIndex, Matrix3x3 &origBasis, bool bodyRotation ) : void
origIndex int
origBasis Matrix3x3
bodyRotation bool
return void
				public void LowerRotation( int origIndex, ref Matrix3x3 origBasis, bool bodyRotation )
				{
					Vector3 origPos = (origIndex == -1) ? this.centerLegPos : this.spinePos[origIndex];

					var legPos = this.legPos;
					if( legPos != null ) {
						for( int i = 0; i < 2; ++i ) {
							SAFBIKMatMultVecPreSubAdd( out legPos[i], ref origBasis, ref legPos[i], ref origPos, ref origPos );
                        }
					}

					if( this.spinePos != null ) {
						int length = bodyRotation ? this.spinePos.Length : origIndex;
						for( int n = 0; n < length; ++n ) {
							SAFBIKMatMultVecPreSubAdd( out spinePos[n], ref origBasis, ref spinePos[n], ref origPos, ref origPos );
						}
					}

					_isDirtyCenterArmPos = true;
					_isDirtyCenterLegPos = true;
					_isDirtyCenterLegBasis = true;

					if( bodyRotation || this.spinePos == null || origIndex + 1 == this.spinePos.Length ) {
						SAFBIKMatMultVecPreSubAdd( out neckPos, ref origBasis, ref neckPos, ref origPos, ref origPos );
						if( headEnabled ) {
							SAFBIKMatMultVecPreSubAdd( out headPos, ref origBasis, ref headPos, ref origPos, ref origPos );
						}

						var armPos = this.armPos;
						if( armPos != null ) {
							for( int i = 0; i < 2; ++i ) {
								SAFBIKMatMultVecPreSubAdd( out armPos[i], ref origBasis, ref armPos[i], ref origPos, ref origPos );
							}
						}

						if( this.shoulderPos != null ) {
							for( int i = 0; i < 2; ++i ) {
								SAFBIKMatMultVecPreSubAdd( out shoulderPos[i], ref origBasis, ref shoulderPos[i], ref origPos, ref origPos );
							}
						}

						_isDirtySpineUBasis = true;
					}
				}

Same methods

FullBodyIK.BodyIK.SolverInternal::LowerRotation ( int origIndex, Quaternion &origRotation, bool bodyRotation ) : void