Example #1
0
        public override void handleOrder(List <AnimationType> type, AnimationSystem parent)
        {
            TorsoAnimation torso = parent as TorsoAnimation;

            if (torso != null)
            {
                swingTime = torso.swingTime;
            }



            if (type.Contains(AnimationType.running))
            {
                currentTarget = new MovementTarget(Quaternion.CreateFromYawPitchRoll(0, (inverted ? 1 : -1) * walkArmSwingAmount * (swingTime), 0)
                                                   , .400000f);
            }
            else if (type.Contains(AnimationType.walking))
            {
                //rotation = Quaternion.CreateFromYawPitchRoll(0, (inverted ? 1 : -1) * walkArmSwingAmount * (swingTime), 0);
                currentTarget = new MovementTarget(Quaternion.CreateFromYawPitchRoll(0, (inverted ? 1 : -1) * walkArmSwingAmount * (swingTime), 0)
                                                   , .1200000f);
            }
            else if (type.Contains(AnimationType.standing))
            {
                currentTarget = new MovementTarget(Quaternion.CreateFromYawPitchRoll(0, 0, 0)
                                                   , .1200000f);
            }


            lerpRotation();
        }
Example #2
0
        public override void handleOrder(List <AnimationType> type, AnimationSystem parent)
        {
            if (type.Contains(AnimationType.walking) || type.Contains(AnimationType.running))
            {
                //rotation = Quaternion.CreateFromYawPitchRoll(-((TorsoAnimation)parent).getYaw()/1f, 0, 0);
                TorsoAnimation torso = parent as TorsoAnimation;
                if (torso != null)
                {
                    currentTarget = new MovementTarget(Quaternion.CreateFromYawPitchRoll(-(torso).getYaw() * 1f, 0, 0), .09f);
                }
            }
            else
            {
                currentTarget = new MovementTarget(Quaternion.CreateFromYawPitchRoll(0, 0, 0), .09f);
            }

            //currentAnimation = taskType;

            //rotation = Quaternion.Slerp(rotation, currentTarget.goal, currentTarget.floatingCameraSpeed / AnimationFunctions.angleBetweenQuaternions(rotation, currentTarget.goal));
            lerpRotation();
        }
Example #3
0
        public override void handleOrder(List <AnimationType> types, AnimationSystem parent)
        {
            TorsoAnimation torso = parent as TorsoAnimation;

            if (torso != null)
            {
                parentSwingTime = torso.swingTime;
            }



            if (types.Contains(AnimationType.armsOut))
            {
                currentTarget = new MovementTarget(Quaternion.CreateFromYawPitchRoll(0, 0, 0), .200000f);
                Console.WriteLine("arms out");
            }
            else if (types.Contains(AnimationType.stabLeftArm) && !inverted)
            {
                currentTarget = new MovementTarget(stabbedForward, .6f);
            }
            else if (types.Contains(AnimationType.stabRightArm) && inverted)
            {
                currentTarget = new MovementTarget(stabbedForward, .6f);
            }

            else if (types.Contains(AnimationType.hammerHitLoweredLeftArm) && !inverted)
            {
                currentTarget = new MovementTarget(loweredHammer, .3f);
            }
            else if (types.Contains(AnimationType.hammerHitRaisedLeftArm) && !inverted)
            {
                currentTarget = new MovementTarget(raised, .3f);
            }

            else if (types.Contains(AnimationType.walking) || types.Contains(AnimationType.running))
            {
                float armSwingToUse = walkArmSwingAmount;
                if (inverted)
                {
                    if (types.Contains(AnimationType.toolInRightHand))
                    {
                        parentSwingTime /= 3f;
                    }
                }
                else
                {
                    if (types.Contains(AnimationType.toolInLeftHand))
                    {
                        parentSwingTime /= 3f;
                    }
                }


                //rotation = Quaternion.CreateFromYawPitchRoll(0, (inverted ? -1 : 1) * walkArmSwingAmount * parentSwingTime, (inverted ? -1 : 1) * MathHelper.ToRadians(90));
                currentTarget = new MovementTarget(Quaternion.CreateFromYawPitchRoll(0, (inverted ? -1 : 1) * armSwingToUse * parentSwingTime,
                                                                                     (inverted ? -1 : 1) * MathHelper.ToRadians(90)), .2f);
            }
            else if (types.Contains(AnimationType.standing))
            {
                currentTarget = new MovementTarget(Quaternion.CreateFromYawPitchRoll(0, 0,
                                                                                     (inverted ? -1 : 1) * MathHelper.ToRadians(85)), .2f);
            }



            lerpRotation();
        }