-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add helper for 3D gizmos and unify box #80278
Add helper for 3D gizmos and unify box #80278
Conversation
Vector3 ray_dir = p_camera->project_ray_normal(p_point); | ||
|
||
r_segment[0] = gi.xform(ray_from); | ||
r_segment[1] = gi.xform(ray_from + ray_dir * 4096); |
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.
Not sure about the value here. Some gizmos used 16k, but not all. Doesn't seem to affect editing, but maybe it's noticeable on very big scales, idk. It could be a parameter.
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.
Anything bad with defaulting to 16k?
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.
No idea, hence I'm asking. I could change it to 16k.
e679e2e
to
c75e589
Compare
Wow, this is amazing. I'll check in later when the tests pass. |
Unfortunately I have no idea why the checks fail. |
Making the destructors of the classes using the helper seems to make the problem go away, I suspect it is due to compilation order, and that the first time the class destructor is referenced it is defined, causing problems if it is requested in a context where the include isn't present, the least invasive fix would be to add the constructors, haven't tested but compiling Edit: confirmed, this solves the compilation, will look into doing a PR to make this behaviour not context dependent across the engine |
c75e589
to
7fe526d
Compare
|
7fe526d
to
0fd86f8
Compare
It does not make any sense, but it seems to have helped. |
Looking into an alternative fix, general instead and unrelated to this PR, it's currently compiling, will see if it works |
I think an alternative fix might be including gizmo helper in Node3D editor plugin.
Order is enforced by formatting. |
I meant in the My alternative fix unfortunately didn't work so will look at other cases to prevent the context dependent issue, ensuring that you don't run into a hard to diagnose error by having the result depend on which source is compiled first, so I'd say to keep the explicit destructors here |
0fd86f8
to
ae687da
Compare
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.
Looks good to me, though I didn't test. Might be worth rebasing.
ae687da
to
36681b6
Compare
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.
Tested locally, it mostly works as expected. I noticed one issue related to this PR:
- Decal does not use the new handler for resizing only one size, so it always behaves as if Alt as held down.
ReflectionProbe, VoxelGI and CSGBox3D all behave as expected.
Gizmo handle icons are also broken, but this also occurs in master
:
36681b6
to
0c67124
Compare
Modified decal editor. |
|
0c67124
to
b61a4d1
Compare
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.
Modified decal editor.
Works great now 🙂
b61a4d1
to
015953a
Compare
Thanks! PS. Maybe for side handles we want a different icon? Like a similarly styled square instead of a circle? |
@KoBeWi is it posible to make it work so the center of the node doesn't change when moving the gizmos? If so I can create a proposal. For things like Reflection Probes could be helpful so the offset and the center dont move when moving the gizmo |
When you hold Alt while resizing the node stays in place. |
@KoBeWi but both size resize evenly. Im talking about one side at the time |
Eh I think I don't understand. You can open a proposal about it I guess and explain in details. |
Follow-up to #71092
Closes godotengine/godot-proposals#5019
I added a new class similar to ViewPanner and modified every box gizmo I knew about.
godot.windows.editor.dev.x86_64_wug876f0K6.mp4
We could do the same refactor for other shapes too. The code duplication is huge.