finished gate book

This commit is contained in:
klemek
2020-12-22 19:11:55 +01:00
parent ac85bdcdf2
commit 13718af6da
9 changed files with 232 additions and 45 deletions
+8 -8
View File
@@ -137,14 +137,14 @@ namespace CompuLogic.Workspace
else
{
var startOr = StartAnchor.Orientation;
var endOr = StartAnchor.Orientation;
var endOr = EndAnchor.Orientation;
_line.positionCount = 4;
_line.SetPosition(0, startPos);
if (Mathf.Abs(startOr.x) > 0)
if (Mathf.Abs(startOr.x) > Mathf.Epsilon)
{
if (Mathf.Abs(endOr.x) > 0)
if (Mathf.Abs(endOr.x) > Mathf.Epsilon)
{
var middle = (startPos.x + endPos.x) / 2;
_line.SetPosition(1, new Vector3(middle, startPos.y, startPos.z));
@@ -152,13 +152,13 @@ namespace CompuLogic.Workspace
}
else
{
_line.SetPosition(1, new Vector3(startPos.x, endPos.y, startPos.z));
_line.SetPosition(2, new Vector3(startPos.x, endPos.y, startPos.z));
_line.SetPosition(1, new Vector3(endPos.x, startPos.y, startPos.z));
_line.SetPosition(2, new Vector3(endPos.x, startPos.y, startPos.z));
}
}
else
{
if (Mathf.Abs(endOr.x) > 0)
if (Mathf.Abs(endOr.x) > Mathf.Epsilon)
{
var middle = (startPos.y + endPos.y) / 2;
_line.SetPosition(1, new Vector3(startPos.x, middle, startPos.z));
@@ -166,8 +166,8 @@ namespace CompuLogic.Workspace
}
else
{
_line.SetPosition(1, new Vector3(endPos.x, startPos.y, startPos.z));
_line.SetPosition(2, new Vector3(endPos.x, startPos.y, startPos.z));
_line.SetPosition(1, new Vector3(startPos.x, endPos.y, startPos.z));
_line.SetPosition(2, new Vector3(startPos.x, endPos.y, startPos.z));
}
}