public Position(
                double x,
                double y,
                Tobii.Interaction.Vector3 left_eye,
                Tobii.Interaction.Vector3 right_eye,
                Tobii.Interaction.Vector3 head_position,
                Tobii.Interaction.Vector3 head_direction)
            {
                X = x;
                Y = y;

                MultidimensionCalibrationType type = Options.Instance.calibration_mode.multidimension_calibration_type;

                if ((type & MultidimensionCalibrationType.HeadPosition) != MultidimensionCalibrationType.None)
                {
                    HeadPosition = head_position;
                }

                if ((type & MultidimensionCalibrationType.HeadDirection) != MultidimensionCalibrationType.None)
                {
                    HeadDirection = head_direction;
                }

                if ((type & MultidimensionCalibrationType.LeftEye) != MultidimensionCalibrationType.None)
                {
                    LeftEye = left_eye;
                }

                if ((type & MultidimensionCalibrationType.RightEye) != MultidimensionCalibrationType.None)
                {
                    RightEye = right_eye;
                }

                AdjustColorBoundaries();
            }
Esempio n. 2
0
 private void OnHeadPose(double unused, Tobii.Interaction.Vector3 head_position, Tobii.Interaction.Vector3 head_direction)
 {
     lock (Helpers.locker)
     {
         if (!(head_position.X == 0 && head_position.Y == 0 && head_position.Z == 0))
         {
             this.head_position  = head_position;
             this.head_direction = new Tobii.Interaction.Vector3(head_direction.X * 200, head_direction.Y * 200, head_direction.Z * 200);
         }
     }
 }
        public Tobii.Interaction.Vector3 SmoothPoint(Tobii.Interaction.Vector3 point)
        {
            smoothers[0].AddPoint((float)point.X);
            smoothers[1].AddPoint((float)point.Y);
            smoothers[2].AddPoint((float)point.Z);

            point.X = smoothers[0].GetSmoothenedPoint();
            point.Y = smoothers[1].GetSmoothenedPoint();
            point.Z = smoothers[2].GetSmoothenedPoint();

            return(point);
        }
 private void OnHeadPose(double unused, Tobii.Interaction.Vector3 head_position, Tobii.Interaction.Vector3 head_direction)
 {
     lock (Helpers.locker)
     {
         if (!(head_position.X == 0 && head_position.Y == 0 && head_position.Z == 0))
         {
             coordinates.head_position  = head_position_smoother.SmoothPoint(head_position);
             coordinates.head_direction = head_direction_smoother.SmoothPoint(
                 new Tobii.Interaction.Vector3(head_direction.X * 200, head_direction.Y * 200, head_direction.Z * 200));
         }
     }
 }
Esempio n. 5
0
 private void OnEyePosition(Tobii.Interaction.EyePositionData obj)
 {
     lock (Helpers.locker)
     {
         if (obj.HasLeftEyePosition)
         {
             var v = obj.LeftEyeNormalized;
             this.left_eye = new Tobii.Interaction.Vector3(v.X * 200, v.Y * 100, v.Z * 500);
         }
         if (obj.HasRightEyePosition)
         {
             var v = obj.RightEyeNormalized;
             this.right_eye = new Tobii.Interaction.Vector3(v.X * 200, v.Y * 100, v.Z * 500);
         }
     }
 }
Esempio n. 6
0
        private Tobii.Interaction.Vector3 GetColorComponents(float[] coordinates)
        {
            var color_components = new Tobii.Interaction.Vector3(0, 0, 0);

            for (int i = 2; i < coordinates.Length; i++)
            {
                int component_index = (i - 2) % 3;
                switch (component_index)
                {
                case 0: color_components.X += coordinates[i]; break;

                case 1: color_components.Y += coordinates[i]; break;

                case 2: color_components.Z += coordinates[i]; break;

                default: Debug.Assert(false); break;
                }
            }

            return(color_components);
        }
 private static double SquaredDistance(Tobii.Interaction.Vector3 a, Tobii.Interaction.Vector3 b)
 {
     return((Math.Pow(a.X - b.X, 2) + Math.Pow(a.Y - b.Y, 2) + Math.Pow(a.Z - b.Z, 2)) * Math.Pow(Options.Instance.calibration_mode.multi_dimensions_detalization, 2));
 }