コード例 #1
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));
        }
コード例 #2
0
ファイル: HTCGSensor.cs プロジェクト: nipzirk/Sensor-Remote
 static extern IntPtr HTCSensorGetDataOutput(IntPtr handle, out HTCGSensorData sensorData);
コード例 #3
0
 extern static IntPtr HTCSensorGetDataOutput(IntPtr handle, out HTCGSensorData sensorData);