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; //} }
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); }