You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
599 B
21 lines
599 B
using System;
|
|
using UnityEngine;
|
|
|
|
namespace ARLocation
|
|
{
|
|
public static class AndroidMagneticDeclination
|
|
{
|
|
public static float GetDeclination(Location location)
|
|
{
|
|
#if PLATFORM_ANDROID
|
|
long time = DateTimeOffset.Now.ToUnixTimeMilliseconds();
|
|
|
|
var javaObject = new AndroidJavaObject("com.dmbfm.magneticdeclination.MagneticDeclination");
|
|
|
|
return javaObject.Call<float>("GetMagneticDeclination", (float) location.Latitude, (float) location.Longitude, (float) location.Altitude, time);
|
|
#else
|
|
return 0.0f;
|
|
#endif
|
|
}
|
|
}
|
|
}
|