Skip to content
Snippets Groups Projects
Commit a7939ef5 authored by John Schihada's avatar John Schihada
Browse files

Fixed the Orientation-Problem of the AngleGO. Problem was: Vector3.Angle()...

Fixed the Orientation-Problem of the AngleGO. Problem was: Vector3.Angle() returns only an Angle <= 180°
parent 13755f40
No related branches found
No related tags found
No related merge requests found
......@@ -158,7 +158,7 @@ public void SpawnAngle(AngleFact angleFact)
//Rotate so that the rotation points from point2 to the middle of point3 and point1
angle.transform.GetChild(0).rotation = Quaternion.FromToRotation(Vector3.right, (Vector3.Lerp((tempPoint1 - point2).normalized, (tempPoint3 - point2).normalized, 0.5f)));
//Now the rotation around that direction must also be adjusted
angle.transform.GetChild(0).RotateAround(point2, (Vector3.Lerp((tempPoint1 - point2).normalized, (tempPoint3 - point2).normalized, 0.5f)), Vector3.Angle(angle.transform.GetChild(0).forward.normalized, (tempPoint3 - tempPoint1).normalized));
angle.transform.GetChild(0).RotateAround(point2, (Vector3.Lerp((tempPoint1 - point2).normalized, (tempPoint3 - point2).normalized, 0.5f)), Vector3.Angle(angle.transform.GetChild(0).forward.normalized, (tempPoint1 - tempPoint3).normalized));
string letter = ((Char)(64 + angleFact.Id + 1)).ToString();
angle.GetComponentInChildren<TextMeshPro>().transform.localPosition = new Vector3((0.5f * tempProjection).x, angle.GetComponentInChildren<TextMeshPro>().transform.localPosition.y, (0.5f * tempProjection).z);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment