Example #1
0
        public GVector Scale(double scale)
        {
            GVector ret = this;

            ret.myX *= scale;
            ret.myY *= scale;
            ret.myZ *= scale;
            return(ret);
        }
Example #2
0
        public override GVector GetGVector()
        {
            int[] outBuffer = new int[3];
            DeviceIoControl(ACCReadValues, new int[1] { 0 }, outBuffer);

            GVector ret = new GVector();
            ret.X = outBuffer[1];
            ret.Y = outBuffer[0];
            ret.Z = -outBuffer[2];
            double samsungScaleFactor = 1.0 / 1000.0 * 9.8 * 3.3793103448275862068965517241379;
            return ret.Scale(samsungScaleFactor);
        }
Example #3
0
 public override GVector GetGVector()
 {
     GVector ret = new GVector();
     HTCGSensorData data = GetRawSensorData();
     ret.X = data.TiltX;
     ret.Y = data.TiltY;
     ret.Z = data.TiltZ;
     // HTC's Sensor returns a vector which is around 1000 in length on average..
     // but it really depends on how the device is oriented.
     // When simply face up, my Diamond returns a vector of around 840 in length.
     // While face down, it returns a vector of around 1200 in length.
     // The vector direction is fairly accurate, however, the length is clearly not extremely precise.
     double htcScaleFactor = 1.0 / 1000.0 * 9.8;
     return ret.Scale(htcScaleFactor);
 }
Example #4
0
        public override GVector GetGVector()
        {
            int[] outBuffer = new int[3];
            DeviceIoControl(ACCReadValues, new int[1] {
                0
            }, outBuffer);

            GVector ret = new GVector();

            ret.X = outBuffer[1];
            ret.Y = outBuffer[0];
            ret.Z = -outBuffer[2];
            double samsungScaleFactor = 1.0 / 1000.0 * 9.8 * 3.3793103448275862068965517241379;

            return(ret.Scale(samsungScaleFactor));
        }
Example #5
0
        public override GVector GetGVector()
        {
            GVector        ret  = new GVector();
            HTCGSensorData data = GetRawSensorData();

            ret.X = data.TiltX;
            ret.Y = data.TiltY;
            ret.Z = data.TiltZ;
            // HTC's Sensor returns a vector which is around 1000 in length on average..
            // but it really depends on how the device is oriented.
            // When simply face up, my Diamond returns a vector of around 840 in length.
            // While face down, it returns a vector of around 1200 in length.
            // The vector direction is fairly accurate, however, the length is clearly not extremely precise.
            double htcScaleFactor = 1.0 / 1000.0 * 9.8;

            return(ret.Scale(htcScaleFactor));
        }