daily pastebin goal
36%
SHARE
TWEET

BustSoft

a guest Oct 5th, 2016 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class BustSoft
  2. {
  3.     // Token: 0x06000CA4 RID: 3236 RVA: 0x0005DE70 File Offset: 0x0005C070
  4.     public BustSoft(CharFemale _female)
  5.     {
  6.         this.female = _female;
  7.         if (this.female)
  8.         {
  9.             this.customInfo = this.female.femaleCustomInfo;
  10.         }
  11.     }
  12.  
  13.     // Token: 0x06000CA5 RID: 3237 RVA: 0x0005DF18 File Offset: 0x0005C118
  14.     public void Change(float soft, int[] changePtn)
  15.     {
  16.         if (null == this.female)
  17.         {
  18.             return;
  19.         }
  20.         if (this.customInfo == null)
  21.         {
  22.             return;
  23.         }
  24.         this.customInfo.bustSoftness = soft;
  25.         this.ReCalc(changePtn);
  26.     }
  27.  
  28.     // Token: 0x06000CA6 RID: 3238 RVA: 0x0005DF4C File Offset: 0x0005C14C
  29.     public void ReCalc(int[] changePtn)
  30.     {
  31.         if (null == this.female)
  32.         {
  33.             return;
  34.         }
  35.         if (this.customInfo == null)
  36.         {
  37.             return;
  38.         }
  39.         if (changePtn.Length == 0)
  40.         {
  41.             return;
  42.         }
  43.         float num = this.customInfo.bustSoftness * this.customInfo.shapeValueBody[1] + 0.01f;
  44.         num = Mathf.Clamp(num, 0f, 1f);
  45.         float stiffness = this.TreeLerp(this.bustStiffness, num);
  46.         float elasticity = this.TreeLerp(this.bustElasticity, num);
  47.         float damping = this.TreeLerp(this.bustDamping, num);
  48.         DynamicBone_Ver02[] array = new DynamicBone_Ver02[]
  49.         {
  50.             this.female.getDynamicBone(CharFemaleBody.DynamicBoneKind.BreastL),
  51.             this.female.getDynamicBone(CharFemaleBody.DynamicBoneKind.BreastR)
  52.         };
  53.         for (int i = 0; i < changePtn.Length; i++)
  54.         {
  55.             int ptn = changePtn[i];
  56.             DynamicBone_Ver02[] array2 = array;
  57.             for (int j = 0; j < array2.Length; j++)
  58.             {
  59.                 DynamicBone_Ver02 dynamicBone_Ver = array2[j];
  60.                 if (dynamicBone_Ver != null)
  61.                 {
  62.                     dynamicBone_Ver.setSoftParams(ptn, -1, damping, elasticity, stiffness, true);
  63.                 }
  64.             }
  65.         }
  66.     }
  67.  
  68.     // Token: 0x06000CA7 RID: 3239 RVA: 0x0005E064 File Offset: 0x0005C264
  69.     private float TreeLerp(float[] vals, float rate)
  70.     {
  71.         if (rate < 0.5f)
  72.         {
  73.             return Mathf.Lerp(vals[0], vals[1], rate * 2f);
  74.         }
  75.         return Mathf.Lerp(vals[1], vals[2], (rate - 0.5f) * 2f);
  76.     }
  77.  
  78.     // Token: 0x04000E75 RID: 3701
  79.     private float[] bustDamping = new float[]
  80.     {
  81.         0.2f,
  82.         0.1f,
  83.         0.1f
  84.     };
  85.  
  86.     // Token: 0x04000E76 RID: 3702
  87.     private float[] bustElasticity = new float[]
  88.     {
  89.         0.2f,
  90.         0.15f,
  91.         0.05f
  92.     };
  93.  
  94.     // Token: 0x04000E77 RID: 3703
  95.     private float[] bustStiffness = new float[]
  96.     {
  97.         1f,
  98.         0.1f,
  99.         0.01f
  100.     };
  101.  
  102.     // Token: 0x04000E74 RID: 3700
  103.     private CharFileInfoCustomFemale customInfo;
  104.  
  105.     // Token: 0x04000E73 RID: 3699
  106.     private CharFemale female;
  107. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top