Пример #1
0
        void RegisterSelf()
        {
            if (!m_hasEverBeenRegistered && Api.Instance != null)
            {
                var positionerOptions = new Positioners.PositionerOptions()
                                        .LatitudeDegrees(InitialLatitude)
                                        .LongitudeDegrees(InitialLongitude);

                if (ElevationMode == ElevationMode.HeightAboveSeaLevel)
                {
                    positionerOptions = positionerOptions.ElevationAboveSeaLevel(InitialElevation);
                }
                else
                {
                    positionerOptions = positionerOptions.ElevationAboveGround(InitialElevation);
                }

                if (IndoorMapID != "")
                {
                    positionerOptions = positionerOptions.IndoorMapWithFloorId(IndoorMapID, IndoorMapFloorId);
                }

                m_positioner = Api.Instance.PositionerApi.CreatePositioner(positionerOptions);

                m_positioner.OnTransformedPointChanged += UpdateECEFLocation;

                Api.Instance.GeographicApi.RegisterGeographicTransform(this);
                m_hasEverBeenRegistered = true;
            }
        }
Пример #2
0
        public Positioner CreatePositioner(PositionerOptions positionerOptions)
        {
            var createParamsInterop = new PositionerCreateParamsInterop
            {
                ElevationMode    = positionerOptions.GetElevationMode(),
                LatitudeDegrees  = positionerOptions.GetLatitudeDegrees(),
                LongitudeDegrees = positionerOptions.GetLongitudeDegrees(),
                Elevation        = positionerOptions.GetElevation(),
                IndoorMapId      = positionerOptions.GetIndoorMapId(),
                IndoorMapFloorId = positionerOptions.GetIndoorMapFloorId(),
                UsingFloorId     = positionerOptions.IsUsingFloorId()
            };

            var positionerId = NativePositionerApi_CreatePositioner(NativePluginRunner.API, ref createParamsInterop);

            var positioner = new Positioner(
                this,
                positionerId,
                positionerOptions.GetElevationMode());

            m_positionerIdToObject.Add(positionerId, positioner);

            NotifyPositionerProjectionsChanged();

            return(positioner);
        }
Пример #3
0
        public Positioner CreatePositioner(PositionerOptions positionerOptions)
        {
            var createParamsInterop = new PositionerCreateParamsInterop
            {
                ElevationMode    = positionerOptions.GetElevationMode(),
                LatitudeDegrees  = positionerOptions.GetLatitudeDegrees(),
                LongitudeDegrees = positionerOptions.GetLongitudeDegrees(),
                Elevation        = positionerOptions.GetElevation(),
                IndoorMapId      = positionerOptions.GetIndoorMapId(),
                IndoorMapFloorId = positionerOptions.GetIndoorMapFloorId(),
                UsingFloorId     = positionerOptions.IsUsingFloorId()
            };

            var positionerId = NativePositionerApi_CreatePositioner(NativePluginRunner.API, ref createParamsInterop);

            var positioner = new Positioner(
                this,
                positionerId,
                positionerOptions.IsUsingFloorId());

            m_positionerIdToObject.Add(positionerId, positioner);

            DoubleVector3 positionerECEFLocation;

            if (TryFetchECEFLocationForPositioner(positioner.Id, out positionerECEFLocation))
            {
                positioner.SetECEFLocation(positionerECEFLocation);
            }

            return(positioner);
        }
Пример #4
0
    IEnumerator lateStart()
    {
        yield return(new WaitForSeconds(4.0f));

        var positionOpt = new Wrld.Space.Positioners.PositionerOptions();

        //Api.Instance.PositionerApi.CreatePositioner(positionOpt);
        latLongAlt = new LatLongAltitude(37.7858, -122.401, 0);
        // Debug.Log(currentPosition.ToString());

        initialized = true;
    }
Пример #5
0
    private void Start()
    {
        var ct = Controller.HoverTracker(this);
        //ct.onTriggerDown += OnTriggerDown;
        var positionOpt = new Wrld.Space.Positioners.PositionerOptions();

        //Api.Instance.PositionerApi.CreatePositioner(positionOpt);

        startLatLongAlt = Api.Instance.SpacesApi.WorldToGeographicPoint(new Vector3(0, 100, 0));

        Debug.Log(startLatLongAlt.GetLatitude());
        Debug.Log(startLatLongAlt.GetLongitude());
        Debug.Log(startLatLongAlt.GetAltitude());


        latitude         = 0;
        longitude        = 0;
        altitudeInMetres = 0;

        latLongAlt = startLatLongAlt;

        dialogSetLat.Set("Slider", transform.rotation.eulerAngles.y, onChange: value =>
        {
            latitude = value / 9000f;
            SetPosition();
        });

        dialogSetLong.Set("Slider", transform.rotation.eulerAngles.y, onChange: value =>
        {
            longitude = value / 9000f;
            SetPosition();
        });

        dialogSetAlt.Set("Slider", transform.rotation.eulerAngles.y, onChange: value =>
        {
            altitudeInMetres = value;

            SetPosition();
        });
    }
Пример #6
0
 /// <summary>
 /// Creates an instance of a Positioner.
 /// </summary>
 /// <param name="positionerOptions">The PositionerOptions object which defines creation parameters for this Positioner.</param>
 public Positioner CreatePositioner(PositionerOptions positionerOptions)
 {
     return(m_apiInternal.CreatePositioner(positionerOptions));
 }