예제 #1
0
        public static Quaternion ToUnityQuaternion(this ApiQuaternion apiQuaternion)
        {
            var glWorldQuaternion = new Quaternion(
                apiQuaternion.Qx, apiQuaternion.Qy, apiQuaternion.Qz, apiQuaternion.Qw);

            return(_unityWorldToGLWorldRotation * glWorldQuaternion);
        }
예제 #2
0
        public static ApiQuaternion ToApiQuaternion(this Quaternion quaternion)
        {
            Quaternion glWorldQuaternion = _glWorldToUnityWorldRotation * quaternion;
            var        apiQuaternion     = new ApiQuaternion();

            apiQuaternion.Qx = glWorldQuaternion.x;
            apiQuaternion.Qy = glWorldQuaternion.y;
            apiQuaternion.Qz = glWorldQuaternion.z;
            apiQuaternion.Qw = glWorldQuaternion.w;
            return(apiQuaternion);
        }
예제 #3
0
        public static IntPtr AddAnchor(IntPtr sessionHandle, IntPtr earthHandle,
                                       double latitude, double longitude, double altitude, Quaternion eunRotation)
        {
            IntPtr anchorHandle = IntPtr.Zero;

#if !UNITY_IOS || GEOSPATIAL_IOS_SUPPORT
            ApiQuaternion apiQuaternion = eunRotation.ToApiQuaternion();
            ApiArStatus   status        = ExternApi.ArEarth_acquireNewAnchor(
                sessionHandle, earthHandle, latitude, longitude, altitude,
                ref apiQuaternion, ref anchorHandle);
            if (status != ApiArStatus.Success)
            {
                Debug.LogErrorFormat("Failed to add Geospatial Anchor, status '{0}'", status);
            }
#endif
            return(anchorHandle);
        }
예제 #4
0
 public static extern ApiArStatus ArEarth_acquireNewAnchor(
     IntPtr session, IntPtr earth, double latitude, double longitude,
     double altitude, ref ApiQuaternion eus_quaternion_4, ref IntPtr out_anchor);