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)); }
static extern IntPtr HTCSensorGetDataOutput(IntPtr handle, out HTCGSensorData sensorData);
extern static IntPtr HTCSensorGetDataOutput(IntPtr handle, out HTCGSensorData sensorData);