Пример #1
0
        public override void Update(SkeletonInfo info)
        {

            base.Update(info);

            bodySound.Update(info);
        }
Пример #2
0
 public void Update(SkeletonInfo info)
 {
     if (ragdoll != null)
     {
         ragdoll.Update(info);
     }
 }
Пример #3
0
        public void Update(SkeletonInfo info)
        {

            if (ragdoll != null)
            {
                ragdoll.Update(info);
            }

        }
Пример #4
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);

        }
Пример #5
0
 public override void Update(SkeletonInfo info)
 {
     if (info.rightHand.X < .3f && info.leftHand.X > -.3f)
     {
         if (!bubbled)
         {
             Bubble();
         }
     }
     else
     {
         if (bubbled)
         {
             UnBubble();
         }
     }
 }
Пример #6
0
 public abstract void Update(SkeletonInfo info);
Пример #7
0
        public override void Update(SkeletonInfo info)
        {

            if (wakeTimer < WAKE_TIME)
            {
                base.Update(SkeletonInfo.StandardPose);
            }
            else
            {
                base.Update(info);
            }

            

            tick();

            //depthTexLoc = new Vector2(info.torso.X, info.torso.Y - .13f) * depthTex.Height * .5f + new Vector2(depthTex.Width / 2, depthTex.Height / 2); // this will need to be more complex
            //depthTexRot = _body.Rotation - info.Rotation;
            //depthTexScale = info.torso.Z * .035f;

            
            if (!asleep)
            {
                foreach (AbstractEquipment e in equipment)
                {
                    e.Update(info);
                }
            }
            
        }
Пример #8
0
        //void ragdoll_WakeUp(object sender, EventArgs e)
        //{
        //    ragdoll._body.LinearDamping = slowDamping;
        //}

        


        public override void Update(SkeletonInfo info)
        {

            if (ragdoll.asleep) return;

            if (info.Tracking)
            {
                thrust = (((info.leftHand.Z + info.rightHand.Z) / 2) - info.torso.Z) * 3f;
            }
            else
            {
                thrust = 0;
            }

            
            if (thrust > 0)
            {
                if (!thrustOn)
                    StartThrust();

                ApplyThrustForce();
            }
            else if (thrustOn)
            {
                StopThrust();
            }

            

            

            
        }
Пример #9
0
        protected Vector2 GestureLocationToFarseerLocation(Vector3 gSpaceLocation, SkeletonInfo info)
        {
            // ragdollSpace is a coordinate system centered on and oriented to the ragdoll's body.
            // This calculation relies on the idea that info.torso and ragdoll.Body.Position should be superimposed.
            //Vector2 ragdollSpace = new Vector2(gSpace.X * RagdollBase.height, gSpace.Y * RagdollBase.height);
            Vector2 ragdollSpace = ragdoll.GestureVectorToRagdollVector(gSpaceLocation);


            // convert from ragdoll space to farseer space by rotating to the ragdoll's rotation and translating to the ragdoll's position.
            Vector2 farseerSpace = ragdoll.RagdollLocationToFarseerLocation(ragdollSpace);


            return farseerSpace;
        }
Пример #10
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);
        }
Пример #11
0
        public virtual void Update(SkeletonInfo info)
        {

            Vector3 vec = info.rightHand - info.rightShoulder;
            Vector2 rSpace = KinectVectorToRagdollVector(vec, info);
            setShoulderToRightHand(rSpace);

            //float pracScaler = v2.X / vec.X;

            vec = info.leftHand - info.leftShoulder;
            rSpace = KinectVectorToRagdollVector(vec, info);
            setShoulderToLeftHand(rSpace);

            vec = info.rightFoot - info.rightHip;
            rSpace = KinectVectorToRagdollVector(vec, info);
            setHipToRightFoot(rSpace);

            vec = info.leftFoot - info.leftHip;
            rSpace = KinectVectorToRagdollVector(vec, info);
            setHipToLeftFoot(rSpace);

            vec = info.head - info.torso;
            rSpace = KinectVectorToRagdollVector(vec, info);
            setChestToHead(rSpace);

            if (!Possessed && info.Tracking)
            {
                Possessed = true;
                if (PossessedByPlayer != null)
                {
                    PossessedByPlayer(this, null);
                }
            }
            else if (Possessed && !info.Tracking)
            {
                Possessed = false;
                if (UnpossessedByPlayer != null)
                {
                    UnpossessedByPlayer(this, null);
                }
            }

            
        }
Пример #12
0
 /// <summary>
 /// Converts a relative vector (not a location) from kinect space to ragdoll space.
 /// Kinect space is the kinect cooridinate system.
 /// Ragdoll space is the coordinate system centered on and rotated with the ragdoll's body.
 /// </summary>
 /// <param name="gestureSpaceVector">A vector pointing from one position in kinect space to another.</param>
 /// <returns>The equivalent vector in ragdoll space.</returns>
 public Vector2 KinectVectorToRagdollVector(Vector3 kinectVector, SkeletonInfo info)
 {
     return GestureVectorToRagdollVector(info.VectorToGestureSpace(kinectVector));
    
 }