예제 #1
0
        public void Update(SkeletonInfo info)
        {
            if (!playing) return;

            Vector3 rightHand = info.LocationToGestureSpace(info.rightHand);
            Vector3 lefthand = info.LocationToGestureSpace(info.leftHand);
            //Vector3 rightFoot = info.LocationToGestureSpace(info.rightFoot);
            
            drumInstance.Volume = MathHelper.Clamp(info.rightWristVel.Length() * .8f - .2f, 0, 1);
            drumInstance2.Volume = MathHelper.Clamp(info.leftWristVel.Length() * .8f - .2f, 0, 1);
            guitarInstance.Volume = MathHelper.Clamp(rightHand.Y + lefthand.Y + .3f, 0, 1);
            //scratchInstance.Volume = MathHelper.Clamp((rightFoot.Y + .6f) * 2, 0, 1);

        }
예제 #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="kinectLocation">This should be the location of a body part in pure skeletoninfo coordinates</param>
        /// <param name="info"></param>
        /// <returns>The absolute location of the body part in farseer coordinates</returns>
        protected virtual Vector2  KinectLocationToFarseerLocation(Vector3 kinectLocation, SkeletonInfo info)
        {
            // gSpace is just kinect space scaled to accomodate the person's size
            //Vector3 gSpace = info.ToGestureSpace(kinectLocation - info.torso); // this is equivalent to ToGestureSpace(absolute) - ToGestureSpace(torso)
            Vector3 gSpaceLocation = info.LocationToGestureSpace(kinectLocation);

            return GestureLocationToFarseerLocation(gSpaceLocation, info);
        }