public override void Update(Kinect.SkeletonInfo info)
        {
            //Vector3 newRight = info.LocationToGestureSpace(info.rightWrist);
            //Vector3 newLeft = info.LocationToGestureSpace(info.leftWrist);

            if (wasUncontrolled)
            {
                rightVel = Vector3.Zero;
                leftVel = Vector3.Zero;
            }
            else
            {


                rightVel = info.rightWristVel;
                leftVel = info.leftWristVel;
            }

            rightWrist = info.LocationToGestureSpace(info.rightWrist);
            leftWrist = info.LocationToGestureSpace(info.leftWrist);
            if (!ragdoll.asleep && ragdoll.Possessed)
            {
                wasUncontrolled = false;
            }
        }
예제 #2
0
        public override void Update(Kinect.SkeletonInfo info)
        {

            base.Update(info);

            //Vector3 newLeft = info.LocationToGestureSpace(info.leftWrist);
            //Vector3 newRight = info.LocationToGestureSpace(info.rightWrist);

            //Vector2 shoulderBump = KinectLocationToFarseerLocation((info.centerShoulder - info.torso) * .2f, info);


            leftShoulder = info.LocationToGestureSpace(info.leftShoulder);
            rightShoulder = info.LocationToGestureSpace(info.rightShoulder);

            //leftShoulderFarseer = GestureLocationToFarseerLocation(leftShoulder, info);

            //if (!wasAsleep && wasPossessed)
            //{

            if (rightCooldown > 0)
            {
                rightCooldown--;
            }
            else
            {

                //Vector3 rightVel = (newRight - rightWrist) / info.TimeDiff;


                if (shouldFire(rightWrist, rightVel, rightShoulder))
                {
                    fire(rightWrist, rightVel, true);
                    rightCooldown = cooldown;
                }


            }



            if (leftCooldown > 0)
            {
                leftCooldown--;
            }
            else
            {

                //Vector3 leftVel = (newLeft - leftHand) / info.TimeDiff;


                if (shouldFire(leftWrist, leftVel, leftShoulder))
                {

                        
                    fire(leftWrist, leftVel, false);
                    leftCooldown = cooldown;
                }

            }
            //}


            //rightHand = newRight;
            //leftHand = newLeft;
            



        }