-
-
Notifications
You must be signed in to change notification settings - Fork 26.4k
Add normalization button to Quaternion inspector #98308
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -487,14 +487,17 @@ class EditorPropertyQuaternion : public EditorProperty { | |||||
| AcceptDialog *warning_dialog = nullptr; | ||||||
|
|
||||||
| Label *euler_label = nullptr; | ||||||
| VBoxContainer *normalize_quaternion = nullptr; | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The name should be clearer.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. However, I felt that the normalization button is overemphasized. So how about making the letters “Nrm” or “1.0” into icons and placing them to the right of the SpinBox? Then, it will conflicts with EulerEdit, so I think it would be smartest way is making it function as Nrm button when In other words, it places only one button to the right of the SpinBox, whose icon changes depending on the state of |
||||||
| VBoxContainer *edit_custom_bc = nullptr; | ||||||
| EditorSpinSlider *euler[3]; | ||||||
| Button *edit_button = nullptr; | ||||||
| Button *normalize_quaternion_bttn = nullptr; | ||||||
|
TokageItLab marked this conversation as resolved.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Nitpick for consistency with other classes. |
||||||
|
|
||||||
| Vector3 edit_euler; | ||||||
|
|
||||||
| void _value_changed(double p_val, const String &p_name); | ||||||
| void _edit_custom_value(); | ||||||
| void _edit_normalize_quaternion_value(); | ||||||
| void _custom_value_changed(double p_val); | ||||||
| void _warning_pressed(); | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -865,6 +865,8 @@ void Skeleton3D::set_bone_pose_rotation(int p_bone, const Quaternion &p_rotation | |||||||
| const int bone_size = bones.size(); | ||||||||
| ERR_FAIL_INDEX(p_bone, bone_size); | ||||||||
|
|
||||||||
| //ERR_FAIL_COND_EDMSG(!p_rotation.is_normalized(), "The quaternion bone " + get_bone_name(p_bone) + " pose rotation must be normalized."); | ||||||||
|
|
||||||||
|
Comment on lines
+868
to
+871
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I recommend removing it to focus on PR for adding buttons for now. If we are going to add checks, we should add some checks to the fundamental of the Skeleton, not only the Rotation check, but also the Scale of 0 check, etc. |
||||||||
| bones[p_bone].pose_rotation = p_rotation; | ||||||||
| bones[p_bone].pose_cache_dirty = true; | ||||||||
| if (is_inside_tree()) { | ||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that the precision threshold should not be changed, and if the precision is insufficient prior to this point, and I think it is possible to increase the precision by using double insteads real_t (float) within the calculation as commented in #98090 (comment).