示例#1
0
        protected override void UpdateFoot(LegSensor legSensor)
        {
            legSensor.foot.position = Target.ToVector(Kinect2Tracker.SmoothPosition(lastFootPosition, legSensor.foot.position));
            legSensor.foot.rotation = Target.ToRotation(Kinect2Tracker.SmoothRotation(lastFootRotation, legSensor.foot.rotation));
            base.UpdateFoot(legSensor);

            lastFootPosition = footTarget.foot.target.transform.position;
            lastFootRotation = footTarget.foot.target.transform.rotation;
        }
示例#2
0
        protected override void UpdateLowerLeg(LegSensor legSensor)
        {
            legSensor.lowerLeg.position = Target.ToVector(Kinect2Tracker.SmoothPosition(lastLowerLegPosition, legSensor.lowerLeg.position));
            legSensor.lowerLeg.rotation = Target.ToRotation(Kinect2Tracker.SmoothRotation(lastLowerLegRotation, legSensor.lowerLeg.rotation));
            base.UpdateLowerLeg(legSensor);

            lastLowerLegPosition = footTarget.lowerLeg.target.transform.position;
            lastLowerLegRotation = footTarget.lowerLeg.target.transform.rotation;
        }
示例#3
0
        protected override void UpdateHand(ArmSensor armSensor)
        {
            armSensor.hand.position = Target.ToVector(Kinect2Tracker.SmoothPosition(lastHandPosition, armSensor.hand.position));
            armSensor.hand.rotation = Target.ToRotation(Kinect2Tracker.SmoothRotation(lastHandRotation, armSensor.hand.rotation));
            base.UpdateHand(armSensor);

            lastHandPosition = handTarget.hand.target.transform.position;
            lastHandRotation = handTarget.hand.target.transform.rotation;
        }
示例#4
0
        protected override void UpdateForearm(ArmSensor armSensor)
        {
            armSensor.forearm.position = Target.ToVector(Kinect2Tracker.SmoothPosition(lastForearmPosition, armSensor.forearm.position));
            armSensor.forearm.rotation = Target.ToRotation(Kinect2Tracker.SmoothRotation(lastForearmRotation, armSensor.forearm.rotation));
            base.UpdateForearm(armSensor);

            lastForearmPosition = handTarget.forearm.target.transform.position;
            lastForearmRotation = handTarget.forearm.target.transform.rotation;
        }
        protected void UpdateChest(TorsoSensor torsoSensor)
        {
            if (hipsTarget.chest.target.transform != null)
            {
                torsoSensor.chest.position = Target.ToVector(Kinect2Tracker.SmoothPosition(lastChestPosition, torsoSensor.chest.position));
                torsoSensor.chest.rotation = Target.ToRotation(Kinect2Tracker.SmoothRotation(lastChestRotation, torsoSensor.chest.rotation));

                hipsTarget.chest.target.transform.rotation = Target.ToQuaternion(torsoSensor.chest.rotation);
                hipsTarget.chest.target.confidence         = torsoSensor.chest.confidence;

                lastChestPosition = hipsTarget.chest.target.transform.position;
                lastChestRotation = hipsTarget.chest.target.transform.rotation;
            }
        }