Esempio n. 1
0
        public void ReceiveHeadPoseData(HeadPoseData data)
        {
            if (Rack.DMIBox.NetytarControlMode == NetytarControlModes.EyePos)
            {
                if (data.HasHeadPosition)
                {
                    B = (float)(data.HeadRotation.Y - Rack.DMIBox.HeadPoseBaseY);
                    int Bnorm = (int)((B * 127f) / maxSwing);

                    Rack.DMIBox.NetytarMainWindow.BreathSensorValue = Bnorm;
                    Rack.DMIBox.Pressure = (int)(Bnorm * 2 * sensitivity);
                    //NetytarRack.DMIBox.Modulation = (int)(Bnorm / 8 * sensitivity);

                    if (Bnorm > onThresh && Rack.DMIBox.Blow == false)
                    {
                        Rack.DMIBox.Blow = true;
                        //NetytarRack.DMIBox.Pressure = 110;
                    }

                    if (Bnorm < offThresh)
                    {
                        Rack.DMIBox.Blow = false;
                    }
                }
            }
        }
Esempio n. 2
0
 public void CopyFrom(HeadPoseData data)
 {
     this.Yaw   = data.Yaw;
     this.Pitch = data.Pitch;
     this.Roll  = data.Roll;
     this.X     = data.X;
     this.Y     = data.Y;
     this.Z     = data.Z;
 }
Esempio n. 3
0
 public void CopyFrom(HeadPoseData data)
 {
     this.Yaw = data.Yaw;
     this.Pitch = data.Pitch;
     this.Roll = data.Roll;
     this.X = data.X;
     this.Y = data.Y;
     this.Z = data.Z;
 }
Esempio n. 4
0
        private void ReadFromNpClient()
        {
            var data = new HeadPoseData();

            if (spoofer.ReadPosition(ref data))
            {
                Input.CopyFrom(data);
                OnUpdate();
            }
        }
Esempio n. 5
0
        public override void DoBeforeNextExecute()
        {
            if (output != null)
            {
                spoofer.SetPosition(Output.X, Output.Y, Output.Z, Output.Roll, Output.Pitch, Output.Yaw);
                output = null;
            }

            if (GlobalHasUpdateListener || ExplicitReadRequested)
            {
                ReadFromNpClient();
            }
        }
        public void ReceiveHeadPoseData(HeadPoseData data)
        {
            if (Rack.UserSettings.NetytarControlMode == _NetytarControlModes.EyeVel)
            {
                if (data.HasHeadPosition)
                {
                    if (lastData == null)
                    {
                        lastData = data;
                    }
                    else
                    {
                        diffVector.X = ((data.HeadRotation.X - lastData.HeadRotation.X) * 5000);
                        diffVector.Y = ((data.HeadRotation.Y - lastData.HeadRotation.Y) * 3000);

                        double diffXq = Math.Pow(diffVector.X, 2);
                        double diffYq = Math.Pow(diffVector.Y, 2);

                        vel = Math.Sqrt(diffXq + diffYq);
                        dir = Math.Atan2(diffVector.Y, diffVector.X);

                        velPoint.X = (int)vel;

                        filter.Push(velPoint);
                        velPoint = filter.GetOutput();

                        int Bfinal = velPoint.X;

                        Rack.DMIBox.TestString = ("Vel: " + Bfinal.ToString() + "\n Dir: " + dir.ToString() + "\n X: " + data.HeadRotation.X + "\n Y: " + data.HeadRotation.Y);
                        Rack.DMIBox.NetytarMainWindow.BreathSensorValue = Bfinal;
                        Rack.DMIBox.Pressure = (int)(Bfinal * sensitivity);
                        // NetytarRack.DMIBox.Modulation = (int)(Bfinal / 16 * sensitivity);

                        if (Bfinal > onThresh && Rack.DMIBox.Blow == false)
                        {
                            Rack.DMIBox.Blow = true;
                            // NetytarRack.DMIBox.Pressure = 110;
                        }

                        if (Bfinal < offThresh)
                        {
                            Rack.DMIBox.Blow = false;
                        }

                        lastData = data;
                    }
                }
            }
        }
Esempio n. 7
0
 protected bool Equals(HeadPoseData other)
 {
     return(X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z) && Yaw.Equals(other.Yaw) && Pitch.Equals(other.Pitch) && Roll.Equals(other.Roll));
 }
Esempio n. 8
0
 public TrackIRPlugin()
 {
     Input = new HeadPoseData();
 }
Esempio n. 9
0
 protected bool Equals(HeadPoseData other)
 {
     return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z) && Yaw.Equals(other.Yaw) && Pitch.Equals(other.Pitch) && Roll.Equals(other.Roll);
 }