Exemplo n.º 1
0
    protected virtual void Move(Vector2 axisDirection)
    {
        if (isHeightOnly)
        {
            //Debug.Log(axisDirection);

            Vector2 updatedPosition = axisDirection * currentSpeed * Time.deltaTime * EarthLatLongMultiplier;
            var     alt             = latLongAlt.GetAltitude();
            alt += updatedPosition.y;
            //Debug.Log(axisDirection);

            latLongAlt.SetAltitude(alt);
        }
        else
        {
            Vector2 updatedPosition = axisDirection * currentSpeed * Time.deltaTime * EarthLatLongMultiplier;

            var lng = latLongAlt.GetLongitude();
            lng += updatedPosition.x;

            var lat = latLongAlt.GetLatitude();
            lat += updatedPosition.y;

            latLongAlt.SetLongitude(lng);
            latLongAlt.SetLatitude(lat);
        }

        Api.Instance.SetOriginPoint(latLongAlt);

        //if (CanMove(bodyPhysics, controlledGameObject.transform.position, finalPosition))
        //{
        //    controlledGameObject.transform.position = finalPosition;
        //}
    }
Exemplo n.º 2
0
    private void SetPosition()
    {
        latLongAlt.SetLatitude(startLatLongAlt.GetLatitude() + (double)latitude);
        latLongAlt.SetLongitude(startLatLongAlt.GetLongitude() + (double)longitude);
        latLongAlt.SetAltitude(startLatLongAlt.GetAltitude() + (double)altitudeInMetres);

        Api.Instance.SetOriginPoint(latLongAlt);
    }
Exemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (initialized)
        {
            //var latlong = latLongAlt.GetLatLong();
            var lng = latLongAlt.GetLongitude();
            lng += .001 * Time.deltaTime;

            var lat = latLongAlt.GetLatitude();
            lat += 0.001 * Time.deltaTime;

            latLongAlt.SetLongitude(lng);
            latLongAlt.SetLatitude(lat);

            Api.Instance.SetOriginPoint(latLongAlt);
        }
        //Api.Instance.CameraApi.
    }