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); }
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); }
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)); }
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)); }