Skip to content

Commit

Permalink
VIS-6783 Make laser marks export depend on z axis of keypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
amakhno committed Jul 11, 2024
1 parent 8bcbfd8 commit a254d0e
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions math/Frame3f.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Text;
using System.Diagnostics;
using g3;
using System.Globalization;

namespace g3
{
Expand Down Expand Up @@ -68,6 +69,12 @@ public Frame3f(Vector3f origin, Vector3f x, Vector3f y, Vector3f z)
this.rotation = m.ToQuaternion();
}

public Frame3f(double x, double y, double z, double rx, double ry, double rz, double rw)
{
this.origin = new Vector3f((float)x, (float)y, (float)z);
this.rotation = new Quaternionf((float)rx, (float)ry, (float)rz, (float)rw);
}


public Quaternionf Rotation
{
Expand Down Expand Up @@ -448,10 +455,17 @@ public readonly bool EpsilonEqual(Frame3f f2, float epsilon) {
rotation.EpsilonEqual(f2.rotation, epsilon);
}


public override readonly string ToString() {
return ToString("F4");
public readonly string ToShortString() {
string xString = origin.x.ToString("F4", CultureInfo.InvariantCulture);
string yString = origin.y.ToString("F4", CultureInfo.InvariantCulture);
string zString = origin.z.ToString("F4", CultureInfo.InvariantCulture);
string rxString = rotation.x.ToString("F4", CultureInfo.InvariantCulture);
string ryString = rotation.y.ToString("F4", CultureInfo.InvariantCulture);
string rzString = rotation.z.ToString("F4", CultureInfo.InvariantCulture);
string rwString = rotation.w.ToString("F4", CultureInfo.InvariantCulture);
return string.Join(", ", xString, yString, zString, rxString, ryString, rzString, rwString);
}

public readonly string ToString(string fmt) {
return string.Format("[Frame3f: Origin={0}, X={1}, Y={2}, Z={3}]", Origin.ToString(fmt), X.ToString(fmt), Y.ToString(fmt), Z.ToString(fmt));
}
Expand Down

0 comments on commit a254d0e

Please sign in to comment.