Skip to content

Commit

Permalink
Merge remote-tracking branch 'Dunbaratu/direction-vector-fix' into de…
Browse files Browse the repository at this point in the history
…velop
  • Loading branch information
Chris Woerz committed Jun 27, 2014
2 parents 7efca62 + 44db83e commit 61e9891
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Suffixed/Direction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public Direction(Quaternion q)
{
rotation = q;
euler = q.eulerAngles;
vector = rotation * Vector3d.forward;
}

public Direction(Vector3d v3D, bool isEuler)
Expand All @@ -37,7 +38,7 @@ public Vector3d Vector
get { return vector; }
set
{
vector = value;
vector = value.normalized;
rotation = Quaternion.LookRotation(value);
euler = rotation.eulerAngles;
}
Expand All @@ -50,6 +51,7 @@ public Vector3d Euler
{
euler = value;
rotation = Quaternion.Euler(value);
vector = rotation * Vector3d.forward;
}
}

Expand All @@ -60,6 +62,7 @@ public Quaternion Rotation
{
rotation = value;
euler = value.eulerAngles;
vector = rotation * Vector3d.forward;
}
}

Expand Down

0 comments on commit 61e9891

Please sign in to comment.