Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BustSoft
- {
- // Token: 0x06000CA4 RID: 3236 RVA: 0x0005DE70 File Offset: 0x0005C070
- public BustSoft(CharFemale _female)
- {
- this.female = _female;
- if (this.female)
- {
- this.customInfo = this.female.femaleCustomInfo;
- }
- }
- // Token: 0x06000CA5 RID: 3237 RVA: 0x0005DF18 File Offset: 0x0005C118
- public void Change(float soft, int[] changePtn)
- {
- if (null == this.female)
- {
- return;
- }
- if (this.customInfo == null)
- {
- return;
- }
- this.customInfo.bustSoftness = soft;
- this.ReCalc(changePtn);
- }
- // Token: 0x06000CA6 RID: 3238 RVA: 0x0005DF4C File Offset: 0x0005C14C
- public void ReCalc(int[] changePtn)
- {
- if (null == this.female)
- {
- return;
- }
- if (this.customInfo == null)
- {
- return;
- }
- if (changePtn.Length == 0)
- {
- return;
- }
- float num = this.customInfo.bustSoftness * this.customInfo.shapeValueBody[1] + 0.01f;
- num = Mathf.Clamp(num, 0f, 1f);
- float stiffness = this.TreeLerp(this.bustStiffness, num);
- float elasticity = this.TreeLerp(this.bustElasticity, num);
- float damping = this.TreeLerp(this.bustDamping, num);
- DynamicBone_Ver02[] array = new DynamicBone_Ver02[]
- {
- this.female.getDynamicBone(CharFemaleBody.DynamicBoneKind.BreastL),
- this.female.getDynamicBone(CharFemaleBody.DynamicBoneKind.BreastR)
- };
- for (int i = 0; i < changePtn.Length; i++)
- {
- int ptn = changePtn[i];
- DynamicBone_Ver02[] array2 = array;
- for (int j = 0; j < array2.Length; j++)
- {
- DynamicBone_Ver02 dynamicBone_Ver = array2[j];
- if (dynamicBone_Ver != null)
- {
- dynamicBone_Ver.setSoftParams(ptn, -1, damping, elasticity, stiffness, true);
- }
- }
- }
- }
- // Token: 0x06000CA7 RID: 3239 RVA: 0x0005E064 File Offset: 0x0005C264
- private float TreeLerp(float[] vals, float rate)
- {
- if (rate < 0.5f)
- {
- return Mathf.Lerp(vals[0], vals[1], rate * 2f);
- }
- return Mathf.Lerp(vals[1], vals[2], (rate - 0.5f) * 2f);
- }
- // Token: 0x04000E75 RID: 3701
- private float[] bustDamping = new float[]
- {
- 0.2f,
- 0.1f,
- 0.1f
- };
- // Token: 0x04000E76 RID: 3702
- private float[] bustElasticity = new float[]
- {
- 0.2f,
- 0.15f,
- 0.05f
- };
- // Token: 0x04000E77 RID: 3703
- private float[] bustStiffness = new float[]
- {
- 1f,
- 0.1f,
- 0.01f
- };
- // Token: 0x04000E74 RID: 3700
- private CharFileInfoCustomFemale customInfo;
- // Token: 0x04000E73 RID: 3699
- private CharFemale female;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement