Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VIS 6783 Add short Frame3f constructor #50

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Conversation

amakhno
Copy link

@amakhno amakhno commented Jul 11, 2024

Problem

Sometimes I need to save frame3 and then create it in the test to repeat a case

The default constructor creates too many symbols if you call it often

Solution

Create as short a constructor as possible, with 7 double arguments.

Also, the ToString method is not comfortable for copying to the constructor, so I added a new one

image

@@ -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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you cast double to float either way, wouldn't it be easier to just accept floats in constructor?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, I usually use double, and, then, to call it, I would need to write new Frame3f((float)0.5, ...) or new Frame3f(0.5f, ...). Both are waste of time

@amakhno amakhno merged commit 7eebc12 into softsmile Jul 12, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants