Пример #1
0
    void Update()
    {
        // Update target position from input
        float latitudeDelta  = Input.GetAxis("Vertical") * movementSpeed * Time.deltaTime;
        float longitudeDelta = Input.GetAxis("Horizontal") * movementSpeed * Time.deltaTime;

        targetPosition.SetLatitude(targetPosition.GetLatitude() + (latitudeDelta * 0.00006f));
        targetPosition.SetLongitude(targetPosition.GetLongitude() + (longitudeDelta * 0.00006f));

        // Command positioner to move using lat-long
        positioner.SetLocation(targetPosition.GetLatitude(), targetPosition.GetLongitude());

        // Update physical location via GeometryTransform, with corrected ECEF fetched from positioner
        coordinateFrame.SetPosition(positioner.GetECEFLocation());
    }
Пример #2
0
    void OnEnable()
    {
        Api.Instance.GeographicApi.RegisterGeographicTransform(coordinateFrame);
        targetPosition = startPosition;
        positioner     = Api.Instance.PositionerApi.CreatePositioner(new PositionerOptions()
                                                                     .LatitudeDegrees(targetPosition.GetLatitude())
                                                                     .LongitudeDegrees(targetPosition.GetLongitude())
                                                                     .ElevationAboveGround(100));



        Api.Instance.CameraApi.MoveTo(targetPosition, distanceFromInterest: 1700, headingDegrees: 0, tiltDegrees: 45);
        coordinateFrame.SetPosition(targetPosition);

        box.SetParent(coordinateFrame.transform);
        box.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
        box.localRotation = Quaternion.identity;
        positioner.SetLocation(targetPosition.GetLatitude(), targetPosition.GetLongitude());
    }