예제 #1
0
        public void GeodToDatabase()
        {
            CoordConverter.SetRefLatLon(Real.DatabaseRefLatlon);
            var database = CoordConverter.GeodeticToDatabase(Real.Geod);

            Debug.Log(database.X + " -> " + Real.Database.X);
            Debug.Log(database.Y + " -> " + Real.Database.Y);
            Debug.Log(database.Z + " -> " + Real.Database.Z);

            Assert.AreEqual(Real.Database.X, database.X, 0.015);
            Assert.AreEqual(Real.Database.Y, database.Y, 0.015);
            Assert.AreEqual(Real.Database.Z, database.Z, 0.015);
        }
예제 #2
0
        public void GetDeadRecoknedPositionAndRotation(out Vector3 position, out Quaternion rotation)
        {
            float elapsedTime = TimeSinceLastHeartbeat;

            GeocentricCoord location;
            Vector3Float    orientation;

            DeadReckoningCalculator.Calculate(State, elapsedTime, out location, out orientation);

            var geod             = CoordConverter.GeocentricToGeodetic(location);
            var databaseLocation = CoordConverter.GeodeticToDatabase(geod);

            position = (Vector3)databaseLocation;
            rotation = Quaternion.Euler(CoordConverter.OrientationToUnityEuler(orientation, (LatLonCoord)geod));
        }