// Use Api.Instance.PropApi.CreateProp for public construction internal Prop( PropsApiInternal propsApiInternal, int id, PropOptions options) { if (propsApiInternal == null) { throw new ArgumentNullException("propsApiInternal"); } if (options == null) { throw new ArgumentNullException("options"); } if (id == InvalidId) { throw new ArgumentException("invalid id"); } m_propsApiInternal = propsApiInternal; Id = id; m_elevationMode = options.GetElevationMode(); m_position.SetLatitude(options.GetLatitudeDegrees()); m_position.SetLongitude(options.GetLongitudeDegrees()); m_elevation = options.GetElevation(); m_indoorMapId = options.GetIndoorMapId(); m_indoorMapFloorId = options.GetIndoorMapFloorId(); m_name = options.GetName(); m_geometryId = options.GetGeometryId(); m_headingDegrees = options.GetHeadingDegrees(); }
// Update is called once per frame void Update() { if (Input.location.status == LocationServiceStatus.Running) { statusText.text = "Running"; latitude = Input.location.lastData.latitude; longitude = Input.location.lastData.longitude; latLong.SetLatitude(latitude); latLong.SetLongitude(longitude); } else { statusText.text = "Starting..."; } }
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()); }
void Update() { // Update movement angle from input movementAngle += Input.GetAxis("Horizontal") * turnSpeed * Time.deltaTime; coordinateFrame.SetHeading(movementAngle); // Update target position from input var latitudeDelta = Mathf.Cos(Mathf.Deg2Rad * movementAngle) * Input.GetAxis("Vertical") * movementSpeed * Time.deltaTime; var longitudeDelta = Mathf.Sin(Mathf.Deg2Rad * movementAngle) * Input.GetAxis("Vertical") * movementSpeed * Time.deltaTime; targetPosition.SetLatitude(targetPosition.GetLatitude() + (latitudeDelta * 0.00006f)); targetPosition.SetLongitude(targetPosition.GetLongitude() + (longitudeDelta * 0.00006f)); // Command GeographicTransform to move using lat-long coordinateFrame.SetPosition(targetPosition); }
// Update is called once per frame void Update() { position.SetLatitude(GPS.Instance.latitude); position.SetLongitude(GPS.Instance.longitude); player.SetPosition(position); }