public override void Start(HumanoidControl _humanoid, Transform targetTransform)
        {
            base.Start(_humanoid, targetTransform);
            kinectTracker = headTarget.humanoid.kinectTracker;

            kinectFace = new KinectFace(kinectTracker.kinectDevice, faceTracking, audioInput);
            SetFaceSensor(kinectFace);
        }
Пример #2
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;
        }
Пример #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 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;
        }
Пример #5
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;
        }
        public override void Start(HumanoidControl _humanoid, Transform targetTransform)
        {
            base.Start(_humanoid, targetTransform);
            kinectTracker = headTarget.humanoid.kinectTracker;
            tracker       = kinectTracker;

            sensor = new KinectHead(headTarget.humanoid.kinectTracker.kinectDevice, headTracking);

            //if (kinectTracker.device == null)
            //    return;

            //headSensor = kinectTracker.device.GetBone(0, Bone.Head);
            //neckSensor = kinectTracker.device.GetBone(0, Bone.Neck);
        }
        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;
            }
        }
        //private SensorBone hipsSensor;
        //private SensorBone spineSensor;
        //private SensorBone chestSensor;


        public override void Start(HumanoidControl _humanoid, Transform targetTransform)
        {
            base.Start(_humanoid, targetTransform);
            kinectTracker = hipsTarget.humanoid.kinectTracker;
            tracker       = kinectTracker;

            sensor = new KinectTorso(hipsTarget.humanoid.kinectTracker.kinectDevice);

            //if (kinectTracker.device == null)
            //    return;

            //hipsSensor = kinectTracker.device.GetBone(0, Bone.Hips);
            //spineSensor = kinectTracker.device.GetBone(0, Bone.Spine);
            //chestSensor = kinectTracker.device.GetBone(0, Bone.Chest);
        }
Пример #9
0
        public override void Start(HumanoidControl humanoid, Transform targetTransform)
        {
            base.Start(humanoid, targetTransform);
            kinectTracker = handTarget.humanoid.kinectTracker;

            kinectArm = new KinectArm(handTarget.isLeft, kinectTracker.kinectDevice, handTracking);
            sensor    = kinectArm;

            //if (kinectTracker.device == null)
            //    return;

            //upperArmSensor = kinectTracker.device.GetBone(0, handTarget.side, SideBone.UpperArm);
            //forearmSensor = kinectTracker.device.GetBone(0, handTarget.side, SideBone.Forearm);
            //handSensor = kinectTracker.device.GetBone(0, handTarget.side, SideBone.Hand);
        }
Пример #10
0
        //private SensorBone upperLegSensor;
        //private SensorBone lowerLegSensor;
        //private SensorBone footSensor;

        #region Start
        public override void Start(HumanoidControl humanoid, Transform targetTransform)
        {
            base.Start(humanoid, targetTransform);
            kinectTracker = footTarget.humanoid.kinectTracker;
            tracker       = kinectTracker;

            sensor    = new KinectLeg(footTarget.isLeft, footTarget.humanoid.kinectTracker.kinectDevice);
            kinectLeg = (KinectLeg)sensor;

            //if (kinectTracker.device == null)
            //    return;

            //upperLegSensor = kinectTracker.device.GetBone(0, footTarget.side, SideBone.UpperLeg);
            //lowerLegSensor = kinectTracker.device.GetBone(0, footTarget.side, SideBone.LowerLeg);
            //footSensor = kinectTracker.device.GetBone(0, footTarget.side, SideBone.Foot);
        }
Пример #11
0
 public TrackerProps(SerializedObject serializedObject, HumanoidControl_Editor.HumanoidTargetObjs targetObjs, Kinect2Tracker kinectTracker)
     : base(serializedObject, targetObjs, kinectTracker, "kinectTracker")
 {
 }