public HumHandHitchhikingAni Set(IComplexHuman human, BodySide side, double seconds = 1) { Init(human, side); if (human.IsGenesis8()) { RotFingerToLocal(FingerName.Thumb, 1, v3.fw.RotUp(10), v3.up); RotFingerToLocal(FingerName.Index, 1, fw_dn_sd(100, 5), v3.fw);// fw and not up because the new up is what it was fw RotFingerToLocal(FingerName.Middle, 1, fw_dn(100), v3.fw); RotFingerToLocal(FingerName.Ring, 1, fw_dn(100), v3.fw); RotFingerToLocal(FingerName.Pinky, 1, fw_dn_sd(100, -10), v3.fw); RotFingerToLocal(FingerName.Thumb, 2, v3.fw.RotUp(25), v3.up); RotFingerToLocal(FingerName.Index, 2, fw_dn(86), v3.fw); RotFingerToLocal(FingerName.Middle, 2, fw_dn(87), v3.fw); RotFingerToLocal(FingerName.Ring, 2, fw_dn(88), v3.fw); RotFingerToLocal(FingerName.Pinky, 2, fw_dn(89), v3.fw); RotFingerToLocal(FingerName.Thumb, 3, v3.fw, v3.up); RotFingerToLocal(FingerName.Index, 3, fw_dn(120), v3.fw); RotFingerToLocal(FingerName.Middle, 3, fw_dn(120), v3.fw); RotFingerToLocal(FingerName.Ring, 3, fw_dn(120), v3.fw); RotFingerToLocal(FingerName.Pinky, 3, fw_dn(120), v3.fw); } else { RotFingerToLocal(FingerName.Thumb, 1, v3.fw.RotUp(5), v3.up.RotDir(side.ToNormal(), -30)); RotFingerToLocal(FingerName.Index, 1, fw_dn_sd(70, 15), v3.fw);// fw and not up because the new up is what it was fw RotFingerToLocal(FingerName.Middle, 1, fw_dn(70), v3.fw); RotFingerToLocal(FingerName.Ring, 1, fw_dn(70), v3.fw); RotFingerToLocal(FingerName.Pinky, 1, fw_dn_sd(70, -10), v3.fw); RotFingerToLocal(FingerName.Thumb, 2, v3.fw.RotUp(10), v3.up); RotFingerToLocal(FingerName.Index, 2, fw_dn(75), v3.fw); RotFingerToLocal(FingerName.Middle, 2, fw_dn(75), v3.fw); RotFingerToLocal(FingerName.Ring, 2, fw_dn(75), v3.fw); RotFingerToLocal(FingerName.Pinky, 2, fw_dn(75), v3.fw); RotFingerToLocal(FingerName.Thumb, 3, v3.fw.RotUp(10), v3.up); RotFingerToLocal(FingerName.Index, 3, fw_dn(80), v3.fw); RotFingerToLocal(FingerName.Middle, 3, fw_dn(80), v3.fw); RotFingerToLocal(FingerName.Ring, 3, fw_dn(80), v3.fw); RotFingerToLocal(FingerName.Pinky, 3, fw_dn(80), v3.fw); } StartFingerRotation(seconds); return(this.AsUniqueNamed((unique.Hand + side) + human.ID)); }
public static Vector3 GetCurrentLookTarget(this IComplexHuman h) => h.IsGenesis8() ? h.GenFace.EyeR.position + h.GenFace.EyeR.forward.By(3) : h.MHFace.EyeR.position + h.MHFace.EyeR.forward.By(3);
public HumanInitialStats(IComplexHuman h) { if (h.IsGenesis8()) { var mouth = h.GetAbsMouthPosition(); LowerNeckToMouthRelVec = (mouth - h.Spine.Handle.position).AsLocalVec(h.Spine.NeckLower); PelvisToMouthDistance = h.Pelvis.position.DistanceTo(mouth); } FootHeight = h.LegL.Foot.position.y - h.position.y; PelvisHeight = h.Pelvis.position.y - h.position.y; HipHeight = h.Hip.position.y - h.position.y; ShoulderHeight = h.ArmL.Shoulder.position.y - h.position.y; RelaxedArmHeight = (ShoulderHeight - h.ArmL.MaxStretch); ModelVecHipToSpine = (h.Spine.position - h.Hip.position).AsLocalVec(h.Model); LocPosHead = h.Head.Holder.localPosition; LocRotHead = h.Head.Holder.localRotation; if (h.IsGenesis8()) { LocPosJaw = h.GenFace.LowerJaw.Holder.localPosition; LocRotJaw = h.GenFace.LowerJaw.Holder.localRotation; } else if (h.IsMakeHuman()) { LocPosJaw = h.MHFace.Jaw.Holder.localPosition; LocRotJaw = h.MHFace.Jaw.Holder.localRotation; } ModelPosArmL = h.ArmL.Control.position.AsLocalPoint(h.Model); ModelPosArmR = h.ArmR.Control.position.AsLocalPoint(h.Model); LocalPosArmL = h.ArmL.Control.localPosition; LocalPosArmR = h.ArmR.Control.localPosition; LocRotArmL = h.ArmL.Control.localRotation; LocRotArmR = h.ArmR.Control.localRotation; Fingers[BodySide.Left] = new Dictionary <FingerName, IDictionary <int, PosRot> >() { { FingerName.Thumb, new Dictionary <int, PosRot>() }, { FingerName.Index, new Dictionary <int, PosRot>() }, { FingerName.Middle, new Dictionary <int, PosRot>() }, { FingerName.Ring, new Dictionary <int, PosRot>() }, { FingerName.Pinky, new Dictionary <int, PosRot>() } }; Fingers[BodySide.Right] = new Dictionary <FingerName, IDictionary <int, PosRot> >() { { FingerName.Thumb, new Dictionary <int, PosRot>() }, { FingerName.Index, new Dictionary <int, PosRot>() }, { FingerName.Middle, new Dictionary <int, PosRot>() }, { FingerName.Ring, new Dictionary <int, PosRot>() }, { FingerName.Pinky, new Dictionary <int, PosRot>() } }; foreach (var side in new[] { BodySide.Left, BodySide.Right }) { var a = side == BodySide.Left ? h.ArmL : h.ArmR; Fingers[side][FingerName.Thumb] = new Dictionary <int, PosRot> { { 0, new PosRot(a.Thumb1.localPosition, a.Thumb1.localRotation) }, { 1, new PosRot(a.Thumb1.localPosition, a.Thumb1.localRotation) }, { 2, new PosRot(a.Thumb2.localPosition, a.Thumb2.localRotation) }, { 3, new PosRot(a.Thumb3.localPosition, a.Thumb3.localRotation) } }; Fingers[side][FingerName.Index] = new Dictionary <int, PosRot> { { 0, new PosRot(a.Index0.localPosition, a.Index0.localRotation) }, { 1, new PosRot(a.Index1.localPosition, a.Index1.localRotation) }, { 2, new PosRot(a.Index2.localPosition, a.Index2.localRotation) }, { 3, new PosRot(a.Index3.localPosition, a.Index3.localRotation) } }; Fingers[side][FingerName.Middle] = new Dictionary <int, PosRot> { { 0, new PosRot(a.Middle0.localPosition, a.Middle0.localRotation) }, { 1, new PosRot(a.Middle1.localPosition, a.Middle1.localRotation) }, { 2, new PosRot(a.Middle2.localPosition, a.Middle2.localRotation) }, { 3, new PosRot(a.Middle3.localPosition, a.Middle3.localRotation) } }; Fingers[side][FingerName.Ring] = new Dictionary <int, PosRot> { { 0, new PosRot(a.Ring0.localPosition, a.Ring0.localRotation) }, { 1, new PosRot(a.Ring1.localPosition, a.Ring1.localRotation) }, { 2, new PosRot(a.Ring2.localPosition, a.Ring2.localRotation) }, { 3, new PosRot(a.Ring3.localPosition, a.Ring3.localRotation) } }; Fingers[side][FingerName.Pinky] = new Dictionary <int, PosRot> { { 0, new PosRot(a.Pinky0.localPosition, a.Pinky0.localRotation) }, { 1, new PosRot(a.Pinky1.localPosition, a.Pinky1.localRotation) }, { 2, new PosRot(a.Pinky2.localPosition, a.Pinky2.localRotation) }, { 3, new PosRot(a.Pinky3.localPosition, a.Pinky3.localRotation) } }; } }