public static Vector3 TransformMatrix(GPSLocation startLocaion, GPSLocation endLocation, Vector3 originalVector3) { var bearing = MathLocation.CalculateBearingRadians(startLocaion, endLocation); var originalVector = new Vector4(originalVector3.x, originalVector3.y, originalVector3.z, 1); var rotationMatrix = RotateAroundY(bearing); return(rotationMatrix * originalVector); }
private void ControlErase() { foreach (Hatch hatch in hatches) { if (raduis <= MathLocation.CalculateDistance(GPSTraker.currentlocation, hatch.location)) { hatch.state = State.toErase; } } }
//public Text distText; private void ControlDraw() { foreach (Hatch hatch in JSONReader.hatches) { distance = MathLocation.CalculateDistance(GPSTraker.currentlocation, hatch.location); //distText = FindObjectOfType<Text>(); //asd = FindObjectOfType<Text>(); //distText.text = "asd"; if (raduis >= distance && hatch.state == State.unDrawed) { hatch.distance = distance; hatches.Add(hatch); } } }