예제 #1
0
        //中割り
        public static MotionPosState MakeIntermediate2(MotionPos stPos, MotionPos edPos,
                                                       float start, float span, float pos)
        {
            MotionPosState res   = new MotionPosState();
            float          frame = (((pos + 1) - start) / span);    //0~1

            foreach (enEditPartsType item in Enum.GetValues(typeof(enEditPartsType)))
            {
                float posx = IntermediateCurve(frame, edPos.GetCurveX(item), stPos.GetPos(item).x, edPos.GetPos(item).x);
                float posy = IntermediateCurve(frame, edPos.GetCurveY(item), stPos.GetPos(item).y, edPos.GetPos(item).y);

                if ((item != enEditPartsType.Arm) &&
                    (item != enEditPartsType.Leg))
                {
                    //ArmLegAnt以外
                    res.SetPos(item, new Vector2Int(
                                   (int)Math.Round(posx),
                                   (int)Math.Round(posy)));
                }
            }

            float armX = IntermediateCurve(frame, edPos.GetCurveX(enEditPartsType.Arm), stPos.GetPos(enEditPartsType.Arm).x, edPos.GetPos(enEditPartsType.Arm).x);
            float legX = IntermediateCurve(frame, edPos.GetCurveX(enEditPartsType.Leg), stPos.GetPos(enEditPartsType.Leg).x, edPos.GetPos(enEditPartsType.Leg).x);

            armX = (armX * BasePosition.CORE_ANGLE_MAG) + BasePosition.CORE_ANGLE;
            legX = (legX * BasePosition.CORE_ANGLE_MAG) + BasePosition.CORE_ANGLE;

            armX = Mathf.Cos(armX * Mathf.Deg2Rad) * BasePosition.CORE_BREAST_SIZE;
            legX = Mathf.Cos(legX * Mathf.Deg2Rad) * BasePosition.CORE_WAIST_SIZE;

            res.SetPosJoint((int)Math.Round(armX), (int)Math.Round(legX));

            return(res);
        }
예제 #2
0
 public void Reset(bool isPosReset)
 {
     if (isPosReset)
     {
         stPos = new MotionPosState();
     }
     stTransform = new MotionTransformState();
     stMove      = new MotionMoveState();
     stColor     = new MotionColorState();
     stEffect    = new MotionEffectState();
     stPassive   = new MotionPassiveState();
 }